Don't preload rarely seen large images
[chromium-blink-merge.git] / base / test / BUILD.gn
bloba8ae0cfb737b333f3655f71cdf6afadb38c9dd7f
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_unittest_result_printer.cc",
37     "gtest_xml_unittest_result_printer.h",
38     "gtest_xml_util.cc",
39     "gtest_xml_util.h",
40     "histogram_tester.cc",
41     "histogram_tester.h",
42     "launcher/test_launcher.cc",
43     "launcher/test_launcher.h",
44     "launcher/test_result.cc",
45     "launcher/test_result.h",
46     "launcher/test_results_tracker.cc",
47     "launcher/test_results_tracker.h",
48     "launcher/unit_test_launcher.cc",
49     "launcher/unit_test_launcher.h",
50     "launcher/unit_test_launcher_ios.cc",
51     "mock_chrome_application_mac.h",
52     "mock_chrome_application_mac.mm",
53     "mock_devices_changed_observer.cc",
54     "mock_devices_changed_observer.h",
55     "mock_entropy_provider.cc",
56     "mock_entropy_provider.h",
57     "mock_log.cc",
58     "mock_log.h",
59     "multiprocess_test.cc",
60     "multiprocess_test.h",
61     "multiprocess_test_android.cc",
62     "null_task_runner.cc",
63     "null_task_runner.h",
64     "opaque_ref_counted.cc",
65     "opaque_ref_counted.h",
66     "perf_log.cc",
67     "perf_log.h",
68     "perf_test_suite.cc",
69     "perf_test_suite.h",
70     "perf_time_logger.cc",
71     "perf_time_logger.h",
72     "power_monitor_test_base.cc",
73     "power_monitor_test_base.h",
74     "scoped_locale.cc",
75     "scoped_locale.h",
76     "scoped_path_override.cc",
77     "scoped_path_override.h",
78     "sequenced_task_runner_test_template.cc",
79     "sequenced_task_runner_test_template.h",
80     "sequenced_worker_pool_owner.cc",
81     "sequenced_worker_pool_owner.h",
82     "simple_test_clock.cc",
83     "simple_test_clock.h",
84     "simple_test_tick_clock.cc",
85     "simple_test_tick_clock.h",
86     "task_runner_test_template.cc",
87     "task_runner_test_template.h",
88     "test_discardable_memory_allocator.cc",
89     "test_discardable_memory_allocator.h",
90     "test_file_util.cc",
91     "test_file_util.h",
92     "test_file_util_android.cc",
93     "test_file_util_linux.cc",
94     "test_file_util_mac.cc",
95     "test_file_util_posix.cc",
96     "test_file_util_win.cc",
97     "test_io_thread.cc",
98     "test_io_thread.h",
99     "test_listener_ios.h",
100     "test_listener_ios.mm",
101     "test_mock_time_task_runner.cc",
102     "test_mock_time_task_runner.h",
103     "test_pending_task.cc",
104     "test_pending_task.h",
105     "test_reg_util_win.cc",
106     "test_reg_util_win.h",
107     "test_shortcut_win.cc",
108     "test_shortcut_win.h",
109     "test_simple_task_runner.cc",
110     "test_simple_task_runner.h",
111     "test_suite.cc",
112     "test_suite.h",
113     "test_support_android.cc",
114     "test_support_android.h",
115     "test_support_ios.h",
116     "test_support_ios.mm",
117     "test_ui_thread_android.cc",
118     "test_ui_thread_android.h",
119     "thread_test_helper.cc",
120     "thread_test_helper.h",
121     "trace_event_analyzer.cc",
122     "trace_event_analyzer.h",
123     "trace_to_file.cc",
124     "trace_to_file.h",
125     "user_action_tester.cc",
126     "user_action_tester.h",
127     "values_test_util.cc",
128     "values_test_util.h",
129   ]
131   public_deps = [
132     ":test_config",
133     "//base",
134     "//base:i18n",
135     "//base:base_static",
136   ]
137   deps = [
138     "//base/third_party/dynamic_annotations",
139     "//testing/gmock",
140     "//testing/gtest",
141     "//third_party/libxml",
142     "//third_party/icu:icuuc",
143   ]
145   if (!is_posix) {
146     sources -= [
147       "scoped_locale.cc",
148       "scoped_locale.h",
149     ]
150   }
151   if (is_ios) {
152     # iOS uses its own unit test launcher.
153     sources -= [ "launcher/unit_test_launcher.cc" ]
155     # Pull in specific Mac files for iOS (which have been filtered out
156     # by file name rules).
157     set_sources_assignment_filter([])
158     sources += [ "test_file_util_mac.cc" ]
159   }
161   if (is_android) {
162     deps += [ ":base_unittests_jni_headers" ]
163   }
166 config("perf_test_config") {
167   defines = [ "PERF_TEST" ]
170 source_set("test_support_perf") {
171   testonly = true
172   sources = [
173     "run_all_perftests.cc",
174   ]
175   deps = [
176     ":test_support",
177     "//base",
178     "//testing/gtest",
179   ]
181   public_configs = [ ":perf_test_config" ]
184 source_set("run_all_unittests") {
185   testonly = true
186   sources = [
187     "run_all_unittests.cc",
188   ]
189   deps = [
190     ":test_support",
191   ]
194 if (is_linux) {
195   shared_library("malloc_wrapper") {
196     testonly = true
197     sources = [
198       "malloc_wrapper.cc",
199     ]
200     deps = [
201       "//base",
202     ]
203   }
206 if (is_android) {
207   generate_jni("base_unittests_jni_headers") {
208     sources = [
209       "android/java/src/org/chromium/base/ContentUriTestUtils.java",
210       "android/java/src/org/chromium/base/TestUiThread.java",
211     ]
212     jni_package = "base"
213   }