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",
69 "//ppapi:ppapi_proxy",
70 "//ppapi:ppapi_shared",
71 "//ppapi:ppapi_unittest_shared",
76 "//webkit/common/gpu",
80 deps += [ "//content/ppapi_plugin" ]
84 # TODO(GYP) remove this when libjingle is converted.
85 configs += [ "//third_party/libjingle:jingle_direct_dependent_configs" ]
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:webrtc", TODO(GYP)
100 #"//third_party/libjingle:peerconnection", TODO(GYP)
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.
250 if (!is_mac && (!is_win || link_chrome_on_windows)) {
251 test("content_browsertests") {
253 rebase_path(content_tests_gypi_values.content_browsertests_sources,
257 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
260 ":browsertest_support",
261 ":web_ui_test_mojo_bindings",
263 "//base/test:test_support",
264 "//content/common:mojo_bindings",
266 "//content/public/common",
267 "//content/public/plugin",
268 "//content/public/renderer",
269 "//content:resources",
270 "//content/shell:content_shell_lib",
271 "//content/shell:pak",
272 "//content/test:test_support",
274 "//device/battery:mojo_bindings",
277 "//ipc:test_support",
278 "//media:test_support",
279 "//media/audio:test_support",
280 "//media/base:test_support",
281 "//media:shared_memory_support",
282 "//mojo/environment:chromium",
283 "//net:test_support",
284 "//ppapi:ppapi_host",
286 "//ppapi:ppapi_proxy",
287 "//ppapi:ppapi_shared",
288 "//third_party/mojo/src/mojo/edk/system",
289 "//third_party/mojo/src/mojo/edk/test:test_support",
290 "//third_party/mojo/src/mojo/public/cpp/bindings",
291 "//third_party/mojo/src/mojo/public/js",
293 #"//ppapi:ppapi_tests", TODO(GYP)
294 #"//ppapi:ppapi_unittest_shared", TODO(GYP)
297 "//third_party/WebKit/public:blink",
298 "//third_party/leveldatabase",
299 "//third_party/mesa:osmesa",
300 "//ui/accessibility",
301 "//ui/accessibility:ax_gen",
308 "//ui/shell_dialogs",
314 [ "../browser/web_contents/touch_editable_impl_aura_browsertest.cc" ]
318 sources += rebase_path(
319 content_tests_gypi_values.content_browsertests_win_sources,
323 # TODO(GYP) Windows support
324 # 'resource_include_dirs': [
325 # '<(SHARED_INTERMEDIATE_DIR)/webkit',
328 # 'shell/app/resource.h',
329 # 'shell/app/shell.rc',
330 # # TODO: It would be nice to have these pulled in
331 # # automatically from direct_dependent_settings in
332 # # their various targets (net.gyp:net_resources, etc.),
333 # # but that causes errors in other targets when
334 # # resulting .res files get referenced multiple times.
335 # '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.rc',
336 # '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.rc',
337 # '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
340 "//content/app/strings",
341 "//net:net_resources",
342 "//third_party/WebKit/public:resources",
343 "//third_party/iaccessible2",
344 "//third_party/isimpledom",
351 # 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
356 [ "../browser/accessibility/dump_accessibility_tree_browsertest.cc" ]
360 sources += rebase_path(
361 content_tests_gypi_values.content_browsertests_android_sources,
365 [ "../browser/battery_status/battery_monitor_impl_browsertest.cc" ]
367 "//content/shell/android:content_shell_jni_headers",
368 "//content/shell:content_shell_lib",
369 "//testing/android:native_test_util",
376 sources += [ "../renderer/external_popup_menu_browsertest.cc" ]
378 # Needed for Content Shell.app's Helper.
379 #"//content/shell:content_shell", #TODO(GYP) enable for mac
383 if (use_aura && !is_win) {
384 deps += [ "//ui/events:test_support" ]
387 if (!use_aura && !is_mac) {
389 [ "../browser/compositor/image_transport_factory_browsertest.cc" ]
392 if (!is_android && !is_ios && !is_linux) {
393 # Npapi test plugin doesn't build on Android or iOS.
394 #data_deps += [ 'copy_npapi_test_plugin' ] TODO(GYP)
398 sources += rebase_path(
399 content_tests_gypi_values.content_browsertests_webrtc_sources,
402 deps += [ "//testing/perf" ]
405 if (enable_plugins) {
406 sources += rebase_path(
407 content_tests_gypi_values.content_browsertests_plugins_sources,
410 #deps += [ "//ppapi:ppapi_tests" ] # TODO(GYP)
413 if (enable_web_speech) {
414 sources += rebase_path(
415 content_tests_gypi_values.content_browsertests_speech_sources,
420 if (!is_chrome_branded) {
421 sources += rebase_path(
422 content_tests_gypi_values.content_browsertests_unofficial_build_sources,
429 [ "../browser/web_contents/web_contents_view_aura_browsertest.cc" ]
434 if (!is_mac && (!is_win || link_chrome_on_windows)) { # TODO(GYP) enable on Mac once it links.
435 test("content_unittests") {
436 sources = rebase_path(content_tests_gypi_values.content_unittests_sources,
442 "//base/test:test_support",
443 "//content/browser/service_worker:service_worker_proto",
444 "//content/browser/speech/proto",
445 "//content/public/browser",
446 "//content/public/common",
447 "//content/public/common:mojo_bindings",
450 "//device/battery:mojo_bindings",
451 "//mojo/environment:chromium",
452 "//net:test_support",
455 "//sql:test_support",
458 "//third_party/mojo/src/mojo/edk/test:test_support",
459 "//third_party/mojo/src/mojo/public/cpp/bindings",
461 "//ui/accessibility",
471 "//base/third_party/dynamic_annotations",
475 "//content:resources",
477 "//content/public/browser",
478 "//content/public/child",
479 "//content/public/plugin",
480 "//content/public/renderer",
483 "//gpu:test_support",
484 "//ipc:test_support",
485 "//media:test_support",
486 "//media:shared_memory_support",
487 "//media/audio:test_support",
488 "//media/base:test_support",
491 "//third_party/WebKit/public:blink",
493 "//third_party/leveldatabase",
494 "//third_party/libjingle",
500 sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ]
503 if (enable_plugins) {
504 sources += rebase_path(
505 content_tests_gypi_values.content_unittests_plugins_sources,
511 sources += rebase_path(
512 content_tests_gypi_values.content_unittests_webrtc_sources,
516 "//third_party/libjingle:libjingle_webrtc",
517 "//third_party/libjingle:libpeerconnection",
518 "//third_party/webrtc/modules/video_capture",
521 if (is_linux || is_mac || is_win) {
523 [ "../browser/media/capture/desktop_capture_device_unittest.cc" ]
524 deps += [ "//third_party/webrtc/modules/desktop_capture" ]
529 [ "browser/media/capture/desktop_capture_device_aura_unittest.cc" ]
532 if (enable_plugins) {
533 # This file is added only when plugins are enabled, but we don't want it
534 # unless webrtc is also enabled.
536 [ "../renderer/media/webrtc/video_destination_handler_unittest.cc" ]
540 if (enable_web_speech) {
541 sources += rebase_path(
542 content_tests_gypi_values.content_unittests_speech_sources,
548 deps += [ "//dbus:test_support" ]
551 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
555 deps += [ "//third_party/iaccessible2" ]
558 # These flags are needed to run the test on Mac.
559 # Search for comments about "xcode_settings" in chrome_tests.gypi.
560 ldflags = [ "-Wl,-ObjC" ]
564 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
565 deps += [ "//chromeos" ]
568 sources += rebase_path(
569 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/webui/url_data_manager_backend_unittest.cc",
577 deps += [ "//testing/android:native_test_native_code" ]
579 if (!is_android && !is_ios) {
580 deps += [ "//third_party/libvpx" ]
590 "../browser/renderer_host/render_widget_host_view_aura_unittest.cc",
591 "../browser/renderer_host/web_input_event_aura_unittest.cc",
592 "../browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc",
593 "../browser/web_contents/aura/window_slider_unittest.cc",
596 if (use_aura || toolkit_views) {
597 deps += [ "//ui/events:test_support" ]
599 if (!use_aura && !is_mac) {
601 "../browser/compositor/buffer_queue_unittest.cc",
602 "../browser/compositor/reflector_impl_unittest.cc",
603 "../browser/compositor/software_browser_compositor_output_surface_unittest.cc",
607 if (!is_win && !is_mac) {
608 sources -= [ "../common/plugin_list_unittest.cc" ]
614 "//ui/ozone:ozone_base",
618 [ "../browser/compositor/software_output_device_ozone_unittest.cc" ]
621 if (is_mac && use_openssl) {
622 deps += [ "//third_party/boringssl" ]
627 if (!is_mac && (!is_win || link_chrome_on_windows)) { # TODO(GYP) enable on Mac once it links.
628 test("content_perftests") {
630 "../browser/renderer_host/input/input_router_impl_perftest.cc",
631 "../common/cc_messages_perftest.cc",
632 "../test/run_all_perftests.cc",
636 "//base/test:test_support",
637 "//content/public/browser",
638 "//content/public/common",
639 "//content/test:test_support",
649 deps += [ "//testing/android:native_test_native_code" ]
653 test("content_gl_tests") {
655 "../common/gpu/client/gl_helper_unittest.cc",
656 "../common/gpu/client/gpu_in_process_context_tests.cc",
662 "//base/test:test_support",
663 "//content/public/common",
664 "//gpu/command_buffer/common",
666 "//third_party/WebKit/public:blink",
669 "//ui/gfx:test_support",
676 deps += [ "//testing/android:native_test_native_code" ]
679 "//third_party/ffmpeg",
680 "//third_party/mesa:osmesa",
685 test("content_gl_benchmark") {
687 "../common/gpu/client/gl_helper_benchmark.cc",
693 "//base/test:test_support",
694 "//content/public/common",
696 "//third_party/WebKit/public:blink",