OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/ui.gni") | 5 import("//build/config/ui.gni") |
6 import("//build/config/nacl/config.gni") | 6 import("//build/config/nacl/config.gni") |
7 | 7 |
8 if (is_android) { | 8 if (is_android) { |
9 import("//build/config/android/rules.gni") | 9 import("//build/config/android/rules.gni") |
10 } | 10 } |
11 | 11 |
12 static_library("test_config") { | 12 static_library("test_config") { |
13 testonly = true | 13 testonly = true |
14 sources = [ | 14 sources = [ |
15 "test_switches.cc", | 15 "test_switches.cc", |
16 "test_switches.h", | 16 "test_switches.h", |
17 "test_timeouts.cc", | 17 "test_timeouts.cc", |
18 "test_timeouts.h", | 18 "test_timeouts.h", |
19 ] | 19 ] |
20 deps = [ | 20 deps = [ |
21 "//base", | 21 "//base", |
22 ] | 22 ] |
23 } | 23 } |
24 | 24 |
| 25 # This target is needed for components on Android depending on base:test_support |
| 26 # that do not define a main function. This is because multiprocess support on |
| 27 # Android requires a main function (the one invoked on the child process). |
| 28 static_library("test_support_main_stub") { |
| 29 testonly = true |
| 30 sources = [ |
| 31 "main_stub.cc", |
| 32 ] |
| 33 } |
| 34 |
25 static_library("test_support") { | 35 static_library("test_support") { |
26 testonly = true | 36 testonly = true |
27 sources = [ | 37 sources = [ |
28 "../trace_event/trace_config_memory_test_util.h", | 38 "../trace_event/trace_config_memory_test_util.h", |
29 "android/java_handler_thread_for_testing.cc", | 39 "android/java_handler_thread_for_testing.cc", |
30 "android/java_handler_thread_for_testing.h", | 40 "android/java_handler_thread_for_testing.h", |
| 41 "android/multiprocess_test_client_service.cc", |
| 42 "android/test_support_jni_registrar.cc", |
| 43 "android/test_support_jni_registrar.h", |
31 "android/test_system_message_handler_link_android.cc", | 44 "android/test_system_message_handler_link_android.cc", |
32 "android/test_system_message_handler_link_android.h", | 45 "android/test_system_message_handler_link_android.h", |
33 "fuzzed_data_provider.cc", | 46 "fuzzed_data_provider.cc", |
34 "fuzzed_data_provider.h", | 47 "fuzzed_data_provider.h", |
35 "gtest_util.cc", | 48 "gtest_util.cc", |
36 "gtest_util.h", | 49 "gtest_util.h", |
37 "gtest_xml_unittest_result_printer.cc", | 50 "gtest_xml_unittest_result_printer.cc", |
38 "gtest_xml_unittest_result_printer.h", | 51 "gtest_xml_unittest_result_printer.h", |
39 "gtest_xml_util.cc", | 52 "gtest_xml_util.cc", |
40 "gtest_xml_util.h", | 53 "gtest_xml_util.h", |
41 "histogram_tester.cc", | 54 "histogram_tester.cc", |
42 "histogram_tester.h", | 55 "histogram_tester.h", |
43 "icu_test_util.cc", | 56 "icu_test_util.cc", |
44 "icu_test_util.h", | 57 "icu_test_util.h", |
45 "ios/wait_util.h", | 58 "ios/wait_util.h", |
46 "ios/wait_util.mm", | 59 "ios/wait_util.mm", |
47 "launcher/test_result.cc", | 60 "launcher/test_result.cc", |
48 "launcher/test_result.h", | 61 "launcher/test_result.h", |
49 "launcher/test_results_tracker.h", | 62 "launcher/test_results_tracker.h", |
50 "launcher/unit_test_launcher.h", | 63 "launcher/unit_test_launcher.h", |
51 "mock_chrome_application_mac.h", | 64 "mock_chrome_application_mac.h", |
52 "mock_chrome_application_mac.mm", | 65 "mock_chrome_application_mac.mm", |
53 "mock_devices_changed_observer.cc", | 66 "mock_devices_changed_observer.cc", |
54 "mock_devices_changed_observer.h", | 67 "mock_devices_changed_observer.h", |
55 "mock_entropy_provider.cc", | 68 "mock_entropy_provider.cc", |
56 "mock_entropy_provider.h", | 69 "mock_entropy_provider.h", |
57 "mock_log.cc", | 70 "mock_log.cc", |
58 "mock_log.h", | 71 "mock_log.h", |
| 72 "multiprocess_test.cc", |
59 "multiprocess_test.h", | 73 "multiprocess_test.h", |
| 74 "multiprocess_test_android.cc", |
60 "null_task_runner.cc", | 75 "null_task_runner.cc", |
61 "null_task_runner.h", | 76 "null_task_runner.h", |
62 "opaque_ref_counted.cc", | 77 "opaque_ref_counted.cc", |
63 "opaque_ref_counted.h", | 78 "opaque_ref_counted.h", |
64 "perf_log.cc", | 79 "perf_log.cc", |
65 "perf_log.h", | 80 "perf_log.h", |
66 "perf_test_suite.cc", | 81 "perf_test_suite.cc", |
67 "perf_test_suite.h", | 82 "perf_test_suite.h", |
68 "perf_time_logger.cc", | 83 "perf_time_logger.cc", |
69 "perf_time_logger.h", | 84 "perf_time_logger.h", |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 if (is_ios) { | 154 if (is_ios) { |
140 sources += [ "launcher/unit_test_launcher_ios.cc" ] | 155 sources += [ "launcher/unit_test_launcher_ios.cc" ] |
141 } else if (!is_nacl_nonsfi) { | 156 } else if (!is_nacl_nonsfi) { |
142 sources += [ | 157 sources += [ |
143 "launcher/test_launcher.cc", | 158 "launcher/test_launcher.cc", |
144 "launcher/test_launcher.h", | 159 "launcher/test_launcher.h", |
145 "launcher/test_launcher_tracer.cc", | 160 "launcher/test_launcher_tracer.cc", |
146 "launcher/test_launcher_tracer.h", | 161 "launcher/test_launcher_tracer.h", |
147 "launcher/test_results_tracker.cc", | 162 "launcher/test_results_tracker.cc", |
148 "launcher/unit_test_launcher.cc", | 163 "launcher/unit_test_launcher.cc", |
149 "multiprocess_test.cc", | |
150 "multiprocess_test_android.cc", | |
151 ] | 164 ] |
152 } | 165 } |
153 | 166 |
154 configs += [ "//build/config:precompiled_headers" ] | 167 configs += [ "//build/config:precompiled_headers" ] |
155 | 168 |
156 data = [ | 169 data = [ |
157 # The isolate needs this script for setting up the test. It's not actually | 170 # The isolate needs this script for setting up the test. It's not actually |
158 # needed to run this target locally. | 171 # needed to run this target locally. |
159 "//testing/test_env.py", | 172 "//testing/test_env.py", |
160 ] | 173 ] |
(...skipping 23 matching lines...) Expand all Loading... |
184 set_sources_assignment_filter([]) | 197 set_sources_assignment_filter([]) |
185 sources += [ "test_file_util_mac.cc" ] | 198 sources += [ "test_file_util_mac.cc" ] |
186 set_sources_assignment_filter(sources_assignment_filter) | 199 set_sources_assignment_filter(sources_assignment_filter) |
187 } | 200 } |
188 | 201 |
189 if (is_mac) { | 202 if (is_mac) { |
190 libs = [ "AppKit.framework" ] | 203 libs = [ "AppKit.framework" ] |
191 } | 204 } |
192 | 205 |
193 if (is_android) { | 206 if (is_android) { |
194 deps += [ ":base_unittests_jni_headers" ] | 207 deps += [ |
| 208 ":base_unittests_jni_headers", |
| 209 ":test_support_jni_headers", |
| 210 ] |
| 211 public_deps += [ ":test_support_java" ] |
195 } | 212 } |
196 | 213 |
197 if (is_nacl_nonsfi) { | 214 if (is_nacl_nonsfi) { |
198 sources += [ | 215 sources += [ |
199 "launcher/test_launcher.h", | 216 "launcher/test_launcher.h", |
200 "launcher/test_result.h", | 217 "launcher/test_result.h", |
201 "launcher/unit_test_launcher.h", | 218 "launcher/unit_test_launcher.h", |
202 "launcher/unit_test_launcher_nacl_nonsfi.cc", | 219 "launcher/unit_test_launcher_nacl_nonsfi.cc", |
203 ] | 220 ] |
204 sources -= [ | 221 sources -= [ |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 337 |
321 if (is_android) { | 338 if (is_android) { |
322 generate_jni("base_unittests_jni_headers") { | 339 generate_jni("base_unittests_jni_headers") { |
323 sources = [ | 340 sources = [ |
324 "android/java/src/org/chromium/base/ContentUriTestUtils.java", | 341 "android/java/src/org/chromium/base/ContentUriTestUtils.java", |
325 "android/java/src/org/chromium/base/TestSystemMessageHandler.java", | 342 "android/java/src/org/chromium/base/TestSystemMessageHandler.java", |
326 "android/java/src/org/chromium/base/TestUiThread.java", | 343 "android/java/src/org/chromium/base/TestUiThread.java", |
327 ] | 344 ] |
328 jni_package = "base" | 345 jni_package = "base" |
329 } | 346 } |
| 347 |
| 348 generate_jni("test_support_jni_headers") { |
| 349 sources = [ |
| 350 "android/java/src/org/chromium/base/MainReturnCodeResult.java", |
| 351 "android/java/src/org/chromium/base/MultiprocessTestClientLauncher.java", |
| 352 "android/java/src/org/chromium/base/MultiprocessTestClientService.java", |
| 353 ] |
| 354 jni_package = "base" |
| 355 } |
| 356 |
| 357 android_library("test_support_java") { |
| 358 testonly = true |
| 359 deps = [ |
| 360 "//base:base_java", |
| 361 ] |
| 362 srcjar_deps = [ ":test_support_java_aidl" ] |
| 363 java_files = [ |
| 364 "android/java/src/org/chromium/base/FileDescriptorInfo.java", |
| 365 "android/java/src/org/chromium/base/MainReturnCodeResult.java", |
| 366 "android/java/src/org/chromium/base/MultiprocessTestClientLauncher.java", |
| 367 "android/java/src/org/chromium/base/MultiprocessTestClientService.java", |
| 368 "android/java/src/org/chromium/base/MultiprocessTestClientService0.java", |
| 369 "android/java/src/org/chromium/base/MultiprocessTestClientService1.java", |
| 370 "android/java/src/org/chromium/base/MultiprocessTestClientService2.java", |
| 371 "android/java/src/org/chromium/base/MultiprocessTestClientService3.java", |
| 372 "android/java/src/org/chromium/base/MultiprocessTestClientService4.java", |
| 373 ] |
| 374 } |
| 375 |
| 376 android_aidl("test_support_java_aidl") { |
| 377 testonly = true |
| 378 import_include = "android/java/src" |
| 379 sources = [ |
| 380 "android/java/src/org/chromium/base/ITestClient.aidl", |
| 381 ] |
| 382 } |
330 } | 383 } |
OLD | NEW |