Roll src/third_party/skia 41f88f0:1d24b8d
[chromium-blink-merge.git] / base / test / BUILD.gn
blobc4356cbbacd3e7a233ad788d6ffc089744440931
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     "values_test_util.cc",
120     "values_test_util.h",
121   ]
123   public_deps = [
124     ":test_config",
125     "//base",
126     "//base:i18n",
127     "//base:base_static",
128   ]
129   deps = [
130     "//base/third_party/dynamic_annotations",
131     "//testing/gmock",
132     "//testing/gtest",
133     "//third_party/libxml",
134     "//third_party/icu:icuuc",
135   ]
137   if (!is_posix) {
138     sources -= [
139       "scoped_locale.cc",
140       "scoped_locale.h",
141     ]
142   }
143   if (is_ios) {
144     # iOS uses its own unit test launcher.
145     sources -= [ "launcher/unit_test_launcher.cc" ]
147     # Pull in specific Mac files for iOS (which have been filtered out
148     # by file name rules).
149     set_sources_assignment_filter([])
150     sources += [ "test_file_util_mac.cc" ]
151   }
153   if (is_android) {
154     deps += [ ":base_unittests_jni_headers" ]
155   }
158 config("perf_test_config") {
159   defines = [ "PERF_TEST" ]
162 source_set("test_support_perf") {
163   testonly = true
164   sources = [
165     "run_all_perftests.cc",
166   ]
167   deps = [
168     ":test_support",
169     "//base",
170     "//testing/gtest",
171   ]
173   public_configs = [ ":perf_test_config" ]
176 source_set("run_all_unittests") {
177   testonly = true
178   sources = [
179     "run_all_unittests.cc",
180   ]
181   deps = [
182     ":test_support",
183   ]
186 if (is_android) {
187   generate_jni("base_unittests_jni_headers") {
188     sources = [
189       "android/java/src/org/chromium/base/ContentUriTestUtils.java",
190     ]
191     jni_package = "base"
192   }