Add long running gmail memory benchmark for background tab.
[chromium-blink-merge.git] / base / test / BUILD.gn
blob39eea78bd395888931b490008d3bab5021c74bbf
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   configs += [ "//build/config:precompiled_headers" ]
129   data = [
130     # The isolate needs this script for setting up the test. It's not actually
131     # needed to run this target locally.
132     "//testing/test_env.py",
133   ]
135   public_deps = [
136     ":test_config",
137     "//base",
138     "//base:i18n",
139     "//base:base_static",
140   ]
141   deps = [
142     "//base/third_party/dynamic_annotations",
143     "//testing/gmock",
144     "//testing/gtest",
145     "//third_party/libxml",
146     "//third_party/icu:icuuc",
147   ]
149   if (!is_posix) {
150     sources -= [
151       "scoped_locale.cc",
152       "scoped_locale.h",
153     ]
154   }
155   if (is_ios) {
156     # iOS uses its own unit test launcher.
157     sources -= [ "launcher/unit_test_launcher.cc" ]
159     # Pull in specific Mac files for iOS (which have been filtered out
160     # by file name rules).
161     set_sources_assignment_filter([])
162     sources += [ "test_file_util_mac.cc" ]
163   }
165   if (is_android) {
166     deps += [ ":base_unittests_jni_headers" ]
167   }
170 config("perf_test_config") {
171   defines = [ "PERF_TEST" ]
174 source_set("test_support_perf") {
175   testonly = true
176   sources = [
177     "run_all_perftests.cc",
178   ]
179   deps = [
180     ":test_support",
181     "//base",
182     "//testing/gtest",
183   ]
185   public_configs = [ ":perf_test_config" ]
188 source_set("run_all_unittests") {
189   testonly = true
190   sources = [
191     "run_all_unittests.cc",
192   ]
193   deps = [
194     ":test_support",
195   ]
198 if (is_linux) {
199   shared_library("malloc_wrapper") {
200     testonly = true
201     sources = [
202       "malloc_wrapper.cc",
203     ]
204     deps = [
205       "//base",
206     ]
207   }
210 if (is_android) {
211   generate_jni("base_unittests_jni_headers") {
212     sources = [
213       "android/java/src/org/chromium/base/ContentUriTestUtils.java",
214       "android/java/src/org/chromium/base/TestUiThread.java",
215     ]
216     jni_package = "base"
217   }