summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ash/BUILD.gn1
-rw-r--r--base/BUILD.gn18
-rw-r--r--breakpad/BUILD.gn2
-rw-r--r--build/config/BUILDCONFIG.gn199
-rw-r--r--build/config/android/internal_rules.gni12
-rw-r--r--build/config/android/rules.gni22
-rw-r--r--build/secondary/third_party/cacheinvalidation/BUILD.gn2
-rw-r--r--build/secondary/third_party/leveldatabase/BUILD.gn3
-rw-r--r--cc/BUILD.gn2
-rw-r--r--cc/blink/BUILD.gn2
-rw-r--r--chrome/android/BUILD.gn1
-rw-r--r--chrome/test/BUILD.gn1
-rw-r--r--chrome/test/perf/BUILD.gn2
-rw-r--r--chromeos/BUILD.gn1
-rw-r--r--components/BUILD.gn2
-rw-r--r--components/proximity_auth/BUILD.gn2
-rw-r--r--content/test/BUILD.gn3
-rw-r--r--courgette/BUILD.gn2
-rw-r--r--crypto/BUILD.gn1
-rw-r--r--dbus/BUILD.gn1
-rw-r--r--extensions/BUILD.gn1
-rw-r--r--gin/BUILD.gn1
-rw-r--r--google_apis/BUILD.gn1
-rw-r--r--google_apis/gcm/BUILD.gn1
-rw-r--r--gpu/BUILD.gn2
-rw-r--r--ipc/BUILD.gn2
-rw-r--r--ipc/mojo/BUILD.gn1
-rw-r--r--media/BUILD.gn1
-rw-r--r--media/blink/BUILD.gn3
-rw-r--r--media/cast/BUILD.gn2
-rw-r--r--media/mojo/services/BUILD.gn1
-rw-r--r--mojo/common/BUILD.gn2
-rw-r--r--mojo/converters/surfaces/tests/BUILD.gn2
-rw-r--r--mojo/services/html_viewer/BUILD.gn1
-rw-r--r--mojo/services/view_manager/public/cpp/tests/BUILD.gn1
-rw-r--r--net/BUILD.gn1
-rw-r--r--printing/BUILD.gn1
-rw-r--r--rlz/BUILD.gn2
-rw-r--r--sandbox/linux/BUILD.gn1
-rw-r--r--sandbox/mac/BUILD.gn1
-rw-r--r--sandbox/win/BUILD.gn2
-rw-r--r--skia/BUILD.gn14
-rw-r--r--sql/BUILD.gn2
-rw-r--r--sync/BUILD.gn16
-rw-r--r--testing/test.gni234
-rw-r--r--third_party/libaddressinput/BUILD.gn1
-rw-r--r--third_party/libphonenumber/BUILD.gn1
-rw-r--r--third_party/mojo/src/mojo/edk/js/test/BUILD.gn2
-rw-r--r--third_party/mojo/src/mojo/edk/system/BUILD.gn19
-rw-r--r--third_party/mojo/src/mojo/edk/test/BUILD.gn1
-rw-r--r--tools/gn/BUILD.gn2
-rw-r--r--tools/gn/format_test_data/030.gn3
-rw-r--r--tools/relocation_packer/BUILD.gn1
-rw-r--r--ui/accessibility/BUILD.gn1
-rw-r--r--ui/android/BUILD.gn11
-rw-r--r--ui/app_list/BUILD.gn1
-rw-r--r--ui/aura/BUILD.gn1
-rw-r--r--ui/base/BUILD.gn15
-rw-r--r--ui/chromeos/BUILD.gn2
-rw-r--r--ui/compositor/BUILD.gn1
-rw-r--r--ui/display/BUILD.gn1
-rw-r--r--ui/events/BUILD.gn1
-rw-r--r--ui/gfx/BUILD.gn1
-rw-r--r--ui/keyboard/BUILD.gn1
-rw-r--r--ui/message_center/BUILD.gn1
-rw-r--r--ui/ozone/BUILD.gn1
-rw-r--r--ui/shell_dialogs/BUILD.gn1
-rw-r--r--ui/snapshot/BUILD.gn1
-rw-r--r--ui/touch_selection/BUILD.gn1
-rw-r--r--ui/views/BUILD.gn1
-rw-r--r--ui/wm/BUILD.gn1
-rw-r--r--url/BUILD.gn1
72 files changed, 372 insertions, 277 deletions
diff --git a/ash/BUILD.gn b/ash/BUILD.gn
index 8ae17bc..2700da7 100644
--- a/ash/BUILD.gn
+++ b/ash/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
+import("//testing/test.gni")
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("ash.gyp") ],
diff --git a/base/BUILD.gn b/base/BUILD.gn
index db3cb4a..065f871 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
if (is_android) {
import("//build/config/android/rules.gni")
@@ -1377,6 +1378,13 @@ test("base_unittests") {
"//third_party/icu",
]
+ if (is_android) {
+ apk_deps = [
+ ":base_java",
+ ":base_java_unittest_support",
+ ]
+ }
+
if (is_ios) {
sources -= [
"metrics/stats_table_uinittest.cc", # Requires spawning a process.
@@ -1531,14 +1539,4 @@ if (is_android) {
java_files =
[ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ]
}
-
- # GYP: //base.gyp:base_unittests_apk
- unittest_apk("base_unittests_apk") {
- deps = [
- ":base_java",
- ":base_java_unittest_support",
- ":base_unittests",
- ]
- unittests_dep = ":base_unittests"
- }
}
diff --git a/breakpad/BUILD.gn b/breakpad/BUILD.gn
index 190549a..c928081 100644
--- a/breakpad/BUILD.gn
+++ b/breakpad/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
config("tools_config") {
include_dirs = [
"src",
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index e9e7006..099db51 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -717,202 +717,3 @@ template("component") {
}
}
}
-
-# ==============================================================================
-# TEST SETUP
-# ==============================================================================
-
-# Define a test as an executable (or shared_library on Android) with the
-# "testonly" flag set.
-template("test") {
- if (is_android) {
- shared_library(target_name) {
- # Configs will always be defined since we set_defaults for a component
- # above. We want to use those rather than whatever came with the nested
- # shared/static library inside the component.
- configs = [] # Prevent list overwriting warning.
- configs = invoker.configs
-
- # See above call.
- set_sources_assignment_filter([])
-
- testonly = true
-
- if (defined(invoker.all_dependent_configs)) {
- all_dependent_configs = invoker.all_dependent_configs
- }
- if (defined(invoker.allow_circular_includes_from)) {
- allow_circular_includes_from = invoker.allow_circular_includes_from
- }
- if (defined(invoker.cflags)) {
- cflags = invoker.cflags
- }
- if (defined(invoker.cflags_c)) {
- cflags_c = invoker.cflags_c
- }
- if (defined(invoker.cflags_cc)) {
- cflags_cc = invoker.cflags_cc
- }
- if (defined(invoker.cflags_objc)) {
- cflags_objc = invoker.cflags_objc
- }
- if (defined(invoker.cflags_objcc)) {
- cflags_objcc = invoker.cflags_objcc
- }
- if (defined(invoker.check_includes)) {
- check_includes = invoker.check_includes
- }
- if (defined(invoker.data)) {
- data = invoker.data
- }
- if (defined(invoker.data_deps)) {
- data_deps = invoker.data_deps
- }
- if (defined(invoker.datadeps)) {
- datadeps = invoker.datadeps
- }
- if (defined(invoker.defines)) {
- defines = invoker.defines
- }
- if (defined(invoker.deps)) {
- deps = invoker.deps
- }
- if (defined(invoker.direct_dependent_configs)) {
- direct_dependent_configs = invoker.direct_dependent_configs
- }
- if (defined(invoker.forward_dependent_configs_from)) {
- forward_dependent_configs_from = invoker.forward_dependent_configs_from
- }
- if (defined(invoker.include_dirs)) {
- include_dirs = invoker.include_dirs
- }
- if (defined(invoker.ldflags)) {
- ldflags = invoker.ldflags
- }
- if (defined(invoker.lib_dirs)) {
- lib_dirs = invoker.lib_dirs
- }
- if (defined(invoker.libs)) {
- libs = invoker.libs
- }
- if (defined(invoker.output_extension)) {
- output_extension = invoker.output_extension
- }
- if (defined(invoker.output_name)) {
- output_name = invoker.output_name
- }
- if (defined(invoker.public)) {
- public = invoker.public
- }
- if (defined(invoker.public_configs)) {
- public_configs = invoker.public_configs
- }
- if (defined(invoker.public_deps)) {
- public_deps = invoker.public_deps
- }
- if (defined(invoker.sources)) {
- sources = invoker.sources
- }
- if (defined(invoker.visibility)) {
- visibility = invoker.visibility
- }
- }
- } else {
- executable(target_name) {
- # See above.
- configs = [] # Prevent list overwriting warning.
- configs = invoker.configs
-
- # See above call.
- set_sources_assignment_filter([])
-
- testonly = true
-
- if (defined(invoker.all_dependent_configs)) {
- all_dependent_configs = invoker.all_dependent_configs
- }
- if (defined(invoker.allow_circular_includes_from)) {
- allow_circular_includes_from = invoker.allow_circular_includes_from
- }
- if (defined(invoker.cflags)) {
- cflags = invoker.cflags
- }
- if (defined(invoker.cflags_c)) {
- cflags_c = invoker.cflags_c
- }
- if (defined(invoker.cflags_cc)) {
- cflags_cc = invoker.cflags_cc
- }
- if (defined(invoker.cflags_objc)) {
- cflags_objc = invoker.cflags_objc
- }
- if (defined(invoker.cflags_objcc)) {
- cflags_objcc = invoker.cflags_objcc
- }
- if (defined(invoker.check_includes)) {
- check_includes = invoker.check_includes
- }
- if (defined(invoker.data)) {
- data = invoker.data
- }
- if (defined(invoker.data_deps)) {
- data_deps = invoker.data_deps
- }
- if (defined(invoker.datadeps)) {
- datadeps = invoker.datadeps
- }
- if (defined(invoker.defines)) {
- defines = invoker.defines
- }
-
- # All shared libraries must have the sanitizer deps to properly link in
- # asan mode (this target will be empty in other cases).
- if (defined(invoker.deps)) {
- deps = invoker.deps + [ "//build/config/sanitizers:deps" ]
- } else {
- deps = [
- "//build/config/sanitizers:deps",
- ]
- }
- if (defined(invoker.direct_dependent_configs)) {
- direct_dependent_configs = invoker.direct_dependent_configs
- }
- if (defined(invoker.forward_dependent_configs_from)) {
- forward_dependent_configs_from = invoker.forward_dependent_configs_from
- }
- if (defined(invoker.include_dirs)) {
- include_dirs = invoker.include_dirs
- }
- if (defined(invoker.ldflags)) {
- ldflags = invoker.ldflags
- }
- if (defined(invoker.lib_dirs)) {
- lib_dirs = invoker.lib_dirs
- }
- if (defined(invoker.libs)) {
- libs = invoker.libs
- }
- if (defined(invoker.output_extension)) {
- output_extension = invoker.output_extension
- }
- if (defined(invoker.output_name)) {
- output_name = invoker.output_name
- }
- if (defined(invoker.public)) {
- public = invoker.public
- }
- if (defined(invoker.public_configs)) {
- public_configs = invoker.public_configs
- }
- if (defined(invoker.public_deps)) {
- public_deps = invoker.public_deps
- }
- if (defined(invoker.sources)) {
- sources = invoker.sources
- }
- if (defined(invoker.visibility)) {
- visibility = invoker.visibility
- }
- }
- }
-}
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 3772769..4778705 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -15,6 +15,7 @@ android_sdk_jar = "$android_sdk/android.jar"
rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
template("android_lint") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -62,6 +63,7 @@ template("android_lint") {
}
template("dex") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -113,6 +115,7 @@ template("dex") {
# Creates a zip archive of the inputs.
# If base_dir is provided, the archive paths will be relative to it.
template("zip") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -155,6 +158,7 @@ template("zip") {
# See build/android/gyp/write_build_config.py and
# build/android/gyp/util/build_utils.py:ExpandFileArgs
template("write_build_config") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -288,6 +292,7 @@ template("write_build_config") {
}
template("process_java_prebuilt") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -375,6 +380,7 @@ template("process_java_prebuilt") {
# Packages resources, assets, dex, and native libraries into an apk. Signs and
# zipaligns the apk.
template("create_apk") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -554,6 +560,7 @@ template("create_apk") {
}
template("java_prebuilt_impl") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -633,6 +640,7 @@ template("java_prebuilt_impl") {
# jar_path: Use this to explicitly set the output jar path. Defaults to
# "${target_gen_dir}/${target_name}.jar.
template("compile_java") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -733,6 +741,7 @@ template("compile_java") {
}
template("java_library_impl") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -916,6 +925,7 @@ template("java_library_impl") {
# Runs process_resources.py
template("process_resources") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -1006,6 +1016,7 @@ template("process_resources") {
}
template("copy_ex") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -1053,6 +1064,7 @@ template("copy_ex") {
# Produces a single .dex.jar out of a set of Java dependencies.
template("deps_dex") {
+ set_sources_assignment_filter([])
build_config = "$target_gen_dir/${target_name}.build_config"
write_build_config("${target_name}__build_config") {
type = "deps_dex"
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index b33cd88..07431d7 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -30,6 +30,7 @@ assert(is_android)
# jni_package = "foo"
# }
template("generate_jni") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -128,6 +129,7 @@ template("generate_jni") {
# jni_package = "foo"
# }
template("generate_jar_jni") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -237,6 +239,7 @@ template("generate_jar_jni") {
# include_path = "android/java/templates"
# }
template("java_cpp_template") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -333,6 +336,7 @@ template("java_cpp_template") {
# ]
# }
template("java_cpp_enum") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -392,6 +396,7 @@ template("java_cpp_enum") {
# output = "$target_gen_dir/AndroidManifest.xml"
# }
template("jinja_template") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -448,6 +453,7 @@ template("jinja_template") {
# variables = ["color=red"]
# }
template("jinja_template_resources") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -530,6 +536,7 @@ template("jinja_template_resources") {
# custom_package = "org.chromium.foo"
# }
template("android_resources") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -600,6 +607,7 @@ template("android_resources") {
# grd_file = "foo_strings.grd"
# }
template("java_strings_grd") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -666,6 +674,7 @@ template("java_strings_grd") {
# ]
# }
template("java_strings_grd_prebuilt") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -725,6 +734,8 @@ template("java_strings_grd_prebuilt") {
# main_class = "org.chromium.foo.FooMain"
# }
template("java_binary") {
+ set_sources_assignment_filter([])
+
# TODO(cjhopman): This should not act like a java_library for dependents (i.e.
# dependents shouldn't get the jar in their classpath, etc.).
java_library_impl(target_name) {
@@ -810,6 +821,7 @@ template("java_binary") {
# ]
# }
template("java_library") {
+ set_sources_assignment_filter([])
java_library_impl(target_name) {
if (defined(invoker.DEPRECATED_java_in_dir)) {
DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
@@ -876,6 +888,7 @@ template("java_library") {
# ]
# }
template("java_prebuilt") {
+ set_sources_assignment_filter([])
java_prebuilt_impl(target_name) {
jar_path = invoker.jar_path
if (defined(invoker.testonly)) {
@@ -942,6 +955,7 @@ template("java_prebuilt") {
# ]
# }
template("android_library") {
+ set_sources_assignment_filter([])
assert(!defined(invoker.jar_path),
"android_library does not support a custom jar path")
java_library_impl(target_name) {
@@ -1008,6 +1022,7 @@ template("android_library") {
# will be packaged into the resulting .dex.jar file.
# dex_path: location at which the output file will be put
template("android_standalone_library") {
+ set_sources_assignment_filter([])
deps_dex(target_name) {
deps = invoker.deps
dex_path = invoker.dex_path
@@ -1037,6 +1052,7 @@ template("android_standalone_library") {
# ]
# }
template("android_java_prebuilt") {
+ set_sources_assignment_filter([])
java_prebuilt_impl(target_name) {
jar_path = invoker.jar_path
supports_android = true
@@ -1105,6 +1121,7 @@ template("android_java_prebuilt") {
# ]
# }
template("android_apk") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -1437,6 +1454,7 @@ template("android_apk") {
# unittests_dep = ":foo_unittests"
# }
template("unittest_apk") {
+ set_sources_assignment_filter([])
testonly = true
assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name")
@@ -1508,6 +1526,7 @@ template("unittest_apk") {
# ]
# }
template("android_aidl") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -1583,6 +1602,7 @@ template("android_aidl") {
# binary = "$root_build_dir/exe.stripped/foo"
# }
template("create_native_executable_dist") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
@@ -1663,6 +1683,7 @@ template("create_native_executable_dist") {
# sources = [ "$proto_path/foo.proto" ]
# }
template("proto_java_library") {
+ set_sources_assignment_filter([])
_protoc_dep = "//third_party/android_protobuf:android_protoc($host_toolchain)"
_protoc_out_dir = get_label_info(_protoc_dep, "root_out_dir")
_protoc_bin = "$_protoc_out_dir/android_protoc"
@@ -1705,6 +1726,7 @@ template("proto_java_library") {
# TODO(GYP): implement this.
template("uiautomator_test") {
+ set_sources_assignment_filter([])
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
diff --git a/build/secondary/third_party/cacheinvalidation/BUILD.gn b/build/secondary/third_party/cacheinvalidation/BUILD.gn
index 53d8472..088f89a 100644
--- a/build/secondary/third_party/cacheinvalidation/BUILD.gn
+++ b/build/secondary/third_party/cacheinvalidation/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
config("cacheinvalidation_config") {
include_dirs = [
"overrides",
diff --git a/build/secondary/third_party/leveldatabase/BUILD.gn b/build/secondary/third_party/leveldatabase/BUILD.gn
index 1ee030f..19eef15 100644
--- a/build/secondary/third_party/leveldatabase/BUILD.gn
+++ b/build/secondary/third_party/leveldatabase/BUILD.gn
@@ -4,6 +4,9 @@
# Snappy is a compression library we use.
# TODO(brettw) It's not clear why this needs to be parameterized.
+
+import("//testing/test.gni")
+
use_snappy = true
defines = [ "LEVELDB_PLATFORM_CHROMIUM=1" ]
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 746cf75..c3d7717 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
component("cc") {
sources = [
"animation/animation.cc",
diff --git a/cc/blink/BUILD.gn b/cc/blink/BUILD.gn
index f95291a..e930277 100644
--- a/cc/blink/BUILD.gn
+++ b/cc/blink/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
# GYP version: //cc/blink/cc_blink.gyp:cc_blink
component("blink") {
output_name = "cc_blink"
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index ecc9734..650560c 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//build/module_args/v8.gni")
import("//chrome/version.gni")
+import("//testing/test.gni")
import("//third_party/icu/config.gni")
import("channel.gni")
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 965266f..a7a677b 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -5,6 +5,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
+import("//testing/test.gni")
# This target exists to reference other test executables to bring these files
# into the build.
diff --git a/chrome/test/perf/BUILD.gn b/chrome/test/perf/BUILD.gn
index fd4b701..08a1fc9 100644
--- a/chrome/test/perf/BUILD.gn
+++ b/chrome/test/perf/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
# This test appears to be a legacy target consisting of files not yet moved
# elsewhere.
test("perf") {
diff --git a/chromeos/BUILD.gn b/chromeos/BUILD.gn
index 7da2f4a..0c9912e 100644
--- a/chromeos/BUILD.gn
+++ b/chromeos/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/allocator.gni")
import("//build/config/ui.gni")
+import("//testing/test.gni")
import("//third_party/protobuf/proto_library.gni")
assert(is_chromeos, "Non-ChromeOS builds must not depend on //chromeos")
diff --git a/components/BUILD.gn b/components/BUILD.gn
index cb58e34..921ac25 100644
--- a/components/BUILD.gn
+++ b/components/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
+import("//testing/test.gni")
# Collection of all components. You wouldn't link to this, but this is rather
# to reference the files so they can be compiled by the build system.
@@ -242,6 +243,7 @@ test("components_unittests") {
"//components/domain_reliability:unit_tests",
"//components/favicon_base:unit_tests",
"//components/google/core/browser:unit_tests",
+ "//components/invalidation:unittests",
"//components/login:unit_tests",
"//components/metrics:unit_tests",
"//components/omnibox:unit_tests",
diff --git a/components/proximity_auth/BUILD.gn b/components/proximity_auth/BUILD.gn
index 0ba93b0..d067603 100644
--- a/components/proximity_auth/BUILD.gn
+++ b/components/proximity_auth/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
source_set("proximity_auth") {
sources = [
"base64url.cc",
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 64cf6b4..45bd97c 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
+import("//testing/test.gni")
import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
content_tests_gypi_values =
@@ -363,6 +364,8 @@ if (!is_mac) {
"//content/shell:content_shell_lib",
"//testing/android:native_test_util",
]
+
+ use_launcher = false
}
if (is_mac) {
diff --git a/courgette/BUILD.gn b/courgette/BUILD.gn
index 9cf0943..d277eb9e 100644
--- a/courgette/BUILD.gn
+++ b/courgette/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
static_library("courgette_lib") {
sources = [
"adjustment_method.cc",
diff --git a/crypto/BUILD.gn b/crypto/BUILD.gn
index 94388f77..f6c45aa 100644
--- a/crypto/BUILD.gn
+++ b/crypto/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/crypto.gni")
+import("//testing/test.gni")
component("crypto") {
output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
diff --git a/dbus/BUILD.gn b/dbus/BUILD.gn
index 895f3be..ef6674e 100644
--- a/dbus/BUILD.gn
+++ b/dbus/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//third_party/protobuf/proto_library.gni")
component("dbus") {
diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn
index e3fdea5..17ed557 100644
--- a/extensions/BUILD.gn
+++ b/extensions/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/grit/repack.gni")
diff --git a/gin/BUILD.gn b/gin/BUILD.gn
index d389b84..8f7e360 100644
--- a/gin/BUILD.gn
+++ b/gin/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/module_args/v8.gni")
+import("//testing/test.gni")
component("gin") {
sources = [
diff --git a/google_apis/BUILD.gn b/google_apis/BUILD.gn
index bf71ce3..b07feb7 100644
--- a/google_apis/BUILD.gn
+++ b/google_apis/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/features.gni")
+import("//testing/test.gni")
declare_args() {
# You can set the variable 'use_official_google_api_keys' to true
diff --git a/google_apis/gcm/BUILD.gn b/google_apis/gcm/BUILD.gn
index d21a057..83412b69 100644
--- a/google_apis/gcm/BUILD.gn
+++ b/google_apis/gcm/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//third_party/protobuf/proto_library.gni")
component("gcm") {
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn
index fa9261f..e384610 100644
--- a/gpu/BUILD.gn
+++ b/gpu/BUILD.gn
@@ -33,6 +33,8 @@
#
# gpu/skia_bindings/skia_bindings.gyp:gpu_skia_bindings => //gpu/skia_bindings
+import("//testing/test.gni")
+
component("gpu") {
public_deps = [
"//gpu/command_buffer/client",
diff --git a/ipc/BUILD.gn b/ipc/BUILD.gn
index e843a31..ac5631f 100644
--- a/ipc/BUILD.gn
+++ b/ipc/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
component("ipc") {
sources = [
"ipc_channel.cc",
diff --git a/ipc/mojo/BUILD.gn b/ipc/mojo/BUILD.gn
index 7c04d18..2c169a91 100644
--- a/ipc/mojo/BUILD.gn
+++ b/ipc/mojo/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
mojom("client_channel") {
diff --git a/media/BUILD.gn b/media/BUILD.gn
index 1ed1cb0..688c6a7 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -8,6 +8,7 @@ import("//build/config/features.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//media/media_options.gni")
+import("//testing/test.gni")
# Common configuration for targets in the media directory.
# NOT for exporting.
diff --git a/media/blink/BUILD.gn b/media/blink/BUILD.gn
index 46fecb0..a328cc9 100644
--- a/media/blink/BUILD.gn
+++ b/media/blink/BUILD.gn
@@ -1,6 +1,9 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
+import("//testing/test.gni")
+
component("blink") {
output_name = "media_blink"
diff --git a/media/cast/BUILD.gn b/media/cast/BUILD.gn
index 629fcd9..632b334 100644
--- a/media/cast/BUILD.gn
+++ b/media/cast/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
component("cast") {
deps = [
":sender",
diff --git a/media/mojo/services/BUILD.gn b/media/mojo/services/BUILD.gn
index 63e37f2..88c64d1 100644
--- a/media/mojo/services/BUILD.gn
+++ b/media/mojo/services/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//third_party/mojo/src/mojo/public/mojo_application.gni")
# Target naming conventions:
diff --git a/mojo/common/BUILD.gn b/mojo/common/BUILD.gn
index 4248ff2..ad01c31 100644
--- a/mojo/common/BUILD.gn
+++ b/mojo/common/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
# GYP version: mojo/mojo_base.gyp:mojo_common_lib
component("common") {
output_name = "mojo_common_lib"
diff --git a/mojo/converters/surfaces/tests/BUILD.gn b/mojo/converters/surfaces/tests/BUILD.gn
index 6e60f08..efbd72f 100644
--- a/mojo/converters/surfaces/tests/BUILD.gn
+++ b/mojo/converters/surfaces/tests/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
# GYP version: mojo/mojo_converters.gypi:mojo_surfaces_lib_unittests
test("mojo_surfaces_lib_unittests") {
deps = [
diff --git a/mojo/services/html_viewer/BUILD.gn b/mojo/services/html_viewer/BUILD.gn
index d802032..1d2c63d 100644
--- a/mojo/services/html_viewer/BUILD.gn
+++ b/mojo/services/html_viewer/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//third_party/mojo/src/mojo/public/mojo.gni")
import("//third_party/mojo/src/mojo/public/mojo_application.gni")
diff --git a/mojo/services/view_manager/public/cpp/tests/BUILD.gn b/mojo/services/view_manager/public/cpp/tests/BUILD.gn
index ec164ac..2cbcf43 100644
--- a/mojo/services/view_manager/public/cpp/tests/BUILD.gn
+++ b/mojo/services/view_manager/public/cpp/tests/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
test("mojo_view_manager_lib_unittests") {
sources = [
diff --git a/net/BUILD.gn b/net/BUILD.gn
index 90bf394..f235c301 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -7,6 +7,7 @@ import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
import("//url/config.gni")
+import("//testing/test.gni")
# TODO(cjhopman): //build/config/android/rules.gni also imports grit_rule.gni.
# Currently, that file can't be imported multiple times. Make this always
diff --git a/printing/BUILD.gn b/printing/BUILD.gn
index d9cabe9..83a735d 100644
--- a/printing/BUILD.gn
+++ b/printing/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
+import("//testing/test.gni")
if (is_mac) {
import("//build/config/mac/mac_sdk.gni")
}
diff --git a/rlz/BUILD.gn b/rlz/BUILD.gn
index 0887ef4..f889137 100644
--- a/rlz/BUILD.gn
+++ b/rlz/BUILD.gn
@@ -5,6 +5,8 @@
# Note that this build file assumes rlz_use_chrome_net which is a condition in
# the GYP file, but is always true for Chrome builds.
+import("//testing/test.gni")
+
config("rlz_config") {
defines = [ "RLZ_NETWORK_IMPLEMENTATION_CHROME_NET" ]
}
diff --git a/sandbox/linux/BUILD.gn b/sandbox/linux/BUILD.gn
index 21e19fd..b5cfcdb 100644
--- a/sandbox/linux/BUILD.gn
+++ b/sandbox/linux/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/features.gni")
+import("//testing/test.gni")
declare_args() {
compile_suid_client = is_linux
diff --git a/sandbox/mac/BUILD.gn b/sandbox/mac/BUILD.gn
index 64f9c9c..e2c39ee 100644
--- a/sandbox/mac/BUILD.gn
+++ b/sandbox/mac/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/mac/mac_sdk.gni")
+import("//testing/test.gni")
component("sandbox") {
sources = [
diff --git a/sandbox/win/BUILD.gn b/sandbox/win/BUILD.gn
index d595903..fe37f22 100644
--- a/sandbox/win/BUILD.gn
+++ b/sandbox/win/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
source_set("sandbox") {
sources = [
"src/acl.cc",
diff --git a/skia/BUILD.gn b/skia/BUILD.gn
index eb54593..8bb5dcd 100644
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -4,12 +4,10 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
+import("//testing/test.gni")
if (cpu_arch == "arm") {
import("//build/config/arm.gni")
}
-if (is_android) {
- import("//build/config/android/rules.gni")
-}
skia_support_gpu = !is_ios
skia_support_pdf = !is_ios && (enable_basic_printing || enable_print_preview)
@@ -746,13 +744,3 @@ test("skia_unittests") {
"//ui/gfx/geometry",
]
}
-
-if (is_android) {
- # GYP: //skia/skia_tests.gyp:skia_unittests_apk
- unittest_apk("skia_unittests_apk") {
- unittests_dep = ":skia_unittests"
- deps = [
- ":skia_unittests",
- ]
- }
-}
diff --git a/sql/BUILD.gn b/sql/BUILD.gn
index 21a6f85..05185d5 100644
--- a/sql/BUILD.gn
+++ b/sql/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
component("sql") {
sources = [
"connection.cc",
diff --git a/sync/BUILD.gn b/sync/BUILD.gn
index 65af3de..df5f23a 100644
--- a/sync/BUILD.gn
+++ b/sync/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/features.gni")
+import("//testing/test.gni")
component("sync") {
public_deps = [
@@ -645,13 +646,6 @@ test("sync_unit_tests") {
":test_support_sync_internal_api",
]
- # TODO(GYP)
- # ['OS == "android"', {
- # 'dependencies': [
- # '../testing/android/native_test.gyp:native_test_native_code',
- # ],
- # }],
-
if (is_chromeos) {
# Required by get_session_name_unittest.cc on Chrome OS.
deps += [ "//chromeos" ]
@@ -812,12 +806,4 @@ if (is_android) {
"//base",
]
}
-
- # GYP: //sync/sync_tests.gypi:sync_unit_tests_apk
- unittest_apk("sync_unit_tests_apk") {
- unittests_dep = ":sync_unit_tests"
- deps = [
- ":sync_unit_tests",
- ]
- }
}
diff --git a/testing/test.gni b/testing/test.gni
index 50b23df..9362a78 100644
--- a/testing/test.gni
+++ b/testing/test.gni
@@ -1,3 +1,237 @@
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
+# ==============================================================================
+# TEST SETUP
+# ==============================================================================
+
+# Define a test as an executable (or apk on Android) with the "testonly" flag
+# set.
+template("test") {
+ if (is_android) {
+ import("//build/config/android/config.gni")
+ import("//build/config/android/rules.gni")
+
+ main_target_name = target_name
+ library_name = "_${target_name}__library"
+ apk_name = "${target_name}_apk"
+
+ shared_library(library_name) {
+ # Configs will always be defined since we set_defaults for a component
+ # in the main config. We want to use those rather than whatever came with
+ # the nested shared/static library inside the component.
+ configs = [] # Prevent list overwriting warning.
+ configs = invoker.configs
+
+ # See above call.
+ set_sources_assignment_filter([])
+
+ testonly = true
+
+ if (defined(invoker.all_dependent_configs)) {
+ all_dependent_configs = invoker.all_dependent_configs
+ }
+ if (defined(invoker.allow_circular_includes_from)) {
+ allow_circular_includes_from = invoker.allow_circular_includes_from
+ }
+ if (defined(invoker.cflags)) {
+ cflags = invoker.cflags
+ }
+ if (defined(invoker.cflags_c)) {
+ cflags_c = invoker.cflags_c
+ }
+ if (defined(invoker.cflags_cc)) {
+ cflags_cc = invoker.cflags_cc
+ }
+ if (defined(invoker.cflags_objc)) {
+ cflags_objc = invoker.cflags_objc
+ }
+ if (defined(invoker.cflags_objcc)) {
+ cflags_objcc = invoker.cflags_objcc
+ }
+ if (defined(invoker.check_includes)) {
+ check_includes = invoker.check_includes
+ }
+ if (defined(invoker.data)) {
+ data = invoker.data
+ }
+ if (defined(invoker.data_deps)) {
+ data_deps = invoker.data_deps
+ }
+ if (defined(invoker.datadeps)) {
+ datadeps = invoker.datadeps
+ }
+ if (defined(invoker.defines)) {
+ defines = invoker.defines
+ }
+ deps = []
+ if (!defined(invoker.use_launcher) || invoker.use_launcher) {
+ deps += [ "//testing/android:native_test_native_code" ]
+ }
+ if (defined(invoker.deps)) {
+ deps += invoker.deps
+ }
+ if (defined(invoker.direct_dependent_configs)) {
+ direct_dependent_configs = invoker.direct_dependent_configs
+ }
+ if (defined(invoker.forward_dependent_configs_from)) {
+ forward_dependent_configs_from = invoker.forward_dependent_configs_from
+ }
+ if (defined(invoker.include_dirs)) {
+ include_dirs = invoker.include_dirs
+ }
+ if (defined(invoker.ldflags)) {
+ ldflags = invoker.ldflags
+ }
+ if (defined(invoker.lib_dirs)) {
+ lib_dirs = invoker.lib_dirs
+ }
+ if (defined(invoker.libs)) {
+ libs = invoker.libs
+ }
+ if (defined(invoker.output_extension)) {
+ output_extension = invoker.output_extension
+ }
+ if (defined(invoker.output_name)) {
+ output_name = invoker.output_name
+ }
+ if (defined(invoker.public)) {
+ public = invoker.public
+ }
+ if (defined(invoker.public_configs)) {
+ public_configs = invoker.public_configs
+ }
+ if (defined(invoker.public_deps)) {
+ public_deps = invoker.public_deps
+ }
+ if (defined(invoker.sources)) {
+ sources = invoker.sources
+ }
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
+ }
+
+ unittest_apk(apk_name) {
+ unittests_dep = ":$library_name"
+ apk_name = main_target_name
+ if (defined(invoker.output_name)) {
+ test_output_name = invoker.output_name
+ unittests_binary = "lib${test_output_name}.so"
+ }
+ deps = [
+ ":$library_name",
+ ]
+ if (defined(invoker.apk_deps)) {
+ deps += invoker.apk_deps
+ }
+ }
+
+ group(target_name) {
+ testonly = true
+
+ deps = [
+ ":$library_name",
+ ":$apk_name",
+ ]
+ }
+ } else {
+ executable(target_name) {
+ # See above.
+ configs = [] # Prevent list overwriting warning.
+ configs = invoker.configs
+
+ # See above call.
+ set_sources_assignment_filter([])
+
+ testonly = true
+
+ if (defined(invoker.all_dependent_configs)) {
+ all_dependent_configs = invoker.all_dependent_configs
+ }
+ if (defined(invoker.allow_circular_includes_from)) {
+ allow_circular_includes_from = invoker.allow_circular_includes_from
+ }
+ if (defined(invoker.cflags)) {
+ cflags = invoker.cflags
+ }
+ if (defined(invoker.cflags_c)) {
+ cflags_c = invoker.cflags_c
+ }
+ if (defined(invoker.cflags_cc)) {
+ cflags_cc = invoker.cflags_cc
+ }
+ if (defined(invoker.cflags_objc)) {
+ cflags_objc = invoker.cflags_objc
+ }
+ if (defined(invoker.cflags_objcc)) {
+ cflags_objcc = invoker.cflags_objcc
+ }
+ if (defined(invoker.check_includes)) {
+ check_includes = invoker.check_includes
+ }
+ if (defined(invoker.data)) {
+ data = invoker.data
+ }
+ if (defined(invoker.data_deps)) {
+ data_deps = invoker.data_deps
+ }
+ if (defined(invoker.datadeps)) {
+ datadeps = invoker.datadeps
+ }
+ if (defined(invoker.defines)) {
+ defines = invoker.defines
+ }
+
+ # All shared libraries must have the sanitizer deps to properly link in
+ # asan mode (this target will be empty in other cases).
+ if (defined(invoker.deps)) {
+ deps = invoker.deps + [ "//build/config/sanitizers:deps" ]
+ } else {
+ deps = [
+ "//build/config/sanitizers:deps",
+ ]
+ }
+ if (defined(invoker.direct_dependent_configs)) {
+ direct_dependent_configs = invoker.direct_dependent_configs
+ }
+ if (defined(invoker.forward_dependent_configs_from)) {
+ forward_dependent_configs_from = invoker.forward_dependent_configs_from
+ }
+ if (defined(invoker.include_dirs)) {
+ include_dirs = invoker.include_dirs
+ }
+ if (defined(invoker.ldflags)) {
+ ldflags = invoker.ldflags
+ }
+ if (defined(invoker.lib_dirs)) {
+ lib_dirs = invoker.lib_dirs
+ }
+ if (defined(invoker.libs)) {
+ libs = invoker.libs
+ }
+ if (defined(invoker.output_extension)) {
+ output_extension = invoker.output_extension
+ }
+ if (defined(invoker.output_name)) {
+ output_name = invoker.output_name
+ }
+ if (defined(invoker.public)) {
+ public = invoker.public
+ }
+ if (defined(invoker.public_configs)) {
+ public_configs = invoker.public_configs
+ }
+ if (defined(invoker.public_deps)) {
+ public_deps = invoker.public_deps
+ }
+ if (defined(invoker.sources)) {
+ sources = invoker.sources
+ }
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
+ }
+ }
+}
diff --git a/third_party/libaddressinput/BUILD.gn b/third_party/libaddressinput/BUILD.gn
index 99c2be2..5f6d4fc 100644
--- a/third_party/libaddressinput/BUILD.gn
+++ b/third_party/libaddressinput/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
libaddressinput_util_files = [
diff --git a/third_party/libphonenumber/BUILD.gn b/third_party/libphonenumber/BUILD.gn
index 22d1347..4c32084 100644
--- a/third_party/libphonenumber/BUILD.gn
+++ b/third_party/libphonenumber/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//third_party/protobuf/proto_library.gni")
proto_library("proto") {
diff --git a/third_party/mojo/src/mojo/edk/js/test/BUILD.gn b/third_party/mojo/src/mojo/edk/js/test/BUILD.gn
index badc3ad..326de6a 100644
--- a/third_party/mojo/src/mojo/edk/js/test/BUILD.gn
+++ b/third_party/mojo/src/mojo/edk/js/test/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
test("js_unittests") {
deps = [
"../../js",
diff --git a/third_party/mojo/src/mojo/edk/system/BUILD.gn b/third_party/mojo/src/mojo/edk/system/BUILD.gn
index 2f8abdd..eab85a2 100644
--- a/third_party/mojo/src/mojo/edk/system/BUILD.gn
+++ b/third_party/mojo/src/mojo/edk/system/BUILD.gn
@@ -2,13 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("../mojo_edk.gni")
-if (is_android) {
- import("//build/config/android/config.gni")
- import("//build/config/android/rules.gni")
-}
-
config("system_config") {
defines = [
# Ensures that dependent projects import the core functions on Windows.
@@ -173,10 +169,6 @@ test("mojo_system_unittests") {
"//testing/gtest",
]
- if (is_android) {
- deps += [ "//testing/android:native_test_native_code" ]
- }
-
allow_circular_includes_from = [ "../embedder:embedder_unittests" ]
}
@@ -198,12 +190,3 @@ test("mojo_message_pipe_perftests") {
"//testing/gtest",
]
}
-
-if (is_android) {
- unittest_apk("mojo_system_unittests_apk") {
- deps = [
- ":mojo_system_unittests",
- ]
- unittests_dep = ":mojo_system_unittests"
- }
-}
diff --git a/third_party/mojo/src/mojo/edk/test/BUILD.gn b/third_party/mojo/src/mojo/edk/test/BUILD.gn
index d05f6d4..ea323c6 100644
--- a/third_party/mojo/src/mojo/edk/test/BUILD.gn
+++ b/third_party/mojo/src/mojo/edk/test/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("../mojo_edk.gni")
mojo_edk_source_set("test_support") {
diff --git a/tools/gn/BUILD.gn b/tools/gn/BUILD.gn
index 40c28a2..a61e456 100644
--- a/tools/gn/BUILD.gn
+++ b/tools/gn/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
defines = [ "GN_BUILD" ]
static_library("gn_lib") {
diff --git a/tools/gn/format_test_data/030.gn b/tools/gn/format_test_data/030.gn
index 4ec57a6..adac9a82 100644
--- a/tools/gn/format_test_data/030.gn
+++ b/tools/gn/format_test_data/030.gn
@@ -1,4 +1,7 @@
# Don't separate simple statements in a scope.
+
+import("//testing/test.gni")
+
test("something") {
if (is_linux) {
sources -= [ "file_version_info_unittest.cc" ]
diff --git a/tools/relocation_packer/BUILD.gn b/tools/relocation_packer/BUILD.gn
index cbbc6fd..0b29c91 100644
--- a/tools/relocation_packer/BUILD.gn
+++ b/tools/relocation_packer/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("config.gni")
+import("//testing/test.gni")
assert(relocation_packing_supported)
diff --git a/ui/accessibility/BUILD.gn b/ui/accessibility/BUILD.gn
index ac5f2aa..2f8868f 100644
--- a/ui/accessibility/BUILD.gn
+++ b/ui/accessibility/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/json_schema_api.gni")
+import("//testing/test.gni")
component("accessibility") {
sources = [
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn
index e496cb9..b725452 100644
--- a/ui/android/BUILD.gn
+++ b/ui/android/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/android/rules.gni")
+import("//testing/test.gni")
assert(is_android)
@@ -153,18 +154,10 @@ test("ui_android_unittests") {
"//base/test:test_support",
"//cc",
"//skia",
- "//testing/android:native_test_native_code",
"//testing/gtest",
"//ui/base",
"//ui/gfx",
"//ui/resources:ui_test_pak",
]
-}
-
-unittest_apk("ui_android_unittests_apk") {
- deps = [
- ":ui_android_unittests",
- ":ui_java",
- ]
- unittests_dep = ":ui_android_unittests"
+ apk_deps = [ ":ui_java" ]
}
diff --git a/ui/app_list/BUILD.gn b/ui/app_list/BUILD.gn
index e6e0e42..8746c3f 100644
--- a/ui/app_list/BUILD.gn
+++ b/ui/app_list/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
component("app_list") {
sources = [
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn
index 1357a63..0ebe448 100644
--- a/ui/aura/BUILD.gn
+++ b/ui/aura/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
component("aura") {
sources = [
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index 3e59231..a2633c9 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
if (is_android) {
import("//build/config/android/config.gni")
@@ -878,9 +879,7 @@ test("ui_base_unittests") {
}
if (is_android) {
- deps += [
- #"testing/android/native_test.gyp:native_test_native_code" TODO(GYP)
- ]
+ apk_deps = [ "//chrome:resources" ]
}
if (use_pango) {
@@ -929,14 +928,4 @@ test("ui_base_unittests") {
deps += [ "//chromeos" ]
}
}
-
# TODO(GYP) Mac (ui_base_tests_bundle)
-if (is_android) {
- unittest_apk("ui_base_unittests_apk") {
- unittests_dep = ":ui_base_unittests"
- deps = [
- ":ui_base_unittests",
- "//chrome:resources",
- ]
- }
-}
diff --git a/ui/chromeos/BUILD.gn b/ui/chromeos/BUILD.gn
index 6b34562..bcfaad4 100644
--- a/ui/chromeos/BUILD.gn
+++ b/ui/chromeos/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
+
component("ui_chromeos") {
sources = [
"accessibility_types.h",
diff --git a/ui/compositor/BUILD.gn b/ui/compositor/BUILD.gn
index 047aa16..7bc09ac 100644
--- a/ui/compositor/BUILD.gn
+++ b/ui/compositor/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
component("compositor") {
sources = [
diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn
index 998be45..a32e499 100644
--- a/ui/display/BUILD.gn
+++ b/ui/display/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
component("display") {
sources = [
diff --git a/ui/events/BUILD.gn b/ui/events/BUILD.gn
index 805392e..c0c948f 100644
--- a/ui/events/BUILD.gn
+++ b/ui/events/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
static_library("dom4_keycode_converter") {
sources = [
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index d69cd34..09cab86 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
if (is_android) {
import("//build/config/android/config.gni")
diff --git a/ui/keyboard/BUILD.gn b/ui/keyboard/BUILD.gn
index b401972..15b8cdf 100644
--- a/ui/keyboard/BUILD.gn
+++ b/ui/keyboard/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
import("//third_party/google_input_tools/closure.gni")
import("//third_party/google_input_tools/inputview.gni")
diff --git a/ui/message_center/BUILD.gn b/ui/message_center/BUILD.gn
index 613a5bf..2a4e643 100644
--- a/ui/message_center/BUILD.gn
+++ b/ui/message_center/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
+import("//testing/test.gni")
component("message_center") {
deps = [
diff --git a/ui/ozone/BUILD.gn b/ui/ozone/BUILD.gn
index 40d45cf..543f81c 100644
--- a/ui/ozone/BUILD.gn
+++ b/ui/ozone/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//ui/ozone/ozone.gni")
+import("//testing/test.gni")
# The list of platforms that will be built.
ozone_platforms = []
diff --git a/ui/shell_dialogs/BUILD.gn b/ui/shell_dialogs/BUILD.gn
index 5bd62c0..f4f89f7 100644
--- a/ui/shell_dialogs/BUILD.gn
+++ b/ui/shell_dialogs/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
if (is_android) {
import("//build/config/android/config.gni")
}
diff --git a/ui/snapshot/BUILD.gn b/ui/snapshot/BUILD.gn
index 972218a..49a6bd8 100644
--- a/ui/snapshot/BUILD.gn
+++ b/ui/snapshot/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
component("snapshot") {
sources = [
diff --git a/ui/touch_selection/BUILD.gn b/ui/touch_selection/BUILD.gn
index 3b477e4..e6767cb 100644
--- a/ui/touch_selection/BUILD.gn
+++ b/ui/touch_selection/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
if (is_android) {
import("//build/config/android/rules.gni")
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index 5b24f7f..c5257b4 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
+import("//testing/test.gni")
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("views.gyp") ],
diff --git a/ui/wm/BUILD.gn b/ui/wm/BUILD.gn
index d5e3f29..116ef83 100644
--- a/ui/wm/BUILD.gn
+++ b/ui/wm/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
+import("//testing/test.gni")
component("wm") {
sources = [
diff --git a/url/BUILD.gn b/url/BUILD.gn
index 3bffec2..03e90cb 100644
--- a/url/BUILD.gn
+++ b/url/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//testing/test.gni")
import("//url/config.gni")
# Sets the USE_ICU_ALTERNATIVES_ON_ANDROID define based on the build flag.