Commit bcaad6b6 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Fix win/cross build of browser_tests.

Bug: 1022385
Change-Id: I63b21f0c2d082bdc2befc5cb7dc3deff4095ae43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2051534Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740819}
parent 75161d96
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//chrome/test/base/js2gtest.gni") import("//chrome/test/base/js2gtest.gni")
import("//chrome/test/include_js_tests.gni")
import("//components/nacl/features.gni") import("//components/nacl/features.gni")
import("//tools/grit/grit_rule.gni") import("//tools/grit/grit_rule.gni")
import("//tools/grit/repack.gni") import("//tools/grit/repack.gni")
...@@ -450,23 +451,32 @@ repack("dev_ui_paks") { ...@@ -450,23 +451,32 @@ repack("dev_ui_paks") {
} }
} }
js2gtest("resources_unitjs_tests") { # Some targets in this file are depended on independent of include_js_tests,
test_type = "webui" # so this file gets loaded even if !include_js_tests. Since js2gtest()s don't
sources = [ "gaia_auth_host/password_change_authenticator_test.unitjs" ] # compile in some scenarios when include_js_tests is false, and since this
# file is loaded even when it's false, we need to make sure the js2gtest()
# This has to be a gen_include, so it doesn't collide with other js2gtests # target only exists in this file when it works. (In contrast, most other
gen_include_files = [ "//ui/webui/resources/js/cr.js" ] # BUILD.gn files containing js2gtest()s contain nothing else and hence are only
# loaded when include_js_tests is true.)
# But these have to be extra_js_files, since it uses a native object if (!is_android && include_js_tests) {
# EventTarget, which doesn't work at compile time. js2gtest("resources_unitjs_tests") {
extra_js_files = [ test_type = "webui"
"//ui/webui/resources/js/cr/event_target.js", sources = [ "gaia_auth_host/password_change_authenticator_test.unitjs" ]
"gaia_auth_host/password_change_authenticator.js",
] # This has to be a gen_include, so it doesn't collide with other js2gtests
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] gen_include_files = [ "//ui/webui/resources/js/cr.js" ]
}
# But these have to be extra_js_files, since it uses a native object
# EventTarget, which doesn't work at compile time.
extra_js_files = [
"//ui/webui/resources/js/cr/event_target.js",
"gaia_auth_host/password_change_authenticator.js",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
}
source_set("browser_tests_js") { source_set("browser_tests_js") {
testonly = true testonly = true
deps = [ ":resources_unitjs_tests" ] deps = [ ":resources_unitjs_tests" ]
}
} }
...@@ -17,6 +17,7 @@ import("//chrome/browser/downgrade/buildflags.gni") ...@@ -17,6 +17,7 @@ import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/browser/page_load_metrics/integration_tests/jsdeps.gni") import("//chrome/browser/page_load_metrics/integration_tests/jsdeps.gni")
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//chrome/test/base/js2gtest.gni") import("//chrome/test/base/js2gtest.gni")
import("//chrome/test/include_js_tests.gni")
import("//chromeos/assistant/assistant.gni") import("//chromeos/assistant/assistant.gni")
import("//components/captive_portal/core/features.gni") import("//components/captive_portal/core/features.gni")
import("//components/feature_engagement/features.gni") import("//components/feature_engagement/features.gni")
...@@ -46,10 +47,6 @@ if (is_android) { ...@@ -46,10 +47,6 @@ if (is_android) {
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
import("//chrome/android/features/dev_ui/dev_ui_module.gni") import("//chrome/android/features/dev_ui/dev_ui_module.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni") import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
} else {
# js_tests don't work in cross builds, https://crbug.com/1010561
include_js_tests =
!(is_asan || is_msan || is_tsan || (is_win && host_os != "win"))
} }
# This target exists to reference other test executables to bring these files # This target exists to reference other test executables to bring these files
......
import("//build/config/sanitizers/sanitizers.gni")
if (!is_android) {
# js_tests don't work in cross builds, https://crbug.com/1010561
include_js_tests =
!(is_asan || is_msan || is_tsan || (is_win && host_os != "win"))
}
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