1 # Copyright 2014 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/chrome_build.gni")
6 import("//build/config/crypto.gni")
7 import("//build/config/features.gni")
8 import("//build/config/ui.gni")
9 import("//build/module_args/v8.gni")
10 import("//testing/test.gni")
11 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
13 content_tests_gypi_values =
14 exec_script("//build/gypi_to_gn.py",
16 rebase_path("../content_tests.gypi"),
17 "--replace=<(SHARED_INTERMEDIATE_DIR)=$root_gen_dir",
20 [ "../content_tests.gypi" ])
22 # GYP version //content/content_tests.gypi:test_support_content
23 source_set("test_support") {
28 "//content/public/app:both",
29 "//content/public/browser",
30 "//content/public/common",
36 "//ui/accessibility:ax_gen",
39 "//ui/base:test_support",
40 "//ui/events:dom_keycode_converter",
41 "//ui/events:events_base",
42 "//ui/events:test_support",
43 "//ui/events:gesture_detection",
44 "//ui/gfx:test_support",
52 rebase_path(content_tests_gypi_values.test_support_content_sources,
56 public_deps += [ "//third_party/WebKit/public:blink" ]
58 ":content_test_mojo_bindings",
59 "//components/scheduler:scheduler",
60 "//components/scheduler:test_support",
61 "//content/browser/speech/proto",
62 "//content/public/child",
64 "//content/public/plugin",
65 "//content/public/renderer",
66 "//content/public/utility",
67 "//content/shell:pak",
72 "//mojo/application/public/cpp:cpp_for_chromium",
73 "//mojo/environment:chromium",
76 "//ppapi/proxy:test_support",
77 "//ppapi/shared_impl",
78 "//ppapi/shared_impl:test_support",
86 deps += [ "//content/ppapi_plugin" ]
91 "../renderer/media/mock_data_channel_impl.cc",
92 "../renderer/media/mock_data_channel_impl.h",
93 "../renderer/media/mock_media_stream_dispatcher.cc",
94 "../renderer/media/mock_media_stream_dispatcher.h",
95 "../renderer/media/mock_peer_connection_impl.cc",
96 "../renderer/media/mock_peer_connection_impl.h",
97 "../renderer/media/mock_web_rtc_peer_connection_handler_client.cc",
98 "../renderer/media/mock_web_rtc_peer_connection_handler_client.h",
99 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.cc",
100 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.h",
104 "//third_party/libjingle:libjingle_webrtc",
105 "//third_party/libjingle:libpeerconnection",
106 "//third_party/webrtc/modules/video_capture",
109 if (!enable_plugins) {
110 sources -= [ "ppapi_unittest.cc" ]
114 configs += [ "//build/config/linux:glib" ]
119 "//ui/aura:test_support",
120 "//ui/resources:ui_test_pak",
125 if (use_aura || is_mac) {
126 deps += [ "//ui/compositor" ]
130 deps += [ "//ui/ozone" ]
135 "//content:startup_helper_win",
136 "//third_party/iaccessible2",
140 if (!is_android && !is_ios) {
142 "../browser/compositor/test/no_transport_image_transport_factory.cc",
143 "../browser/compositor/test/no_transport_image_transport_factory.h",
147 "//third_party/libvpx",
154 "//ui/shell_dialogs",
159 deps += [ "//sandbox" ]
163 "public/test/content_test_suite_base.cc",
164 "public/test/mock_notification_observer.cc",
165 "public/test/mock_resource_context.cc",
166 "public/test/test_browser_thread.cc",
167 "public/test/test_content_client_initializer.cc",
168 "public/test/test_notification_tracker.cc",
169 "public/test/test_utils.cc",
170 "public/test/unittest_test_suite.cc",
171 "test/content_test_suite.cc",
172 "test/test_content_browser_client.cc",
173 "test/test_content_client.cc",
176 if (v8_use_external_startup_data) {
177 deps += [ "//gin:gin" ]
181 source_set("browsertest_support") {
185 "../public/test/content_browser_test.cc",
186 "../public/test/content_browser_test.h",
187 "../public/test/content_browser_test_utils.cc",
188 "../public/test/content_browser_test_utils.h",
189 "../public/test/content_browser_test_utils_mac.mm",
190 "content_test_launcher.cc",
194 "//content/shell:content_shell_lib",
197 "//ui/accessibility:ax_gen",
201 deps += [ "//content/public/app:both" ]
203 deps += [ "//content/public/browser" ]
207 mojom("content_test_mojo_bindings") {
209 "../public/test/test_mojo_service.mojom",
213 mojom("web_ui_test_mojo_bindings") {
215 "data/web_ui_test_mojo_bindings.mojom",
220 # GYP version //content/content_tests.gypi:layouttest_support_content
221 static_library("layouttest_support") {
223 sources = rebase_path(
224 content_tests_gypi_values.layouttest_support_content_sources,
232 "//components/test_runner:test_runner",
233 "//content/public/common",
236 "//ui/accessibility:ax_gen",
245 import("//build/config/android/rules.gni")
247 generate_jni("jni") {
249 "../public/test/android/javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java",
251 jni_package = "content/public/test"
256 # TODO(GYP) enable content_browsertests on Mac when it links.
258 test("content_browsertests") {
260 rebase_path(content_tests_gypi_values.content_browsertests_sources,
264 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
266 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
269 ":browsertest_support",
270 ":web_ui_test_mojo_bindings",
272 "//base/test:test_support",
273 "//content/common:mojo_bindings",
275 "//content/public/common",
276 "//content/public/plugin",
277 "//content/public/renderer",
278 "//content:resources",
279 "//content/shell:content_shell_lib",
280 "//content/shell:pak",
281 "//content/test:test_support",
283 "//device/battery:mojo_bindings",
286 "//ipc:test_support",
287 "//media:test_support",
288 "//media/audio:test_support",
289 "//media/base:test_support",
290 "//media:shared_memory_support",
291 "//mojo/application/public/cpp:cpp_for_chromium",
292 "//mojo/environment:chromium",
293 "//net:test_support",
297 "//ppapi/shared_impl",
298 "//third_party/mojo/src/mojo/edk/system",
299 "//third_party/mojo/src/mojo/edk/test:test_support",
300 "//third_party/mojo/src/mojo/public/cpp/bindings",
301 "//third_party/mojo/src/mojo/public/js",
304 "//third_party/WebKit/public:blink",
305 "//third_party/leveldatabase",
306 "//third_party/mesa:osmesa",
307 "//third_party/zlib",
308 "//ui/accessibility",
309 "//ui/accessibility:ax_gen",
316 "//ui/shell_dialogs",
320 data_deps = [ "//ppapi:ppapi_tests" ] # Loaded at runtime.
324 [ "../browser/web_contents/touch_editable_impl_aura_browsertest.cc" ]
328 sources += rebase_path(
329 content_tests_gypi_values.content_browsertests_win_sources,
334 "//content/app/strings",
335 "//net:net_resources",
336 "//third_party/WebKit/public:resources",
337 "//third_party/iaccessible2",
338 "//third_party/isimpledom",
341 libs = [ "oleacc.lib" ]
346 [ "../browser/accessibility/dump_accessibility_tree_browsertest.cc" ]
350 sources += rebase_path(
351 content_tests_gypi_values.content_browsertests_android_sources,
355 [ "../browser/battery_status/battery_monitor_impl_browsertest.cc" ]
357 "//content/shell/android:content_shell_jni_headers",
358 "//content/shell:content_shell_lib",
359 "//testing/android/native_test:native_test_support",
366 sources += [ "../renderer/external_popup_menu_browsertest.cc" ]
368 # Needed for Content Shell.app's Helper.
369 #"//content/shell:content_shell", #TODO(GYP) enable for mac
373 if (use_aura && !is_win) {
374 deps += [ "//ui/events:test_support" ]
377 if (!use_aura && !is_mac) {
379 [ "../browser/compositor/image_transport_factory_browsertest.cc" ]
382 if (use_aura && !is_win) {
383 sources -= [ "../browser/plugin_browsertest.cc" ]
386 if (!is_android && !is_ios && !is_linux) {
387 # Npapi test plugin doesn't build on Android or iOS.
388 #data_deps += [ 'copy_npapi_test_plugin' ] TODO(GYP)
392 sources += rebase_path(
393 content_tests_gypi_values.content_browsertests_webrtc_sources,
396 deps += [ "//testing/perf" ]
399 if (enable_plugins) {
400 sources += rebase_path(
401 content_tests_gypi_values.content_browsertests_plugins_sources,
404 data_deps += [ "//ppapi:ppapi_tests" ]
407 if (enable_web_speech) {
408 sources += rebase_path(
409 content_tests_gypi_values.content_browsertests_speech_sources,
414 if (!is_chrome_branded) {
415 sources += rebase_path(
416 content_tests_gypi_values.content_browsertests_unofficial_build_sources,
423 [ "../browser/web_contents/web_contents_view_aura_browsertest.cc" ]
428 test("content_unittests") {
429 sources = rebase_path(content_tests_gypi_values.content_unittests_sources,
435 "//base/test:test_support",
436 "//content/browser/background_sync:background_sync_proto",
437 "//content/browser/notifications:notification_proto",
438 "//content/browser/service_worker:service_worker_proto",
439 "//content/browser/speech/proto",
440 "//content/common:mojo_bindings",
441 "//content/public/browser",
442 "//content/public/common",
443 "//content/public/common:mojo_bindings",
446 "//device/battery:mojo_bindings",
447 "//mojo/environment:chromium",
449 "//net:test_support",
452 "//sql:test_support",
455 "//third_party/mojo/src/mojo/edk/test:test_support",
456 "//third_party/mojo/src/mojo/public/cpp/bindings",
458 "//ui/accessibility",
468 "//base/third_party/dynamic_annotations",
472 "//content:resources",
474 "//content/public/browser",
475 "//content/public/child",
476 "//content/public/plugin",
477 "//content/public/renderer",
480 "//gpu:test_support",
481 "//ipc:test_support",
482 "//media:test_support",
483 "//media:shared_memory_support",
484 "//media/audio:test_support",
485 "//media/base:test_support",
489 "//third_party/WebKit/public:blink",
491 "//third_party/leveldatabase",
492 "//third_party/libjingle",
498 sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ]
501 if (enable_plugins) {
503 rebase_path(content_tests_gypi_values.content_unittests_plugins_sources,
510 rebase_path(content_tests_gypi_values.content_unittests_webrtc_sources,
514 "//third_party/libjingle:libjingle_webrtc",
515 "//third_party/libjingle:libpeerconnection",
516 "//third_party/webrtc/modules/video_capture",
519 if (is_linux || is_mac || is_win) {
521 [ "../browser/media/capture/desktop_capture_device_unittest.cc" ]
522 deps += [ "//third_party/webrtc/modules/desktop_capture" ]
527 [ "../browser/media/capture/desktop_capture_device_aura_unittest.cc" ]
530 if (enable_plugins) {
531 # This file is added only when plugins are enabled, but we don't want it
532 # unless webrtc is also enabled.
534 [ "../renderer/media/webrtc/video_destination_handler_unittest.cc" ]
538 if (enable_web_speech) {
540 rebase_path(content_tests_gypi_values.content_unittests_speech_sources,
547 deps += [ "//dbus:test_support" ]
550 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
554 deps += [ "//third_party/iaccessible2" ]
557 # These flags are needed to run the test on Mac.
558 # Search for comments about "xcode_settings" in chrome_tests.gypi.
559 ldflags = [ "-Wl,-ObjC" ]
561 deps += [ "//third_party/ocmock" ]
564 sources -= [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
565 deps += [ "//chromeos" ]
569 rebase_path(content_tests_gypi_values.content_unittests_android_sources,
573 "../browser/geolocation/network_location_provider_unittest.cc",
574 "../browser/geolocation/wifi_data_provider_common_unittest.cc",
575 "../browser/renderer_host/begin_frame_observer_proxy_unittest.cc",
576 "../browser/webui/url_data_manager_backend_unittest.cc",
578 deps += [ "//testing/android/native_test:native_test_native_code" ]
580 if (!is_android && !is_ios) {
581 deps += [ "//third_party/libvpx" ]
592 "../browser/renderer_host/render_widget_host_view_aura_unittest.cc",
593 "../browser/renderer_host/web_input_event_aura_unittest.cc",
594 "../browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc",
595 "../browser/web_contents/aura/overscroll_window_animation_unittest.cc",
596 "../browser/web_contents/aura/overscroll_window_delegate_unittest.cc",
597 "../browser/web_contents/web_contents_view_aura_unittest.cc",
600 if (use_aura || toolkit_views) {
601 deps += [ "//ui/events:test_support" ]
603 if (!use_aura && !is_mac) {
605 "../browser/compositor/buffer_queue_unittest.cc",
606 "../browser/compositor/reflector_impl_unittest.cc",
607 "../browser/compositor/software_browser_compositor_output_surface_unittest.cc",
611 if (!is_win && !is_mac) {
612 sources -= [ "../common/plugin_list_unittest.cc" ]
618 "//ui/ozone:ozone_base",
622 [ "../browser/compositor/software_output_device_ozone_unittest.cc" ]
625 if (is_mac && use_openssl) {
626 deps += [ "//third_party/boringssl" ]
630 if (!is_mac) { # TODO(GYP) enable on Mac once it links.
631 test("content_perftests") {
633 "../browser/renderer_host/input/input_router_impl_perftest.cc",
634 "../common/cc_messages_perftest.cc",
635 "../test/run_all_perftests.cc",
639 "//base/test:test_support",
640 "//content/public/browser",
641 "//content/public/common",
642 "//content/test:test_support",
652 deps += [ "//testing/android/native_test:native_test_native_code" ]
656 test("content_gl_tests") {
658 "../common/gpu/client/gl_helper_unittest.cc",
659 "../common/gpu/client/gpu_in_process_context_tests.cc",
665 "//base/test:test_support",
666 "//content/public/common",
668 "//gpu/command_buffer/common",
670 "//third_party/WebKit/public:blink",
673 "//ui/gfx:test_support",
680 deps += [ "//testing/android/native_test:native_test_native_code" ]
683 "//third_party/ffmpeg",
684 "//third_party/mesa:osmesa",
689 test("content_gl_benchmark") {
691 "../common/gpu/client/gl_helper_benchmark.cc",
697 "//base/test:test_support",
698 "//content/public/common",
701 "//third_party/WebKit/public:blink",