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",
38 "//ui/base:test_support",
39 "//ui/events:dom4_keycode_converter",
40 "//ui/events:events_base",
41 "//ui/events:test_support",
42 "//ui/events:gesture_detection",
43 "//ui/gfx:test_support",
51 rebase_path(content_tests_gypi_values.test_support_content_sources,
55 public_deps += [ "//third_party/WebKit/public:blink" ]
57 "//content/browser/speech/proto",
58 "//content/public/child:child_sources",
60 "//content/public/plugin:plugin_sources",
61 "//content/public/renderer:renderer_sources",
62 "//content/public/utility:utility_sources",
63 "//content/shell:pak",
70 "//ppapi/proxy:test_support",
71 "//ppapi/shared_impl",
72 "//ppapi/shared_impl:test_support",
77 "//webkit/common/gpu",
81 deps += [ "//content/ppapi_plugin" ]
86 "../renderer/media/mock_data_channel_impl.cc",
87 "../renderer/media/mock_data_channel_impl.h",
88 "../renderer/media/mock_media_stream_dispatcher.cc",
89 "../renderer/media/mock_media_stream_dispatcher.h",
90 "../renderer/media/mock_peer_connection_impl.cc",
91 "../renderer/media/mock_peer_connection_impl.h",
92 "../renderer/media/mock_web_rtc_peer_connection_handler_client.cc",
93 "../renderer/media/mock_web_rtc_peer_connection_handler_client.h",
94 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.cc",
95 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.h",
99 "//third_party/libjingle:libjingle_webrtc",
100 "//third_party/libjingle:libpeerconnection",
101 "//third_party/webrtc/modules/video_capture",
104 if (!enable_plugins) {
105 sources -= [ "ppapi_unittest.cc" ]
109 configs += [ "//build/config/linux:glib" ]
114 "//ui/aura:test_support",
115 "//ui/resources:ui_test_pak",
120 if (use_aura || is_mac) {
121 deps += [ "//ui/compositor" ]
125 deps += [ "//ui/ozone" ]
129 deps += [ "//third_party/iaccessible2" ]
130 sources += [ "../app/startup_helper_win.cc" ]
133 if (!is_android && !is_ios) {
135 "../browser/compositor/test/no_transport_image_transport_factory.cc",
136 "../browser/compositor/test/no_transport_image_transport_factory.h",
140 "//third_party/libvpx",
147 "//ui/shell_dialogs",
152 deps += [ "//sandbox" ]
156 "public/test/content_test_suite_base.cc",
157 "public/test/mock_notification_observer.cc",
158 "public/test/mock_resource_context.cc",
159 "public/test/test_browser_thread.cc",
160 "public/test/test_content_client_initializer.cc",
161 "public/test/test_notification_tracker.cc",
162 "public/test/test_utils.cc",
163 "public/test/unittest_test_suite.cc",
164 "test/content_test_suite.cc",
165 "test/test_content_browser_client.cc",
166 "test/test_content_client.cc",
169 if (v8_use_external_startup_data) {
170 deps += [ "//gin:gin" ]
174 source_set("browsertest_support") {
178 "../public/test/content_browser_test.cc",
179 "../public/test/content_browser_test.h",
180 "../public/test/content_browser_test_utils.cc",
181 "../public/test/content_browser_test_utils.h",
182 "../public/test/content_browser_test_utils_mac.mm",
183 "content_test_launcher.cc",
187 "//content/shell:content_shell_lib",
190 "//ui/accessibility:ax_gen",
194 deps += [ "//content/public/app:both" ]
196 deps += [ "//content/public/browser" ]
200 mojom("web_ui_test_mojo_bindings") {
202 "data/web_ui_test_mojo_bindings.mojom",
207 # GYP version //content/content_tests.gypi:layouttest_support_content
208 static_library("layouttest_support") {
210 sources = rebase_path(
211 content_tests_gypi_values.layouttest_support_content_sources,
219 "//content/public/common",
222 "//ui/accessibility:ax_gen",
229 if (!enable_webrtc) {
231 "test_media_stream_renderer_factory.cc",
232 "test_media_stream_renderer_factory.h",
238 import("//build/config/android/rules.gni")
240 generate_jni("jni") {
242 "../public/test/android/javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java",
244 jni_package = "content/public/test"
249 # TODO(GYP) enable content_browsertests on Mac when it links.
251 test("content_browsertests") {
253 rebase_path(content_tests_gypi_values.content_browsertests_sources,
257 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
259 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
262 ":browsertest_support",
263 ":web_ui_test_mojo_bindings",
265 "//base/test:test_support",
266 "//content/common:mojo_bindings",
268 "//content/public/common",
269 "//content/public/plugin",
270 "//content/public/renderer",
271 "//content:resources",
272 "//content/shell:content_shell_lib",
273 "//content/shell:pak",
274 "//content/test:test_support",
276 "//device/battery:mojo_bindings",
279 "//ipc:test_support",
280 "//media:test_support",
281 "//media/audio:test_support",
282 "//media/base:test_support",
283 "//media:shared_memory_support",
284 "//mojo/environment:chromium",
285 "//net:test_support",
289 "//ppapi/shared_impl",
290 "//third_party/mojo/src/mojo/edk/system",
291 "//third_party/mojo/src/mojo/edk/test:test_support",
292 "//third_party/mojo/src/mojo/public/cpp/bindings",
293 "//third_party/mojo/src/mojo/public/js",
295 #"//ppapi:ppapi_tests", TODO(GYP)
296 #"//ppapi:ppapi_unittest_shared", TODO(GYP)
299 "//third_party/WebKit/public:blink",
300 "//third_party/leveldatabase",
301 "//third_party/mesa:osmesa",
302 "//ui/accessibility",
303 "//ui/accessibility:ax_gen",
310 "//ui/shell_dialogs",
318 [ "../browser/web_contents/touch_editable_impl_aura_browsertest.cc" ]
322 sources += rebase_path(
323 content_tests_gypi_values.content_browsertests_win_sources,
327 # TODO(GYP) Windows support
328 # 'resource_include_dirs': [
329 # '<(SHARED_INTERMEDIATE_DIR)/webkit',
332 # 'shell/app/resource.h',
333 # 'shell/app/shell.rc',
334 # # TODO: It would be nice to have these pulled in
335 # # automatically from direct_dependent_settings in
336 # # their various targets (net.gyp:net_resources, etc.),
337 # # but that causes errors in other targets when
338 # # resulting .res files get referenced multiple times.
339 # '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.rc',
340 # '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.rc',
341 # '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
344 "//content/app/strings",
345 "//net:net_resources",
346 "//third_party/WebKit/public:resources",
347 "//third_party/iaccessible2",
348 "//third_party/isimpledom",
355 # 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
360 [ "../browser/accessibility/dump_accessibility_tree_browsertest.cc" ]
364 sources += rebase_path(
365 content_tests_gypi_values.content_browsertests_android_sources,
369 [ "../browser/battery_status/battery_monitor_impl_browsertest.cc" ]
371 "//content/shell/android:content_shell_jni_headers",
372 "//content/shell:content_shell_lib",
373 "//testing/android:native_test_util",
380 sources += [ "../renderer/external_popup_menu_browsertest.cc" ]
382 # Needed for Content Shell.app's Helper.
383 #"//content/shell:content_shell", #TODO(GYP) enable for mac
387 if (use_aura && !is_win) {
388 deps += [ "//ui/events:test_support" ]
391 if (!use_aura && !is_mac) {
393 [ "../browser/compositor/image_transport_factory_browsertest.cc" ]
396 if (use_aura && !is_win) {
397 sources -= [ "../browser/plugin_browsertest.cc" ]
400 if (!is_android && !is_ios && !is_linux) {
401 # Npapi test plugin doesn't build on Android or iOS.
402 #data_deps += [ 'copy_npapi_test_plugin' ] TODO(GYP)
406 sources += rebase_path(
407 content_tests_gypi_values.content_browsertests_webrtc_sources,
410 deps += [ "//testing/perf" ]
413 if (enable_plugins) {
414 sources += rebase_path(
415 content_tests_gypi_values.content_browsertests_plugins_sources,
418 data_deps += [ "//ppapi:ppapi_tests" ]
421 if (enable_web_speech) {
422 sources += rebase_path(
423 content_tests_gypi_values.content_browsertests_speech_sources,
428 if (!is_chrome_branded) {
429 sources += rebase_path(
430 content_tests_gypi_values.content_browsertests_unofficial_build_sources,
437 [ "../browser/web_contents/web_contents_view_aura_browsertest.cc" ]
442 if (!is_mac) { # TODO(GYP) enable on Mac once it links.
443 test("content_unittests") {
444 sources = rebase_path(content_tests_gypi_values.content_unittests_sources,
450 "//base/test:test_support",
451 "//content/browser/background_sync:background_sync_proto",
452 "//content/browser/notifications:notification_proto",
453 "//content/browser/service_worker:service_worker_proto",
454 "//content/browser/speech/proto",
455 "//content/public/browser",
456 "//content/public/common",
457 "//content/public/common:mojo_bindings",
460 "//device/battery:mojo_bindings",
461 "//mojo/environment:chromium",
462 "//net:test_support",
465 "//sql:test_support",
468 "//third_party/mojo/src/mojo/edk/test:test_support",
469 "//third_party/mojo/src/mojo/public/cpp/bindings",
471 "//ui/accessibility",
481 "//base/third_party/dynamic_annotations",
485 "//content:resources",
487 "//content/public/browser",
488 "//content/public/child",
489 "//content/public/plugin",
490 "//content/public/renderer",
493 "//gpu:test_support",
494 "//ipc:test_support",
495 "//media:test_support",
496 "//media:shared_memory_support",
497 "//media/audio:test_support",
498 "//media/base:test_support",
501 "//third_party/WebKit/public:blink",
503 "//third_party/leveldatabase",
504 "//third_party/libjingle",
510 sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ]
513 if (enable_plugins) {
514 sources += rebase_path(
515 content_tests_gypi_values.content_unittests_plugins_sources,
521 sources += rebase_path(
522 content_tests_gypi_values.content_unittests_webrtc_sources,
526 "//third_party/libjingle:libjingle_webrtc",
527 "//third_party/libjingle:libpeerconnection",
528 "//third_party/webrtc/modules/video_capture",
531 if (is_linux || is_mac || is_win) {
533 [ "../browser/media/capture/desktop_capture_device_unittest.cc" ]
534 deps += [ "//third_party/webrtc/modules/desktop_capture" ]
538 sources += [ "../browser/media/capture/desktop_capture_device_aura_unittest.cc" ]
541 if (enable_plugins) {
542 # This file is added only when plugins are enabled, but we don't want it
543 # unless webrtc is also enabled.
545 [ "../renderer/media/webrtc/video_destination_handler_unittest.cc" ]
549 if (enable_web_speech) {
550 sources += rebase_path(
551 content_tests_gypi_values.content_unittests_speech_sources,
558 deps += [ "//dbus:test_support" ]
561 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
565 deps += [ "//third_party/iaccessible2" ]
568 # These flags are needed to run the test on Mac.
569 # Search for comments about "xcode_settings" in chrome_tests.gypi.
570 ldflags = [ "-Wl,-ObjC" ]
574 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
575 deps += [ "//chromeos" ]
578 sources += rebase_path(
579 content_tests_gypi_values.content_unittests_android_sources,
583 "../browser/geolocation/network_location_provider_unittest.cc",
584 "../browser/geolocation/wifi_data_provider_common_unittest.cc",
585 "../browser/webui/url_data_manager_backend_unittest.cc",
587 deps += [ "//testing/android:native_test_native_code" ]
589 if (!is_android && !is_ios) {
590 deps += [ "//third_party/libvpx" ]
600 "../browser/renderer_host/render_widget_host_view_aura_unittest.cc",
601 "../browser/renderer_host/web_input_event_aura_unittest.cc",
602 "../browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc",
603 "../browser/web_contents/aura/window_slider_unittest.cc",
606 if (use_aura || toolkit_views) {
607 deps += [ "//ui/events:test_support" ]
609 if (!use_aura && !is_mac) {
611 "../browser/compositor/buffer_queue_unittest.cc",
612 "../browser/compositor/reflector_impl_unittest.cc",
613 "../browser/compositor/software_browser_compositor_output_surface_unittest.cc",
617 if (!is_win && !is_mac) {
618 sources -= [ "../common/plugin_list_unittest.cc" ]
624 "//ui/ozone:ozone_base",
628 [ "../browser/compositor/software_output_device_ozone_unittest.cc" ]
631 if (is_mac && use_openssl) {
632 deps += [ "//third_party/boringssl" ]
637 if (!is_mac) { # TODO(GYP) enable on Mac once it links.
638 test("content_perftests") {
640 "../browser/net/sqlite_persistent_cookie_store_perftest.cc",
641 "../browser/renderer_host/input/input_router_impl_perftest.cc",
642 "../common/cc_messages_perftest.cc",
643 "../test/run_all_perftests.cc",
647 "//base/test:test_support",
648 "//content/public/browser",
649 "//content/public/common",
650 "//content/test:test_support",
660 deps += [ "//testing/android:native_test_native_code" ]
664 test("content_gl_tests") {
666 "../common/gpu/client/gl_helper_unittest.cc",
667 "../common/gpu/client/gpu_in_process_context_tests.cc",
673 "//base/test:test_support",
674 "//content/public/common",
675 "//gpu/command_buffer/common",
677 "//third_party/WebKit/public:blink",
680 "//ui/gfx:test_support",
687 deps += [ "//testing/android:native_test_native_code" ]
690 "//third_party/ffmpeg",
691 "//third_party/mesa:osmesa",
696 test("content_gl_benchmark") {
698 "../common/gpu/client/gl_helper_benchmark.cc",
704 "//base/test:test_support",
705 "//content/public/common",
707 "//third_party/WebKit/public:blink",