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/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
8 import("//build/module_args/v8.gni")
9 import("//testing/test.gni")
10 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
12 content_tests_gypi_values =
13 exec_script("//build/gypi_to_gn.py",
15 rebase_path("../content_tests.gypi"),
16 "--replace=<(SHARED_INTERMEDIATE_DIR)=$root_gen_dir",
19 [ "../content_tests.gypi" ])
21 # GYP version //content/content_tests.gypi:test_support_content
22 static_library("test_support") {
27 "//content/public/app:both",
28 "//content/public/browser:browser_sources",
29 "//content/public/common:common_sources",
35 "//ui/accessibility:ax_gen",
37 "//ui/base:test_support",
38 "//ui/events:dom4_keycode_converter",
39 "//ui/events:events_base",
40 "//ui/events:test_support",
41 "//ui/events:gesture_detection",
42 "//ui/gfx:test_support",
50 rebase_path(content_tests_gypi_values.test_support_content_sources,
54 public_deps += [ "//third_party/WebKit/public:blink" ]
56 "//content/browser/speech/proto",
57 "//content/public/child:child_sources",
59 "//content/public/renderer:renderer_sources",
60 "//content/public/utility:utility_sources",
61 "//content/shell:pak",
67 "//ppapi:ppapi_proxy",
68 "//ppapi:ppapi_shared",
69 "//ppapi:ppapi_unittest_shared",
74 "//webkit/common/gpu",
78 deps += [ "//content/ppapi_plugin" ]
82 # TODO(GYP) remove this when libjingle is converted.
83 configs += [ "//third_party/libjingle:jingle_direct_dependent_configs" ]
86 "../renderer/media/mock_media_stream_dispatcher.cc",
87 "../renderer/media/mock_media_stream_dispatcher.h",
88 "../renderer/media/mock_peer_connection_impl.cc",
89 "../renderer/media/mock_peer_connection_impl.h",
90 "../renderer/media/mock_web_rtc_peer_connection_handler_client.cc",
91 "../renderer/media/mock_web_rtc_peer_connection_handler_client.h",
92 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.cc",
93 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.h",
97 #"//third_party/libjingle:webrtc", TODO(GYP)
98 #"//third_party/libjingle:peerconnection", TODO(GYP)
99 "//third_party/webrtc/modules/video_capture",
102 if (!enable_plugins) {
103 sources -= [ "ppapi_unittest.cc" ]
107 configs += [ "//build/config/linux:glib" ]
112 "//ui/aura:test_support",
113 "//ui/resources:ui_test_pak",
118 if (use_aura || is_mac) {
119 deps += [ "//ui/compositor" ]
123 deps += [ "//ui/ozone" ]
127 deps += [ "//third_party/iaccessible2" ]
130 if (!is_android && !is_ios) {
132 "../browser/compositor/test/no_transport_image_transport_factory.cc",
133 "../browser/compositor/test/no_transport_image_transport_factory.h",
137 "//third_party/libvpx",
144 "//ui/shell_dialogs",
149 deps += [ "//sandbox" ]
153 "public/test/content_test_suite_base.cc",
154 "public/test/mock_notification_observer.cc",
155 "public/test/mock_resource_context.cc",
156 "public/test/test_browser_thread.cc",
157 "public/test/test_content_client_initializer.cc",
158 "public/test/test_notification_tracker.cc",
159 "public/test/test_utils.cc",
160 "public/test/unittest_test_suite.cc",
161 "test/content_test_suite.cc",
162 "test/test_content_browser_client.cc",
163 "test/test_content_client.cc",
166 if (v8_use_external_startup_data) {
167 deps += [ "//gin:gin" ]
171 source_set("browsertest_support") {
175 "../public/test/content_browser_test.cc",
176 "../public/test/content_browser_test.h",
177 "../public/test/content_browser_test_utils.cc",
178 "../public/test/content_browser_test_utils.h",
179 "../public/test/content_browser_test_utils_mac.mm",
180 "content_test_launcher.cc",
184 "//content/shell:content_shell_lib",
187 "//ui/accessibility:ax_gen",
191 deps += [ "//content/public/app:both" ]
193 deps += [ "//content/public/browser" ]
197 mojom("web_ui_test_mojo_bindings") {
199 "data/web_ui_test_mojo_bindings.mojom",
204 # GYP version //content/content_tests.gypi:layouttest_support_content
205 static_library("layouttest_support") {
207 sources = rebase_path(
208 content_tests_gypi_values.layouttest_support_content_sources,
216 "//content/public/common",
219 "//ui/accessibility:ax_gen",
226 if (!enable_webrtc) {
228 "test_media_stream_renderer_factory.cc",
229 "test_media_stream_renderer_factory.h",
235 import("//build/config/android/rules.gni")
237 generate_jni("jni") {
239 "../public/test/android/javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java",
241 jni_package = "content/public/test"
246 # TODO(GYP) enable content_browsertests on Mac when it links.
248 test("content_browsertests") {
250 rebase_path(content_tests_gypi_values.content_browsertests_sources,
254 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
257 ":browsertest_support",
258 ":web_ui_test_mojo_bindings",
260 "//base/test:test_support",
261 "//content/common:mojo_bindings",
263 "//content/public/common",
264 "//content/public/plugin",
265 "//content/public/renderer",
266 "//content:resources",
267 "//content/shell:content_shell_lib",
268 "//content/shell:pak",
269 "//content/test:test_support",
271 "//device/battery:mojo_bindings",
274 "//ipc:test_support",
275 "//media:test_support",
276 "//media/audio:test_support",
277 "//media/base:test_support",
278 "//media:shared_memory_support",
279 "//mojo/environment:chromium",
280 "//net:test_support",
281 "//ppapi:ppapi_host",
283 "//ppapi:ppapi_proxy",
284 "//ppapi:ppapi_shared",
285 "//third_party/mojo/src/mojo/edk/system",
286 "//third_party/mojo/src/mojo/edk/test:test_support",
287 "//third_party/mojo/src/mojo/public/cpp/bindings",
288 "//third_party/mojo/src/mojo/public/js",
290 #"//ppapi:ppapi_tests", TODO(GYP)
291 #"//ppapi:ppapi_unittest_shared", TODO(GYP)
294 "//third_party/WebKit/public:blink",
295 "//third_party/leveldatabase",
296 "//third_party/mesa:osmesa",
297 "//ui/accessibility",
298 "//ui/accessibility:ax_gen",
304 "//ui/shell_dialogs",
310 [ "../browser/web_contents/touch_editable_impl_aura_browsertest.cc" ]
314 sources += rebase_path(
315 content_tests_gypi_values.content_browsertests_win_sources,
319 # TODO(GYP) Windows support
320 # 'resource_include_dirs': [
321 # '<(SHARED_INTERMEDIATE_DIR)/webkit',
324 # 'shell/app/resource.h',
325 # 'shell/app/shell.rc',
326 # # TODO: It would be nice to have these pulled in
327 # # automatically from direct_dependent_settings in
328 # # their various targets (net.gyp:net_resources, etc.),
329 # # but that causes errors in other targets when
330 # # resulting .res files get referenced multiple times.
331 # '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.rc',
332 # '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.rc',
333 # '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
336 "//content/app/strings",
337 "//net:net_resources",
338 "//third_party/WebKit/public:resources",
339 "//third_party/iaccessible2",
340 "//third_party/isimpledom",
347 # 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
352 [ "../browser/accessibility/dump_accessibility_tree_browsertest.cc" ]
356 sources += rebase_path(
357 content_tests_gypi_values.content_browsertests_android_sources,
361 [ "../browser/battery_status/battery_monitor_impl_browsertest.cc" ]
363 "//content/shell/android:content_shell_jni_headers",
364 "//content/shell:content_shell_lib",
365 "//testing/android:native_test_util",
372 sources += [ "../renderer/external_popup_menu_browsertest.cc" ]
374 # Needed for Content Shell.app's Helper.
375 #"//content/shell:content_shell", #TODO(GYP) enable for mac
379 if (use_aura && !is_win) {
380 deps += [ "//ui/events:test_support" ]
383 if (!use_aura && !is_mac) {
385 [ "../browser/compositor/image_transport_factory_browsertest.cc" ]
388 if (!is_android && !is_ios && !is_linux) {
389 # Npapi test plugin doesn't build on Android or iOS.
390 #data_deps += [ 'copy_npapi_test_plugin' ] TODO(GYP)
394 sources += rebase_path(
395 content_tests_gypi_values.content_browsertests_webrtc_sources,
398 deps += [ "//testing/perf" ]
401 if (enable_plugins) {
402 sources += rebase_path(
403 content_tests_gypi_values.content_browsertests_plugins_sources,
406 #deps += [ "//ppapi:ppapi_tests" ] # TODO(GYP)
409 if (enable_web_speech) {
410 sources += rebase_path(
411 content_tests_gypi_values.content_browsertests_speech_sources,
416 if (!is_chrome_branded) {
417 sources += rebase_path(
418 content_tests_gypi_values.content_browsertests_unofficial_build_sources,
425 [ "../browser/web_contents/web_contents_view_aura_browsertest.cc" ]
430 if (!is_mac) { # TODO(GYP) enable on Mac once it links.
431 test("content_unittests") {
432 sources = rebase_path(content_tests_gypi_values.content_unittests_sources,
438 "//base/test:test_support",
439 "//content/browser/service_worker:proto",
440 "//content/browser/speech/proto",
441 "//content/public/browser",
442 "//content/public/common",
443 "//content/public/common:mojo_bindings",
446 "//device/battery:mojo_bindings",
447 "//mojo/environment:chromium",
448 "//net:test_support",
451 "//sql:test_support",
454 "//third_party/mojo/src/mojo/edk/test:test_support",
455 "//third_party/mojo/src/mojo/public/cpp/bindings",
457 "//ui/accessibility",
467 "//base/third_party/dynamic_annotations",
471 "//content:resources",
473 "//content/public/browser",
474 "//content/public/child",
475 "//content/public/plugin",
476 "//content/public/renderer",
479 "//gpu:test_support",
480 "//ipc:test_support",
481 "//media:test_support",
482 "//media:shared_memory_support",
483 "//media/audio:test_support",
484 "//media/base:test_support",
487 "//third_party/WebKit/public:blink",
489 "//third_party/leveldatabase",
490 "//third_party/libjingle",
496 sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ]
499 if (enable_plugins) {
500 sources += rebase_path(
501 content_tests_gypi_values.content_unittests_plugins_sources,
507 sources += rebase_path(
508 content_tests_gypi_values.content_unittests_webrtc_sources,
512 "//third_party/libjingle:libjingle_webrtc",
513 "//third_party/libjingle:libpeerconnection",
514 "//third_party/webrtc/modules/video_capture",
517 if (is_linux || is_mac || is_win) {
519 [ "../browser/media/capture/desktop_capture_device_unittest.cc" ]
520 deps += [ "//third_party/webrtc/modules/desktop_capture" ]
525 [ "browser/media/capture/desktop_capture_device_aura_unittest.cc" ]
528 if (enable_plugins) {
529 # This file is added only when plugins are enabled, but we don't want it
530 # unless webrtc is also enabled.
532 [ "../renderer/media/webrtc/video_destination_handler_unittest.cc" ]
536 if (enable_web_speech) {
537 sources += rebase_path(
538 content_tests_gypi_values.content_unittests_speech_sources,
544 deps += [ "//dbus:test_support" ]
547 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
551 deps += [ "//third_party/iaccessible2" ]
554 # These flags are needed to run the test on Mac.
555 # Search for comments about "xcode_settings" in chrome_tests.gypi.
556 ldflags = [ "-Wl,-ObjC" ]
560 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
561 deps += [ "//chromeos" ]
564 sources += rebase_path(
565 content_tests_gypi_values.content_unittests_android_sources,
569 "../browser/geolocation/network_location_provider_unittest.cc",
570 "../browser/geolocation/wifi_data_provider_common_unittest.cc",
571 "../browser/webui/url_data_manager_backend_unittest.cc",
573 deps += [ "//testing/android:native_test_native_code" ]
575 if (!is_android && !is_ios) {
576 deps += [ "//third_party/libvpx" ]
586 "../browser/renderer_host/render_widget_host_view_aura_unittest.cc",
587 "../browser/renderer_host/web_input_event_aura_unittest.cc",
588 "../browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc",
589 "../browser/web_contents/aura/window_slider_unittest.cc",
592 if (use_aura || toolkit_views) {
593 deps += [ "//ui/events:test_support" ]
595 if (!use_aura && !is_mac) {
597 "../browser/compositor/buffer_queue_unittest.cc",
598 "../browser/compositor/software_browser_compositor_output_surface_unittest.cc",
602 if (!is_win && !is_mac) {
603 sources -= [ "../common/plugin_list_unittest.cc" ]
609 "//ui/ozone:ozone_base",
613 [ "../browser/compositor/software_output_device_ozone_unittest.cc" ]
616 if (is_mac && use_openssl) {
617 deps += [ "//third_party/boringssl" ]
622 if (!is_mac) { # TODO(GYP) enable on Mac once it links.
623 test("content_perftests") {
625 "../browser/renderer_host/input/input_router_impl_perftest.cc",
626 "../common/cc_messages_perftest.cc",
627 "../test/run_all_perftests.cc",
631 "//base/test:test_support",
632 "//content/public/browser",
633 "//content/public/common",
634 "//content/test:test_support",
644 deps += [ "//testing/android:native_test_native_code" ]
648 test("content_gl_tests") {
650 "../common/gpu/client/gl_helper_unittest.cc",
651 "../common/gpu/client/gpu_in_process_context_tests.cc",
657 "//base/test:test_support",
658 "//content/public/common",
659 "//gpu/command_buffer/common",
661 "//third_party/WebKit/public:blink",
664 "//ui/gfx:test_support",
671 deps += [ "//testing/android:native_test_native_code" ]
674 "//third_party/ffmpeg",
675 "//third_party/mesa:osmesa",
680 test("content_gl_benchmark") {
682 "../common/gpu/client/gl_helper_benchmark.cc",
688 "//base/test:test_support",
689 "//content/public/common",
691 "//third_party/WebKit/public:blink",