Skip to content

Commit

Permalink
Sync more GN unit tests with GYP.
Browse files Browse the repository at this point in the history
This adds about 600 more tests.

Tests added: invalidation, navigation interception, feedback, search, sync driver, enhanced bookmarks, search engines, sessions, data reduction proxy, favicon, constrained window, autofill, metrics, keyed service, bookmarks, suggestions, audio modem

I renamed ui_zoom to "zoom" according to GN style. I tweaked some jingle public dependencies so the right include directories get forwarded along with the corresponding uses in the headers.

BUG=
R=dpranke@chromium.org

Review URL: https://codereview.chromium.org/1301743003 .

Cr-Commit-Position: refs/heads/master@{#344577}
  • Loading branch information
Brett Wilson committed Aug 20, 2015
1 parent 28ebede commit a7cde4b
Show file tree
Hide file tree
Showing 30 changed files with 287 additions and 74 deletions.
2 changes: 1 addition & 1 deletion chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ source_set("browser") {
"//components/tracing:startup_tracing",
"//components/translate/core/browser",
"//components/translate/core/common",
"//components/ui/zoom:ui_zoom",
"//components/ui/zoom",
"//components/undo",
"//components/update_client",
"//components/url_formatter",
Expand Down
20 changes: 17 additions & 3 deletions components/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ group("all_components") {
"//components/translate/content/renderer",
"//components/translate/core/browser",
"//components/translate/core/common",
"//components/ui/zoom:ui_zoom",
"//components/ui/zoom",
"//components/undo",
"//components/update_client",
"//components/upload_list",
Expand Down Expand Up @@ -311,6 +311,9 @@ test("components_unittests") {
"//components/devtools_http_handler:unit_tests",
"//components/dom_distiller/core:unit_tests",
"//components/domain_reliability:unit_tests",
"//components/enhanced_bookmarks:unit_tests",
"//components/favicon/content:unit_tests",
"//components/favicon/core:unit_tests",
"//components/favicon_base:unit_tests",
"//components/gcm_driver/crypto:unit_tests",
"//components/gcm_driver/instance_id:unit_tests",
Expand All @@ -319,7 +322,9 @@ test("components_unittests") {
"//components/history/content/browser:unit_tests",
"//components/history/core/browser:unit_tests",
"//components/history/core/common:unit_tests",
"//components/invalidation/impl:unittests",
"//components/invalidation/impl:unit_tests",
"//components/keyed_service/content:unit_tests",
"//components/keyed_service/core:unit_tests",
"//components/login:unit_tests",
"//components/metrics:unit_tests",
"//components/mime_util:unit_tests",
Expand All @@ -331,7 +336,11 @@ test("components_unittests") {
"//components/password_manager/core/browser:unit_tests",
"//components/password_manager/core/common:unit_tests",
"//components/password_manager/sync/browser:unit_tests",
"//components/rappor:unit_tests",
"//components/search:unit_tests",
"//components/search_engines:unit_tests",
"//components/signin/core/browser:unit_tests",
"//components/suggestions:unit_tests",
"//components/sync_driver:unit_tests",
"//components/undo:unit_tests",
"//components/url_formatter:unit_tests",
Expand Down Expand Up @@ -379,8 +388,11 @@ test("components_unittests") {

if (!is_android && !is_ios) {
deps += [
"//components/audio_modem:unit_tests",
"//components/copresence:unit_tests",
"//components/feedback:unit_tests",
"//components/proximity_auth:unit_tests",
"//components/sessions:unit_tests",
]
}

Expand All @@ -402,7 +414,8 @@ test("components_unittests") {
}

if (toolkit_views) {
# TODO(GYP) enable this as above.
# TODO bug 522654 Enable this when the undefined symbol is fixed in
# web_modal such that this links.
#deps += [ "//components/constrained_window:unit_tests" ]
}
if (is_win) {
Expand All @@ -414,6 +427,7 @@ test("components_unittests") {
}
if (!is_ios) {
deps += [
"//components/navigation_interception:unit_tests",
"//components/safe_json:unit_tests",
"//components/scheduler:unit_tests",
]
Expand Down
28 changes: 24 additions & 4 deletions components/audio_modem/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("audio_modem") {
source_set("audio_modem") {
public = [
"public/audio_modem_types.h",
"public/modem.h",
"public/whispernet_client.h",
]
sources = [
"audio_modem_switches.cc",
"audio_modem_switches.h",
Expand All @@ -15,9 +20,6 @@ static_library("audio_modem") {
"constants.cc",
"modem_impl.cc",
"modem_impl.h",
"public/audio_modem_types.h",
"public/modem.h",
"public/whispernet_client.h",
]

deps = [
Expand All @@ -30,6 +32,7 @@ static_library("audio_modem") {
}

source_set("test_support") {
testonly = true
sources = [
"test/random_samples.cc",
"test/random_samples.h",
Expand All @@ -39,8 +42,25 @@ source_set("test_support") {
"test/stub_whispernet_client.h",
]

public_deps = [
":audio_modem",
]
deps = [
"//base",
"//media",
]
}

source_set("unit_tests") {
testonly = true
sources = [
"audio_player_unittest.cc",
"audio_recorder_unittest.cc",
"modem_unittest.cc",
]

deps = [
":test_support",
"//testing/gtest",
]
}
1 change: 1 addition & 0 deletions components/autofill/core/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ source_set("unit_tests") {
"phone_field_unittest.cc",
"phone_number_i18n_unittest.cc",
"phone_number_unittest.cc",
"ui/card_unmask_prompt_controller_impl_unittest.cc",
"validation_unittest.cc",
"webdata/autofill_profile_syncable_service_unittest.cc",
"webdata/autofill_table_unittest.cc",
Expand Down
4 changes: 4 additions & 0 deletions components/bookmarks/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ source_set("unit_tests") {
"bookmark_utils_unittest.cc",
]

if (toolkit_views) {
sources += [ "bookmark_node_data_unittest.cc" ]
}

configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]

deps = [
Expand Down
1 change: 0 additions & 1 deletion components/components_tests.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@
'undo/undo_manager_test.cc',
],

# Note: GN tests converted to here, need to do the rest.
'audio_modem_unittest_sources': [
'audio_modem/audio_player_unittest.cc',
'audio_modem/audio_recorder_unittest.cc',
Expand Down
3 changes: 2 additions & 1 deletion components/constrained_window/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("constrained_window") {
source_set("constrained_window") {
sources = [
"constrained_window_views.cc",
"constrained_window_views.h",
Expand All @@ -25,6 +25,7 @@ source_set("unit_tests") {

deps = [
":constrained_window",
"//components/web_modal:test_support",
"//ui/views:test_support",
]
}
3 changes: 2 additions & 1 deletion components/data_reduction_proxy/core/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("browser") {
source_set("browser") {
sources = [
"data_reduction_proxy_bypass_protocol.cc",
"data_reduction_proxy_bypass_protocol.h",
Expand Down Expand Up @@ -121,6 +121,7 @@ source_set("unit_tests") {
"data_reduction_proxy_prefs_unittest.cc",
"data_reduction_proxy_request_options_unittest.cc",
"data_reduction_proxy_settings_unittest.cc",
"data_reduction_proxy_tamper_detection_unittest.cc",
"data_usage_store_unittest.cc",
]

Expand Down
16 changes: 15 additions & 1 deletion components/enhanced_bookmarks/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,23 @@ source_set("test_support") {
"test_image_store.h",
]

deps = [
public_deps = [
":enhanced_bookmarks",
"//skia",
"//testing/gtest",
]
}

source_set("unit_tests") {
testonly = true
sources = [
"enhanced_bookmark_model_unittest.cc",
"image_store_ios_unittest.mm",
"image_store_unittest.cc",
"item_position_unittest.cc",
]
deps = [
":test_support",
"//components/enhanced_bookmarks/proto",
]
}
18 changes: 16 additions & 2 deletions components/favicon/content/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,34 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("content") {
source_set("content") {
sources = [
"content_favicon_driver.cc",
"content_favicon_driver.h",
"favicon_url_util.cc",
"favicon_url_util.h",
]

public_deps = [
"//ui/gfx",
]
deps = [
"//base",
"//components/favicon/core",
"//components/favicon_base",
"//content/public/browser",
"//content/public/common",
"//ui/gfx",
]
}

source_set("unit_tests") {
testonly = true
sources = [
"content_favicon_driver_unittest.cc",
]
deps = [
":content",
"//content/public/browser",
"//testing/gtest",
]
}
2 changes: 1 addition & 1 deletion components/favicon/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("core") {
source_set("core") {
sources = [
"fallback_icon_client.h",
"fallback_icon_service.cc",
Expand Down
18 changes: 17 additions & 1 deletion components/feedback/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("feedback") {
source_set("feedback") {
sources = [
"feedback_common.cc",
"feedback_common.h",
Expand Down Expand Up @@ -36,3 +36,19 @@ static_library("feedback") {
"//third_party/zlib:zip",
]
}

source_set("unit_tests") {
testonly = true
sources = [
"feedback_common_unittest.cc",
"feedback_data_unittest.cc",
"feedback_uploader_chrome_unittest.cc",
"feedback_uploader_unittest.cc",
]
deps = [
":feedback",
"//components/variations/net",
"//testing/gmock",
"//testing/gtest",
]
}
5 changes: 3 additions & 2 deletions components/guest_view/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("browser") {
source_set("browser") {
output_name = "guest_view_browser"
sources = [
"//components/guest_view/browser/guest_view.h",
Expand All @@ -22,13 +22,14 @@ static_library("browser") {
deps = [
"//base",
"//components/guest_view/common",
"//components/ui/zoom",
"//content/public/browser",
"//content/public/common",
"//third_party/WebKit/public:blink",
]
}

static_library("test_support") {
source_set("test_support") {
testonly = true
sources = [
"//components/guest_view/browser/test_guest_view_manager.cc",
Expand Down
Loading

0 comments on commit a7cde4b

Please sign in to comment.