Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / base / test / BUILD.gn
blob127ec825d522a84467f6d4edf3d5f2341809f60d
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/ui.gni")
7 if (is_android) {
8   import("//build/config/android/rules.gni")
11 source_set("test_config") {
12   # TODO http://crbug.com/412064 enable this flag all the time.
13   testonly = !is_component_build
14   sources = [
15     "test_switches.cc",
16     "test_switches.h",
17     "test_timeouts.cc",
18     "test_timeouts.h",
19   ]
20   deps = [
21     "//base",
22   ]
25 # GYP: //base/base.gyp:test_support_base
26 source_set("test_support") {
27   # TODO http://crbug.com/412064 enable this flag all the time.
28   testonly = !is_component_build
29   sources = [
30     "gtest_util.cc",
31     "gtest_util.h",
32     "gtest_xml_unittest_result_printer.cc",
33     "gtest_xml_unittest_result_printer.h",
34     "gtest_xml_util.cc",
35     "gtest_xml_util.h",
36     "histogram_tester.cc",
37     "histogram_tester.h",
38     "launcher/test_launcher.cc",
39     "launcher/test_launcher.h",
40     "launcher/test_result.cc",
41     "launcher/test_result.h",
42     "launcher/test_results_tracker.cc",
43     "launcher/test_results_tracker.h",
44     "launcher/unit_test_launcher.cc",
45     "launcher/unit_test_launcher.h",
46     "launcher/unit_test_launcher_ios.cc",
47     "mock_chrome_application_mac.h",
48     "mock_chrome_application_mac.mm",
49     "mock_devices_changed_observer.cc",
50     "mock_devices_changed_observer.h",
51     "mock_entropy_provider.cc",
52     "mock_entropy_provider.h",
53     "mock_log.cc",
54     "mock_log.h",
55     "multiprocess_test.cc",
56     "multiprocess_test.h",
57     "multiprocess_test_android.cc",
58     "null_task_runner.cc",
59     "null_task_runner.h",
60     "opaque_ref_counted.cc",
61     "opaque_ref_counted.h",
62     "perf_log.cc",
63     "perf_log.h",
64     "perf_test_suite.cc",
65     "perf_test_suite.h",
66     "perf_time_logger.cc",
67     "perf_time_logger.h",
68     "power_monitor_test_base.cc",
69     "power_monitor_test_base.h",
70     "scoped_locale.cc",
71     "scoped_locale.h",
72     "scoped_path_override.cc",
73     "scoped_path_override.h",
74     "sequenced_task_runner_test_template.cc",
75     "sequenced_task_runner_test_template.h",
76     "sequenced_worker_pool_owner.cc",
77     "sequenced_worker_pool_owner.h",
78     "simple_test_clock.cc",
79     "simple_test_clock.h",
80     "simple_test_tick_clock.cc",
81     "simple_test_tick_clock.h",
82     "task_runner_test_template.cc",
83     "task_runner_test_template.h",
84     "test_discardable_memory_allocator.cc",
85     "test_discardable_memory_allocator.h",
86     "test_file_util.cc",
87     "test_file_util.h",
88     "test_file_util_android.cc",
89     "test_file_util_linux.cc",
90     "test_file_util_mac.cc",
91     "test_file_util_posix.cc",
92     "test_file_util_win.cc",
93     "test_io_thread.cc",
94     "test_io_thread.h",
95     "test_listener_ios.h",
96     "test_listener_ios.mm",
97     "test_mock_time_task_runner.cc",
98     "test_mock_time_task_runner.h",
99     "test_pending_task.cc",
100     "test_pending_task.h",
101     "test_reg_util_win.cc",
102     "test_reg_util_win.h",
103     "test_shortcut_win.cc",
104     "test_shortcut_win.h",
105     "test_simple_task_runner.cc",
106     "test_simple_task_runner.h",
107     "test_suite.cc",
108     "test_suite.h",
109     "test_support_android.cc",
110     "test_support_android.h",
111     "test_support_ios.h",
112     "test_support_ios.mm",
113     "test_ui_thread_android.cc",
114     "test_ui_thread_android.h",
115     "thread_test_helper.cc",
116     "thread_test_helper.h",
117     "trace_event_analyzer.cc",
118     "trace_event_analyzer.h",
119     "trace_to_file.cc",
120     "trace_to_file.h",
121     "user_action_tester.cc",
122     "user_action_tester.h",
123     "values_test_util.cc",
124     "values_test_util.h",
125   ]
127   data = [
128     # The isolate needs this script for setting up the test. It's not actually
129     # needed to run this target locally.
130     "//testing/test_env.py",
131   ]
133   public_deps = [
134     ":test_config",
135     "//base",
136     "//base:i18n",
137     "//base:base_static",
138   ]
139   deps = [
140     "//base/third_party/dynamic_annotations",
141     "//testing/gmock",
142     "//testing/gtest",
143     "//third_party/libxml",
144     "//third_party/icu:icuuc",
145   ]
147   if (!is_posix) {
148     sources -= [
149       "scoped_locale.cc",
150       "scoped_locale.h",
151     ]
152   }
153   if (is_ios) {
154     # iOS uses its own unit test launcher.
155     sources -= [ "launcher/unit_test_launcher.cc" ]
157     # Pull in specific Mac files for iOS (which have been filtered out
158     # by file name rules).
159     set_sources_assignment_filter([])
160     sources += [ "test_file_util_mac.cc" ]
161   }
163   if (is_android) {
164     deps += [ ":base_unittests_jni_headers" ]
165   }
168 config("perf_test_config") {
169   defines = [ "PERF_TEST" ]
172 source_set("test_support_perf") {
173   testonly = true
174   sources = [
175     "run_all_perftests.cc",
176   ]
177   deps = [
178     ":test_support",
179     "//base",
180     "//testing/gtest",
181   ]
183   public_configs = [ ":perf_test_config" ]
186 source_set("run_all_unittests") {
187   testonly = true
188   sources = [
189     "run_all_unittests.cc",
190   ]
191   deps = [
192     ":test_support",
193   ]
196 if (is_linux) {
197   shared_library("malloc_wrapper") {
198     testonly = true
199     sources = [
200       "malloc_wrapper.cc",
201     ]
202     deps = [
203       "//base",
204     ]
205   }
208 if (is_android) {
209   generate_jni("base_unittests_jni_headers") {
210     sources = [
211       "android/java/src/org/chromium/base/ContentUriTestUtils.java",
212       "android/java/src/org/chromium/base/TestUiThread.java",
213     ]
214     jni_package = "base"
215   }