Commit 2dbbe5b0 authored by brettw's avatar brettw Committed by Commit bot

Convert some GN test support targets to static libs.

Converts some source sets that were source sets into static libraries. Converts additional targets in the touched files to static libraries where it seemed relevant.

Update the definition of //crypto:test_support to mark it testonly and make the conditions append sources rather than subtract them in the reverse condition.

A few redundant dependencies were removed (one shouldn't need to specify both "foo" and "foo:test_support").

BUG=627637
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_blink_rel

Review-Url: https://codereview.chromium.org/2151653003
Cr-Commit-Position: refs/heads/master@{#405544}
parent 65854075
......@@ -589,7 +589,7 @@ component("cc") {
}
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"test/animation_test_common.cc",
......
......@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("open_from_clipboard") {
static_library("open_from_clipboard") {
sources = [
"clipboard_recent_content.cc",
"clipboard_recent_content.h",
......@@ -16,7 +16,7 @@ source_set("open_from_clipboard") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"fake_clipboard_recent_content.cc",
......
......@@ -5,7 +5,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
source_set("os_crypt") {
static_library("os_crypt") {
sources = [
"ie7_password_win.cc",
"ie7_password_win.h",
......@@ -75,7 +75,7 @@ source_set("os_crypt") {
}
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"os_crypt_mocker.cc",
......@@ -123,10 +123,7 @@ source_set("unit_tests") {
}
if (use_dbus) {
sources += [ "kwallet_dbus_unittest.cc" ]
deps += [
"//dbus",
"//dbus:test_support",
]
deps += [ "//dbus:test_support" ]
defines += [ "USE_KWALLET" ]
}
}
......
......@@ -165,7 +165,7 @@ proto_library("proto") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"fake_affiliation_api.cc",
......
......@@ -229,7 +229,7 @@ if (enable_configuration_policy) {
]
}
source_set("policy_component_test_support") {
static_library("policy_component_test_support") {
testonly = true
sources = [
"core/browser/configuration_policy_pref_store_test.cc",
......
......@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("pref_registry") {
static_library("pref_registry") {
sources = [
"pref_registry_syncable.cc",
"pref_registry_syncable.h",
......@@ -15,7 +15,7 @@ source_set("pref_registry") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"testing_pref_service_syncable.cc",
......
......@@ -55,7 +55,7 @@ component("prefs") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"mock_pref_change_callback.cc",
......
......@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
......
......@@ -93,7 +93,7 @@ source_set("proximity_auth") {
}
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
......
......@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("cryptauth") {
static_library("cryptauth") {
sources = [
"cryptauth_access_token_fetcher.h",
"cryptauth_access_token_fetcher_impl.cc",
......@@ -53,7 +53,7 @@ source_set("cryptauth") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
......
......@@ -7,7 +7,7 @@ if (is_android) {
}
# GYP version: components/safe_json.gypi:safe_json
source_set("safe_json") {
static_library("safe_json") {
sources = [
"android/component_jni_registrar.cc",
"android/component_jni_registrar.h",
......@@ -62,7 +62,7 @@ source_set("unit_tests") {
}
# GYP version: components/safe_json.gypi:safe_json_test_support
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"testing_json_parser.cc",
......
......@@ -111,7 +111,7 @@ component("scheduler") {
}
# GYP version: components/scheduler.gypi:scheduler_common
source_set("common") {
static_library("common") {
sources = [
"common/scheduler_switches.cc",
"common/scheduler_switches.h",
......@@ -163,7 +163,7 @@ source_set("unit_tests") {
}
# GYP version: components/scheduler.gypi:scheduler_test_support
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
......
......@@ -94,7 +94,7 @@ static_library("search_engines") {
}
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"default_search_pref_test_util.cc",
......
......@@ -129,7 +129,7 @@ source_set("shared") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"core/serialized_navigation_entry_test_helper.cc",
......
......@@ -6,7 +6,7 @@ if (is_android) {
import("//build/config/android/rules.gni")
}
source_set("browser") {
static_library("browser") {
sources = [
"about_signin_internals.cc",
"about_signin_internals.h",
......@@ -113,7 +113,7 @@ source_set("browser") {
}
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"fake_account_fetcher_service.cc",
......
......@@ -5,7 +5,7 @@
import("//build/config/features.gni")
# GYP version: components/storage_monitor.gypi:storage_monitor
source_set("storage_monitor") {
static_library("storage_monitor") {
sources = [
"image_capture_device.h",
"image_capture_device.mm",
......@@ -88,7 +88,7 @@ source_set("storage_monitor") {
}
# GYP version: components/storage_monitor.gypi:storage_monitor_test_support
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"mock_removable_storage_observer.cc",
......
......@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("browser") {
static_library("browser") {
sources = [
"ruleset_distributor.h",
"ruleset_service.cc",
......@@ -20,7 +20,7 @@ source_set("browser") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"subresource_filter_features_test_support.cc",
......
......@@ -5,7 +5,7 @@
import("//build/buildflag_header.gni")
import("//build/config/features.gni")
source_set("sync_driver") {
static_library("sync_driver") {
sources = [
"about_sync_util.cc",
"about_sync_util.h",
......@@ -156,7 +156,7 @@ source_set("sync_driver") {
}
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"change_processor_mock.cc",
......
......@@ -3,7 +3,7 @@
# found in the LICENSE file.
# GYP version: components/sync_sessions.gypi:sync_sessions
source_set("sync_sessions") {
static_library("sync_sessions") {
sources = [
"favicon_cache.cc",
"favicon_cache.h",
......@@ -65,7 +65,7 @@ source_set("sync_sessions") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"fake_sync_sessions_client.cc",
......
......@@ -4,7 +4,7 @@
import("//build/config/features.gni")
source_set("syncable_prefs") {
static_library("syncable_prefs") {
sources = [
"pref_model_associator.cc",
"pref_model_associator.h",
......@@ -37,7 +37,7 @@ source_set("syncable_prefs") {
}
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"pref_service_mock_factory.cc",
......
......@@ -4,7 +4,7 @@
import("//build/config/ui.gni")
source_set("toolbar") {
static_library("toolbar") {
sources = [
"toolbar_model.cc",
"toolbar_model.h",
......@@ -28,7 +28,7 @@ source_set("toolbar") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
......
......@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("update_client") {
static_library("update_client") {
sources = [
"action.cc",
"action.h",
......@@ -66,7 +66,7 @@ source_set("update_client") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"test_configurator.cc",
......
......@@ -56,7 +56,7 @@ static_library("user_prefs_tracked") {
]
}
source_set("user_prefs_tracked_test_support") {
static_library("user_prefs_tracked_test_support") {
testonly = true
sources = [
"mock_validation_delegate.cc",
......
......@@ -23,7 +23,7 @@ static_library("webdata_services") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"web_data_service_test_util.cc",
......
......@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("zoom") {
static_library("zoom") {
sources = [
"page_zoom.cc",
"page_zoom.h",
......@@ -27,7 +27,7 @@ source_set("zoom") {
]
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"test/zoom_test_utils.cc",
......
......@@ -50,7 +50,6 @@ static_library("test_support") {
":browsertest_base",
":content_test_mojo_bindings",
"//base/third_party/dynamic_annotations",
"//cc",
"//cc:test_support",
"//cc/blink",
"//cc/ipc",
......@@ -207,7 +206,7 @@ static_library("test_support") {
# browsertest_support can be used by targets that run content_shell based
# browser tests.
source_set("browsertest_support") {
static_library("browsertest_support") {
testonly = true
# See comment at the top of //content/BUILD.gn for why this is disabled in
......@@ -258,7 +257,7 @@ source_set("browsertest_support") {
}
# browsertest_base can be used by any browser test target.
source_set("browsertest_base") {
static_library("browsertest_base") {
testonly = true
sources = [
......
......@@ -175,36 +175,32 @@ test("crypto_unittests") {
]
}
# This has no sources in some cases so can't be a static library.
source_set("test_support") {
sources = [
"scoped_test_nss_chromeos_user.cc",
"scoped_test_nss_chromeos_user.h",
"scoped_test_nss_db.cc",
"scoped_test_nss_db.h",
"scoped_test_system_nss_key_slot.cc",
"scoped_test_system_nss_key_slot.h",
]
deps = [
":crypto",
":platform",
"//base",
]
testonly = true
sources = []
if (!use_nss_certs) {
sources -= [
if (use_nss_certs) {
sources += [
"scoped_test_nss_db.cc",
"scoped_test_nss_db.h",
]
}
if (!is_chromeos) {
sources -= [
if (is_chromeos) {
sources += [
"scoped_test_nss_chromeos_user.cc",
"scoped_test_nss_chromeos_user.h",
"scoped_test_system_nss_key_slot.cc",
"scoped_test_system_nss_key_slot.h",
]
}
deps = [
":crypto",
":platform",
"//base",
]
}
config("platform_config") {
......
......@@ -59,7 +59,7 @@ proto_library("test_proto") {
# This target contains mocks that can be used to write unit tests without
# issuing actual D-Bus calls.
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
"mock_bus.cc",
......
......@@ -14,7 +14,7 @@ if (is_android) {
source_ids = "//third_party/usb_ids/usb.ids"
generated_ids = "$target_gen_dir/usb_ids_gen.cc"
source_set("usb") {
static_library("usb") {
sources = [
"android/usb_jni_registrar.cc",
"android/usb_jni_registrar.h",
......@@ -102,7 +102,7 @@ source_set("usb") {
}
}
source_set("test_support") {
static_library("test_support") {
testonly = true
sources = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment