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 if (is_android) { | |
26 # This target is needed for components on Android depending on | |
27 # base:test_support that do not define a main function. This is because | |
28 # multiprocess support on Android requires a main function (the one invoked on | |
29 # the child process). | |
30 static_library("test_support_main_stub") { | |
31 testonly = true | |
32 if (is_component_build) { | |
33 sources = [ | |
34 "main_stub.cc", | |
35 ] | |
36 deps = [ | |
37 "//base", | |
38 ] | |
39 } | |
40 } | |
41 } | |
42 | |
43 static_library("test_support") { | 25 static_library("test_support") { |
44 testonly = true | 26 testonly = true |
45 sources = [ | 27 sources = [ |
46 "../trace_event/trace_config_memory_test_util.h", | 28 "../trace_event/trace_config_memory_test_util.h", |
47 "android/java_handler_thread_for_testing.cc", | 29 "android/java_handler_thread_for_testing.cc", |
48 "android/java_handler_thread_for_testing.h", | 30 "android/java_handler_thread_for_testing.h", |
49 "android/multiprocess_test_client_service.cc", | |
50 "android/test_support_jni_registrar.cc", | |
51 "android/test_support_jni_registrar.h", | |
52 "android/test_system_message_handler_link_android.cc", | 31 "android/test_system_message_handler_link_android.cc", |
53 "android/test_system_message_handler_link_android.h", | 32 "android/test_system_message_handler_link_android.h", |
54 "fuzzed_data_provider.cc", | 33 "fuzzed_data_provider.cc", |
55 "fuzzed_data_provider.h", | 34 "fuzzed_data_provider.h", |
56 "gtest_util.cc", | 35 "gtest_util.cc", |
57 "gtest_util.h", | 36 "gtest_util.h", |
58 "gtest_xml_unittest_result_printer.cc", | 37 "gtest_xml_unittest_result_printer.cc", |
59 "gtest_xml_unittest_result_printer.h", | 38 "gtest_xml_unittest_result_printer.h", |
60 "gtest_xml_util.cc", | 39 "gtest_xml_util.cc", |
61 "gtest_xml_util.h", | 40 "gtest_xml_util.h", |
62 "histogram_tester.cc", | 41 "histogram_tester.cc", |
63 "histogram_tester.h", | 42 "histogram_tester.h", |
64 "icu_test_util.cc", | 43 "icu_test_util.cc", |
65 "icu_test_util.h", | 44 "icu_test_util.h", |
66 "ios/wait_util.h", | 45 "ios/wait_util.h", |
67 "ios/wait_util.mm", | 46 "ios/wait_util.mm", |
68 "launcher/test_result.cc", | 47 "launcher/test_result.cc", |
69 "launcher/test_result.h", | 48 "launcher/test_result.h", |
70 "launcher/test_results_tracker.h", | 49 "launcher/test_results_tracker.h", |
71 "launcher/unit_test_launcher.h", | 50 "launcher/unit_test_launcher.h", |
72 "mock_chrome_application_mac.h", | 51 "mock_chrome_application_mac.h", |
73 "mock_chrome_application_mac.mm", | 52 "mock_chrome_application_mac.mm", |
74 "mock_devices_changed_observer.cc", | 53 "mock_devices_changed_observer.cc", |
75 "mock_devices_changed_observer.h", | 54 "mock_devices_changed_observer.h", |
76 "mock_entropy_provider.cc", | 55 "mock_entropy_provider.cc", |
77 "mock_entropy_provider.h", | 56 "mock_entropy_provider.h", |
78 "mock_log.cc", | 57 "mock_log.cc", |
79 "mock_log.h", | 58 "mock_log.h", |
80 "multiprocess_test.cc", | |
81 "multiprocess_test.h", | 59 "multiprocess_test.h", |
82 "multiprocess_test_android.cc", | |
83 "null_task_runner.cc", | 60 "null_task_runner.cc", |
84 "null_task_runner.h", | 61 "null_task_runner.h", |
85 "opaque_ref_counted.cc", | 62 "opaque_ref_counted.cc", |
86 "opaque_ref_counted.h", | 63 "opaque_ref_counted.h", |
87 "perf_log.cc", | 64 "perf_log.cc", |
88 "perf_log.h", | 65 "perf_log.h", |
89 "perf_test_suite.cc", | 66 "perf_test_suite.cc", |
90 "perf_test_suite.h", | 67 "perf_test_suite.h", |
91 "perf_time_logger.cc", | 68 "perf_time_logger.cc", |
92 "perf_time_logger.h", | 69 "perf_time_logger.h", |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if (is_ios) { | 139 if (is_ios) { |
163 sources += [ "launcher/unit_test_launcher_ios.cc" ] | 140 sources += [ "launcher/unit_test_launcher_ios.cc" ] |
164 } else if (!is_nacl_nonsfi) { | 141 } else if (!is_nacl_nonsfi) { |
165 sources += [ | 142 sources += [ |
166 "launcher/test_launcher.cc", | 143 "launcher/test_launcher.cc", |
167 "launcher/test_launcher.h", | 144 "launcher/test_launcher.h", |
168 "launcher/test_launcher_tracer.cc", | 145 "launcher/test_launcher_tracer.cc", |
169 "launcher/test_launcher_tracer.h", | 146 "launcher/test_launcher_tracer.h", |
170 "launcher/test_results_tracker.cc", | 147 "launcher/test_results_tracker.cc", |
171 "launcher/unit_test_launcher.cc", | 148 "launcher/unit_test_launcher.cc", |
| 149 "multiprocess_test.cc", |
| 150 "multiprocess_test_android.cc", |
172 ] | 151 ] |
173 } | 152 } |
174 | 153 |
175 configs += [ "//build/config:precompiled_headers" ] | 154 configs += [ "//build/config:precompiled_headers" ] |
176 | 155 |
177 data = [ | 156 data = [ |
178 # The isolate needs this script for setting up the test. It's not actually | 157 # The isolate needs this script for setting up the test. It's not actually |
179 # needed to run this target locally. | 158 # needed to run this target locally. |
180 "//testing/test_env.py", | 159 "//testing/test_env.py", |
181 ] | 160 ] |
(...skipping 23 matching lines...) Expand all Loading... |
205 set_sources_assignment_filter([]) | 184 set_sources_assignment_filter([]) |
206 sources += [ "test_file_util_mac.cc" ] | 185 sources += [ "test_file_util_mac.cc" ] |
207 set_sources_assignment_filter(sources_assignment_filter) | 186 set_sources_assignment_filter(sources_assignment_filter) |
208 } | 187 } |
209 | 188 |
210 if (is_mac) { | 189 if (is_mac) { |
211 libs = [ "AppKit.framework" ] | 190 libs = [ "AppKit.framework" ] |
212 } | 191 } |
213 | 192 |
214 if (is_android) { | 193 if (is_android) { |
215 deps += [ | 194 deps += [ ":base_unittests_jni_headers" ] |
216 ":base_unittests_jni_headers", | |
217 ":test_support_jni_headers", | |
218 ] | |
219 public_deps += [ ":test_support_java" ] | |
220 } | 195 } |
221 | 196 |
222 if (is_nacl_nonsfi) { | 197 if (is_nacl_nonsfi) { |
223 sources += [ | 198 sources += [ |
224 "launcher/test_launcher.h", | 199 "launcher/test_launcher.h", |
225 "launcher/test_result.h", | 200 "launcher/test_result.h", |
226 "launcher/unit_test_launcher.h", | 201 "launcher/unit_test_launcher.h", |
227 "launcher/unit_test_launcher_nacl_nonsfi.cc", | 202 "launcher/unit_test_launcher_nacl_nonsfi.cc", |
228 ] | 203 ] |
229 sources -= [ | 204 sources -= [ |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 320 |
346 if (is_android) { | 321 if (is_android) { |
347 generate_jni("base_unittests_jni_headers") { | 322 generate_jni("base_unittests_jni_headers") { |
348 sources = [ | 323 sources = [ |
349 "android/java/src/org/chromium/base/ContentUriTestUtils.java", | 324 "android/java/src/org/chromium/base/ContentUriTestUtils.java", |
350 "android/java/src/org/chromium/base/TestSystemMessageHandler.java", | 325 "android/java/src/org/chromium/base/TestSystemMessageHandler.java", |
351 "android/java/src/org/chromium/base/TestUiThread.java", | 326 "android/java/src/org/chromium/base/TestUiThread.java", |
352 ] | 327 ] |
353 jni_package = "base" | 328 jni_package = "base" |
354 } | 329 } |
355 | |
356 generate_jni("test_support_jni_headers") { | |
357 sources = [ | |
358 "android/java/src/org/chromium/base/MainReturnCodeResult.java", | |
359 "android/java/src/org/chromium/base/MultiprocessTestClientLauncher.java", | |
360 "android/java/src/org/chromium/base/MultiprocessTestClientService.java", | |
361 ] | |
362 jni_package = "base" | |
363 } | |
364 | |
365 android_library("test_support_java") { | |
366 testonly = true | |
367 deps = [ | |
368 "//base:base_java", | |
369 "//third_party/android_tools:android_support_annotations_java", | |
370 "//third_party/jsr-305:jsr_305_javalib", | |
371 ] | |
372 srcjar_deps = [ ":test_support_java_aidl" ] | |
373 java_files = [ | |
374 "android/java/src/org/chromium/base/FileDescriptorInfo.java", | |
375 "android/java/src/org/chromium/base/MainReturnCodeResult.java", | |
376 "android/java/src/org/chromium/base/MultiprocessTestClientLauncher.java", | |
377 "android/java/src/org/chromium/base/MultiprocessTestClientService.java", | |
378 "android/java/src/org/chromium/base/MultiprocessTestClientService0.java", | |
379 "android/java/src/org/chromium/base/MultiprocessTestClientService1.java", | |
380 "android/java/src/org/chromium/base/MultiprocessTestClientService2.java", | |
381 "android/java/src/org/chromium/base/MultiprocessTestClientService3.java", | |
382 "android/java/src/org/chromium/base/MultiprocessTestClientService4.java", | |
383 ] | |
384 } | |
385 | |
386 android_aidl("test_support_java_aidl") { | |
387 testonly = true | |
388 import_include = "android/java/src" | |
389 sources = [ | |
390 "android/java/src/org/chromium/base/ITestClient.aidl", | |
391 ] | |
392 } | |
393 } | 330 } |
OLD | NEW |