Enterprise policy: Ignore the deprecated ForceSafeSearch if ForceGoogleSafeSearch...
[chromium-blink-merge.git] / base / test / BUILD.gn
blob8baeb147b0d105129a317696393556e52bb26812
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     "expectations/expectation.cc",
31     "expectations/expectation.h",
32     "expectations/parser.cc",
33     "expectations/parser.h",
34     "gtest_util.cc",
35     "gtest_util.h",
36     "gtest_xml_util.cc",
37     "gtest_xml_util.h",
38     "histogram_tester.cc",
39     "histogram_tester.h",
40     "launcher/test_launcher.cc",
41     "launcher/test_launcher.h",
42     "launcher/test_result.cc",
43     "launcher/test_result.h",
44     "launcher/test_results_tracker.cc",
45     "launcher/test_results_tracker.h",
46     "launcher/unit_test_launcher.cc",
47     "launcher/unit_test_launcher.h",
48     "launcher/unit_test_launcher_ios.cc",
49     "mock_chrome_application_mac.h",
50     "mock_chrome_application_mac.mm",
51     "mock_devices_changed_observer.cc",
52     "mock_devices_changed_observer.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     "thread_test_helper.cc",
114     "thread_test_helper.h",
115     "trace_event_analyzer.cc",
116     "trace_event_analyzer.h",
117     "trace_to_file.cc",
118     "trace_to_file.h",
119     "user_action_tester.cc",
120     "user_action_tester.h",
121     "values_test_util.cc",
122     "values_test_util.h",
123   ]
125   public_deps = [
126     ":test_config",
127     "//base",
128     "//base:i18n",
129     "//base:base_static",
130   ]
131   deps = [
132     "//base/third_party/dynamic_annotations",
133     "//testing/gmock",
134     "//testing/gtest",
135     "//third_party/libxml",
136     "//third_party/icu:icuuc",
137   ]
139   if (!is_posix) {
140     sources -= [
141       "scoped_locale.cc",
142       "scoped_locale.h",
143     ]
144   }
145   if (is_ios) {
146     # iOS uses its own unit test launcher.
147     sources -= [ "launcher/unit_test_launcher.cc" ]
149     # Pull in specific Mac files for iOS (which have been filtered out
150     # by file name rules).
151     set_sources_assignment_filter([])
152     sources += [ "test_file_util_mac.cc" ]
153   }
155   if (is_android) {
156     deps += [ ":base_unittests_jni_headers" ]
157   }
160 config("perf_test_config") {
161   defines = [ "PERF_TEST" ]
164 source_set("test_support_perf") {
165   testonly = true
166   sources = [
167     "run_all_perftests.cc",
168   ]
169   deps = [
170     ":test_support",
171     "//base",
172     "//testing/gtest",
173   ]
175   public_configs = [ ":perf_test_config" ]
178 source_set("run_all_unittests") {
179   testonly = true
180   sources = [
181     "run_all_unittests.cc",
182   ]
183   deps = [
184     ":test_support",
185   ]
188 if (is_linux) {
189   shared_library("malloc_wrapper") {
190     testonly = true
191     sources = [
192       "malloc_wrapper.cc",
193     ]
194     deps = [
195       "//base",
196     ]
197   }
200 if (is_android) {
201   generate_jni("base_unittests_jni_headers") {
202     sources = [
203       "android/java/src/org/chromium/base/ContentUriTestUtils.java",
204     ]
205     jni_package = "base"
206   }