Skip direct map from apk check for Samsung Mega.
[chromium-blink-merge.git] / base / test / BUILD.gn
blobb4987d9d55838a339ad8f42901bbfcd25a5bce6b
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 # GYP: //base/base.gyp:test_support_base
12 source_set("test_support") {
13   # TODO http://crbug.com/412064 enable this flag all the time.
14   testonly = !is_component_build
15   sources = [
16     "expectations/expectation.cc",
17     "expectations/expectation.h",
18     "expectations/parser.cc",
19     "expectations/parser.h",
20     "gtest_util.cc",
21     "gtest_util.h",
22     "gtest_xml_util.cc",
23     "gtest_xml_util.h",
24     "histogram_tester.cc",
25     "histogram_tester.h",
26     "launcher/test_launcher.cc",
27     "launcher/test_launcher.h",
28     "launcher/test_result.cc",
29     "launcher/test_result.h",
30     "launcher/test_results_tracker.cc",
31     "launcher/test_results_tracker.h",
32     "launcher/unit_test_launcher.cc",
33     "launcher/unit_test_launcher.h",
34     "launcher/unit_test_launcher_ios.cc",
35     "mock_chrome_application_mac.h",
36     "mock_chrome_application_mac.mm",
37     "mock_devices_changed_observer.cc",
38     "mock_devices_changed_observer.h",
39     "mock_time_provider.cc",
40     "mock_time_provider.h",
41     "multiprocess_test.cc",
42     "multiprocess_test.h",
43     "multiprocess_test_android.cc",
44     "null_task_runner.cc",
45     "null_task_runner.h",
46     "opaque_ref_counted.cc",
47     "opaque_ref_counted.h",
48     "perf_log.cc",
49     "perf_log.h",
50     "perf_test_suite.cc",
51     "perf_test_suite.h",
52     "perf_time_logger.cc",
53     "perf_time_logger.h",
54     "power_monitor_test_base.cc",
55     "power_monitor_test_base.h",
56     "scoped_locale.cc",
57     "scoped_locale.h",
58     "scoped_path_override.cc",
59     "scoped_path_override.h",
60     "sequenced_task_runner_test_template.cc",
61     "sequenced_task_runner_test_template.h",
62     "sequenced_worker_pool_owner.cc",
63     "sequenced_worker_pool_owner.h",
64     "simple_test_clock.cc",
65     "simple_test_clock.h",
66     "simple_test_tick_clock.cc",
67     "simple_test_tick_clock.h",
68     "task_runner_test_template.cc",
69     "task_runner_test_template.h",
70     "test_file_util.cc",
71     "test_file_util.h",
72     "test_file_util_android.cc",
73     "test_file_util_linux.cc",
74     "test_file_util_mac.cc",
75     "test_file_util_posix.cc",
76     "test_file_util_win.cc",
77     "test_io_thread.cc",
78     "test_io_thread.h",
79     "test_listener_ios.h",
80     "test_listener_ios.mm",
81     "test_mock_time_task_runner.cc",
82     "test_mock_time_task_runner.h",
83     "test_pending_task.cc",
84     "test_pending_task.h",
85     "test_reg_util_win.cc",
86     "test_reg_util_win.h",
87     "test_shortcut_win.cc",
88     "test_shortcut_win.h",
89     "test_simple_task_runner.cc",
90     "test_simple_task_runner.h",
91     "test_suite.cc",
92     "test_suite.h",
93     "test_support_android.cc",
94     "test_support_android.h",
95     "test_support_ios.h",
96     "test_support_ios.mm",
97     "test_switches.cc",
98     "test_switches.h",
99     "test_timeouts.cc",
100     "test_timeouts.h",
101     "thread_test_helper.cc",
102     "thread_test_helper.h",
103     "trace_event_analyzer.cc",
104     "trace_event_analyzer.h",
105     "trace_to_file.cc",
106     "trace_to_file.h",
107     "values_test_util.cc",
108     "values_test_util.h",
109   ]
111   public_deps = [
112     "//base",
113     "//base:i18n",
114     "//base:base_static",
115   ]
116   deps = [
117     "//base/third_party/dynamic_annotations",
118     "//testing/gmock",
119     "//testing/gtest",
120     "//third_party/libxml",
121   ]
123   if (!is_posix) {
124     sources -= [
125       "scoped_locale.cc",
126       "scoped_locale.h",
127     ]
128   }
129   if (is_ios) {
130     # iOS uses its own unit test launcher.
131     sources -= [ "launcher/unit_test_launcher.cc" ]
133     # Pull in specific Mac files for iOS (which have been filtered out
134     # by file name rules).
135     set_sources_assignment_filter([])
136     sources += [ "test_file_util_mac.cc" ]
137   }
139   if (is_android) {
140     deps += [ ":base_unittests_jni_headers" ]
141   }
144 config("perf_test_config") {
145   defines = [ "PERF_TEST" ]
148 source_set("test_support_perf") {
149   testonly = true
150   sources = [
151     "run_all_perftests.cc",
152   ]
153   deps = [
154     ":test_support",
155     "//base",
156     "//testing/gtest",
157   ]
159   public_configs = [ ":perf_test_config" ]
162 source_set("run_all_unittests") {
163   testonly = true
164   sources = [
165     "run_all_unittests.cc",
166   ]
167   deps = [
168     ":test_support",
169   ]
172 if (is_android) {
173   generate_jni("base_unittests_jni_headers") {
174     sources = [
175       "android/java/src/org/chromium/base/ContentUriTestUtils.java",
176     ]
177     jni_package = "base"
178   }