Skip to content

Commit

Permalink
[gn check] Enable //chrome/test:test_support
Browse files Browse the repository at this point in the history
This is a reland that fixes an Android linking bug in
chrome_app_unittests that was discovered only on the main waterfall.
The reland removes the relevant files from being directly included as
sources in chrome_app_unittests, as they now come in via a dependency
on :test_support on all platforms. I verified locally that this fixes
the linking bug.

Bug: 949535
Change-Id: Ib8a5f3ba252a50b23f0550cc7038cdb8d5b6bd5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2879978
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#881438}
  • Loading branch information
colinblundell authored and Chromium LUCI CQ committed May 11, 2021
1 parent 7b974ba commit c44f0a8
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 13 deletions.
1 change: 0 additions & 1 deletion .gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ no_check_targets = [
"//chrome/test:sync_integration_tests",
"//chrome/test:sync_integration_test_support",
"//chrome/test:sync_performance_tests",
"//chrome/test:test_support",
"//chrome/test:test_support_ui",
"//chrome/test:test_support_ui_android",
"//chrome/test:test_support_unit",
Expand Down
1 change: 1 addition & 0 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2615,6 +2615,7 @@ static_library("test_support") {
":*",
"//ash/app_list:*",
"//ash/shortcut_viewer:*",
"//chrome/test:test_support",
"//components/exo:*",
"//components/exo/wayland:*",
"//ash/public/cpp/external_arc:*",
Expand Down
82 changes: 70 additions & 12 deletions chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ static_library("test_support") {
"//chrome:strings",

#"//chrome/app/theme:theme_resources",
"//chrome/browser:browser_process",
"//chrome/browser:test_support",
"//chrome/browser/safe_browsing",
"//chrome/child",
"//chrome/common:non_code_constants",
"//chrome/common:test_support",
Expand All @@ -236,33 +238,50 @@ static_library("test_support") {
"//components/bookmarks/test",
"//components/captive_portal/core:test_support",
"//components/consent_auditor:test_support",
"//components/content_settings/core/browser",
"//components/crash/core/app",
"//components/domain_reliability",
"//components/federated_learning",
"//components/find_in_page",
"//components/gcm_driver:test_support",
"//components/gcm_driver/crypto:test_support",
"//components/gcm_driver/instance_id:test_support",
"//components/history/core/test",
"//components/infobars/core",
"//components/metrics:test_support",
"//components/network_session_configurator/common",
"//components/network_time",
"//components/network_time:network_time_test_support",
"//components/omnibox/browser:test_support",
"//components/os_crypt",
"//components/password_manager/core/browser:test_support",
"//components/payments/core:test_support",
"//components/performance_manager/test_support",
"//components/permissions",
"//components/permissions:test_support",
"//components/policy/core/browser",
"//components/policy/core/common:test_support",
"//components/prefs:test_support",
"//components/profile_metrics",
"//components/safe_browsing/core/db:database_manager",
"//components/safe_browsing/core/db:v4_test_util",
"//components/search_engines:test_support",
"//components/sessions:test_support",
"//components/signin/public/base:test_support",
"//components/startup_metric_utils/browser",
"//components/subresource_filter/content/browser",
"//components/subresource_filter/content/browser:test_support",
"//components/subresource_filter/core/common",
"//components/sync:test_support",
"//components/sync_preferences",
"//components/sync_preferences:test_support",
"//components/sync_sessions:test_support",
"//components/sync_user_events:test_support",
"//components/update_client:test_support",
"//components/user_prefs",
"//components/variations:test_support",
"//components/web_resource:test_support",
"//components/webdata_services",
"//content/public/app",
"//content/public/child",
"//content/public/common",
Expand All @@ -280,19 +299,27 @@ static_library("test_support") {
"//ppapi/buildflags",
"//printing/buildflags",
"//services/cert_verifier:test_support",
"//services/data_decoder/public/cpp:test_support",
"//services/device/public/cpp:test_support",
"//services/device/public/cpp/geolocation",
"//skia",
"//sql",
"//sql:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/leveldatabase",
"//ui/base",
"//ui/base:test_support",
"//ui/events:events_base",
"//ui/gfx:test_support",
"//ui/gl",
]

if (is_android) {
public_deps += [
":test_support_ui_android",
"//chrome:chrome_android_core",
]
if (enable_vr) {
public_deps += [ "//chrome/browser/android/vr:test_support" ]

Expand All @@ -303,10 +330,23 @@ static_library("test_support") {
public_deps += [
# Android uses //chrome:chrome_android_core instead of the //chrome/app
# target.
":test_support_ui",
"//chrome/app:test_support",
"//chrome/browser/web_applications",
"//chrome/browser/web_applications/components",
"//components/crx_file",
"//components/keep_alive_registry",
"//components/pref_registry",
"//components/storage_monitor",
"//components/storage_monitor:test_support",
"//components/ukm:test_support",
"//components/ukm:ukm_test_helper",
"//components/web_modal",
"//components/zoom",
"//components/zoom:test_support",
"//extensions/browser:test_support",
"//extensions/common:test_support",
"//ui/snapshot",
]
sources += [
"../browser/enterprise/reporting/extension_request/extension_request_report_throttler_test.cc",
Expand All @@ -329,7 +369,11 @@ static_library("test_support") {
"//chrome/app/chrome_crash_reporter_client.cc",
"//chrome/app/chrome_crash_reporter_client_mac.mm",
]
deps += [ "//build:branding_buildflags" ]
deps += [
"//build:branding_buildflags",
"//chrome/app_shim",
"//components/upload_list",
]
public_deps += [
"//components/crash/core/app",
"//third_party/breakpad",
Expand Down Expand Up @@ -360,6 +404,7 @@ static_library("test_support") {
"//chrome/app/chrome_crash_reporter_client_win.cc",
]
public_deps += [
"//chrome/chrome_elf:crash",
"//chrome/install_static/test:test_support",
"//components/crash/core/app",
"//third_party/wtl",
Expand Down Expand Up @@ -403,11 +448,23 @@ static_library("test_support") {
public_deps += [
"//ash",
"//ash:test_support",
"//ash/components/account_manager",
"//ash/constants",
"//chrome/browser/chromeos",
"//chromeos/dbus/session_manager",
"//chromeos/dbus/tpm_manager",
"//chromeos/dbus/userdataauth",
"//chromeos/login/login_state",
"//chromeos/settings",
"//chromeos/tpm",
"//chromeos/tpm:test_support",
"//components/exo",
"//components/ownership",
"//components/user_manager:test_support",
"//ui/aura",
"//ui/aura:test_support",
"//ui/base/ime/init",
"//ui/chromeos/resources:resources_grit",
]
deps += [
"//chromeos/cryptohome",
Expand All @@ -417,7 +474,11 @@ static_library("test_support") {
}

if (is_chromeos_lacros) {
deps += [ "//chromeos/services/machine_learning/public/cpp:stub" ]
deps += [
"//chromeos/lacros",
"//chromeos/lacros:test_support",
"//chromeos/services/machine_learning/public/cpp:stub",
]
}

if (is_win || is_mac || (is_linux || is_chromeos_lacros)) {
Expand All @@ -433,6 +494,11 @@ static_library("test_support") {
"base/test_browser_window_aura.cc",
"base/test_browser_window_aura.h",
]
deps += [
"//ui/aura:test_support",
"//ui/wm",
"//ui/wm/public",
]
}

if (toolkit_views) {
Expand Down Expand Up @@ -7094,11 +7160,7 @@ if (!is_android) {
}

test("chrome_app_unittests") {
sources = [
"../app/chrome_main_delegate.cc",
"../app/chrome_main_delegate.h",
"../app/resources/resources_unittest.cc",
]
sources = [ "../app/resources/resources_unittest.cc" ]
deps = [
":test_support",
"//base/test:run_all_unittests",
Expand All @@ -7122,11 +7184,7 @@ test("chrome_app_unittests") {
deps += [ "//components/gwp_asan/client" ]
}
if (is_android) {
sources += [
"../app/android/chrome_main_delegate_android.cc",
"../app/android/chrome_main_delegate_android.h",
"../app/android/chrome_main_delegate_android_unittest.cc",
]
sources += [ "../app/android/chrome_main_delegate_android_unittest.cc" ]
}
}

Expand Down

0 comments on commit c44f0a8

Please sign in to comment.