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") {
26 "//content/public/app:both",
27 "//content/public/browser",
28 "//content/public/common",
37 "//ui/accessibility:ax_gen",
40 "//ui/base:test_support",
41 "//ui/events:dom_keycode_converter",
42 "//ui/events:events_base",
43 "//ui/events:test_support",
44 "//ui/events:gesture_detection",
45 "//ui/gfx:test_support",
47 "//ui/gl:test_support",
54 rebase_path(content_tests_gypi_values.test_support_content_sources,
58 public_deps += [ "//third_party/WebKit/public:blink" ]
60 ":content_test_mojo_bindings",
61 "//components/scheduler:scheduler",
62 "//components/scheduler:test_support",
63 "//content/browser/speech/proto",
64 "//content/public/child",
66 "//content/public/plugin",
67 "//content/public/renderer",
68 "//content/public/utility",
69 "//content/shell:pak",
74 "//mojo/application/public/cpp:cpp_for_chromium",
75 "//mojo/environment:chromium",
78 "//ppapi/proxy:test_support",
79 "//ppapi/shared_impl",
80 "//ppapi/shared_impl:test_support",
88 deps += [ "//content/ppapi_plugin" ]
93 "../renderer/media/mock_data_channel_impl.cc",
94 "../renderer/media/mock_data_channel_impl.h",
95 "../renderer/media/mock_media_stream_dispatcher.cc",
96 "../renderer/media/mock_media_stream_dispatcher.h",
97 "../renderer/media/mock_peer_connection_impl.cc",
98 "../renderer/media/mock_peer_connection_impl.h",
99 "../renderer/media/mock_web_rtc_peer_connection_handler_client.cc",
100 "../renderer/media/mock_web_rtc_peer_connection_handler_client.h",
101 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.cc",
102 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.h",
106 "//third_party/libjingle:libjingle_webrtc",
107 "//third_party/libjingle:libpeerconnection",
108 "//third_party/webrtc/modules/video_capture",
111 if (!enable_plugins) {
112 sources -= [ "ppapi_unittest.cc" ]
116 configs += [ "//build/config/linux:glib" ]
121 "//ui/aura:test_support",
122 "//ui/resources:ui_test_pak",
127 if (use_aura || is_mac) {
128 deps += [ "//ui/compositor" ]
132 deps += [ "//ui/ozone" ]
137 "//content:startup_helper_win",
138 "//third_party/iaccessible2",
142 if (!is_android && !is_ios) {
144 "../browser/compositor/test/no_transport_image_transport_factory.cc",
145 "../browser/compositor/test/no_transport_image_transport_factory.h",
149 "//third_party/libvpx",
155 "//content/shell/android:copy_content_shell_assets",
157 "//ui/shell_dialogs",
162 deps += [ "//sandbox" ]
166 "public/test/content_test_suite_base.cc",
167 "public/test/mock_notification_observer.cc",
168 "public/test/mock_resource_context.cc",
169 "public/test/test_browser_thread.cc",
170 "public/test/test_content_client_initializer.cc",
171 "public/test/test_notification_tracker.cc",
172 "public/test/test_utils.cc",
173 "public/test/unittest_test_suite.cc",
174 "test/content_test_suite.cc",
175 "test/test_content_browser_client.cc",
176 "test/test_content_client.cc",
179 if (v8_use_external_startup_data) {
180 deps += [ "//gin:gin" ]
184 source_set("browsertest_support") {
188 "../public/test/content_browser_test.cc",
189 "../public/test/content_browser_test.h",
190 "../public/test/content_browser_test_utils.cc",
191 "../public/test/content_browser_test_utils.h",
192 "../public/test/content_browser_test_utils_mac.mm",
193 "content_browser_test_utils_internal.cc",
194 "content_browser_test_utils_internal.h",
195 "content_test_launcher.cc",
199 "//content/shell:content_shell_lib",
202 "//ui/accessibility:ax_gen",
206 deps += [ "//content/public/app:both" ]
208 deps += [ "//content/public/browser" ]
212 mojom("content_test_mojo_bindings") {
214 "../public/test/test_mojo_service.mojom",
218 mojom("web_ui_test_mojo_bindings") {
220 "data/web_ui_test_mojo_bindings.mojom",
225 # GYP version //content/content_tests.gypi:layouttest_support_content
226 static_library("layouttest_support") {
228 sources = rebase_path(
229 content_tests_gypi_values.layouttest_support_content_sources,
237 "//components/test_runner:test_runner",
238 "//content/public/common",
241 "//ui/accessibility:ax_gen",
250 import("//build/config/android/rules.gni")
252 generate_jni("jni") {
254 "../public/test/android/javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java",
256 jni_package = "content/public/test"
261 # TODO(GYP) enable content_browsertests on Mac when it links.
263 test("content_browsertests") {
265 rebase_path(content_tests_gypi_values.content_browsertests_sources,
269 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
271 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
274 ":browsertest_support",
275 ":web_ui_test_mojo_bindings",
277 "//base/test:test_support",
278 "//content/common:mojo_bindings",
280 "//content/public/common",
281 "//content/public/plugin",
282 "//content/public/renderer",
283 "//content:resources",
284 "//content/shell:content_shell_lib",
285 "//content/shell:pak",
286 "//content/test:test_support",
288 "//device/battery:mojo_bindings",
291 "//ipc:test_support",
292 "//media:test_support",
293 "//media/audio:test_support",
294 "//media/base:test_support",
295 "//media:shared_memory_support",
296 "//mojo/application/public/cpp:cpp_for_chromium",
297 "//mojo/environment:chromium",
298 "//mojo/test:test_support",
299 "//net:test_support",
303 "//ppapi/shared_impl",
304 "//third_party/mojo/src/mojo/edk/system",
305 "//third_party/mojo/src/mojo/edk/test:test_support",
306 "//third_party/mojo/src/mojo/public/cpp/bindings",
307 "//third_party/mojo/src/mojo/public/js",
310 "//third_party/WebKit/public:blink",
311 "//third_party/leveldatabase",
312 "//third_party/mesa:osmesa",
313 "//third_party/zlib",
314 "//ui/accessibility",
315 "//ui/accessibility:ax_gen",
321 "//ui/gl:test_support",
323 "//ui/shell_dialogs",
327 data_deps = [ "//ppapi:ppapi_tests" ] # Loaded at runtime.
331 [ "../browser/web_contents/touch_editable_impl_aura_browsertest.cc" ]
335 sources += rebase_path(
336 content_tests_gypi_values.content_browsertests_win_sources,
341 "//content/app/strings",
342 "//net:net_resources",
343 "//third_party/WebKit/public:resources",
344 "//third_party/iaccessible2",
345 "//third_party/isimpledom",
348 libs = [ "oleacc.lib" ]
353 [ "../browser/accessibility/dump_accessibility_tree_browsertest.cc" ]
357 sources += rebase_path(
358 content_tests_gypi_values.content_browsertests_android_sources,
362 [ "../browser/battery_status/battery_monitor_impl_browsertest.cc" ]
364 "//content/shell/android:content_shell_jni_headers",
365 "//content/shell:content_shell_lib",
366 "//testing/android/native_test:native_test_support",
373 sources += [ "../renderer/external_popup_menu_browsertest.cc" ]
375 # Needed for Content Shell.app's Helper.
376 #"//content/shell:content_shell", #TODO(GYP) enable for mac
380 if (use_aura && !is_win) {
381 deps += [ "//ui/events:test_support" ]
384 if (!use_aura && !is_mac) {
386 [ "../browser/compositor/image_transport_factory_browsertest.cc" ]
390 sources += rebase_path(
391 content_tests_gypi_values.content_browsertests_webrtc_sources,
394 deps += [ "//testing/perf" ]
397 if (enable_plugins) {
398 sources += rebase_path(
399 content_tests_gypi_values.content_browsertests_plugins_sources,
402 data_deps += [ "//ppapi:ppapi_tests" ]
405 if (enable_web_speech) {
406 sources += rebase_path(
407 content_tests_gypi_values.content_browsertests_speech_sources,
412 if (!is_chrome_branded) {
413 sources += rebase_path(
414 content_tests_gypi_values.content_browsertests_unofficial_build_sources,
421 [ "../browser/web_contents/web_contents_view_aura_browsertest.cc" ]
426 test("content_unittests") {
427 sources = rebase_path(content_tests_gypi_values.content_unittests_sources,
433 "//base/test:test_support",
434 "//content/browser/background_sync:background_sync_proto",
435 "//content/browser/notifications:notification_proto",
436 "//content/browser/service_worker:service_worker_proto",
437 "//content/browser/speech/proto",
438 "//content/common:mojo_bindings",
439 "//content/public/browser",
440 "//content/public/common",
441 "//content/public/common:mojo_bindings",
444 "//device/battery:mojo_bindings",
445 "//mojo/environment:chromium",
447 "//net:test_support",
450 "//sql:test_support",
453 "//third_party/mojo/src/mojo/edk/test:test_support",
454 "//third_party/mojo/src/mojo/public/cpp/bindings",
456 "//ui/accessibility",
466 "//base/third_party/dynamic_annotations",
470 "//content:resources",
472 "//content/public/browser",
473 "//content/public/child",
474 "//content/public/plugin",
475 "//content/public/renderer",
478 "//gpu:test_support",
479 "//ipc:test_support",
480 "//media:test_support",
481 "//media:shared_memory_support",
482 "//media/audio:test_support",
483 "//media/base:test_support",
487 "//third_party/WebKit/public:blink",
489 "//third_party/leveldatabase",
490 "//third_party/libjingle",
492 "//ui/gl:test_support",
497 sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ]
500 if (enable_plugins) {
502 rebase_path(content_tests_gypi_values.content_unittests_plugins_sources,
509 rebase_path(content_tests_gypi_values.content_unittests_webrtc_sources,
513 "//third_party/libjingle:libjingle_webrtc",
514 "//third_party/libjingle:libpeerconnection",
515 "//third_party/webrtc/modules/video_capture",
518 if (is_linux || is_mac || is_win) {
520 [ "../browser/media/capture/desktop_capture_device_unittest.cc" ]
521 deps += [ "//third_party/webrtc/modules/desktop_capture" ]
526 [ "../browser/media/capture/desktop_capture_device_aura_unittest.cc" ]
529 if (enable_plugins) {
530 # This file is added only when plugins are enabled, but we don't want it
531 # unless webrtc is also enabled.
533 [ "../renderer/media/webrtc/video_destination_handler_unittest.cc" ]
537 if (enable_web_speech) {
539 rebase_path(content_tests_gypi_values.content_unittests_speech_sources,
546 deps += [ "//dbus:test_support" ]
549 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
553 deps += [ "//third_party/iaccessible2" ]
556 # These flags are needed to run the test on Mac.
557 # Search for comments about "xcode_settings" in chrome_tests.gypi.
558 ldflags = [ "-Wl,-ObjC" ]
560 deps += [ "//third_party/ocmock" ]
563 sources -= [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
564 deps += [ "//chromeos" ]
568 rebase_path(content_tests_gypi_values.content_unittests_android_sources,
572 "../browser/geolocation/network_location_provider_unittest.cc",
573 "../browser/geolocation/wifi_data_provider_common_unittest.cc",
574 "../browser/renderer_host/begin_frame_observer_proxy_unittest.cc",
575 "../browser/webui/url_data_manager_backend_unittest.cc",
577 deps += [ "//testing/android/native_test:native_test_native_code" ]
579 if (!is_android && !is_ios) {
580 deps += [ "//third_party/libvpx" ]
591 "../browser/renderer_host/render_widget_host_view_aura_unittest.cc",
592 "../browser/renderer_host/web_input_event_aura_unittest.cc",
593 "../browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc",
594 "../browser/web_contents/aura/overscroll_window_animation_unittest.cc",
595 "../browser/web_contents/aura/overscroll_window_delegate_unittest.cc",
596 "../browser/web_contents/web_contents_view_aura_unittest.cc",
599 if (use_aura || toolkit_views) {
600 deps += [ "//ui/events:test_support" ]
602 if (!use_aura && !is_mac) {
604 "../browser/compositor/buffer_queue_unittest.cc",
605 "../browser/compositor/reflector_impl_unittest.cc",
606 "../browser/compositor/software_browser_compositor_output_surface_unittest.cc",
610 if (!is_win && !is_mac) {
611 sources -= [ "../common/plugin_list_unittest.cc" ]
617 "//ui/ozone:ozone_base",
621 [ "../browser/compositor/software_output_device_ozone_unittest.cc" ]
624 if (is_mac && use_openssl) {
625 deps += [ "//third_party/boringssl" ]
629 if (!is_mac) { # TODO(GYP) enable on Mac once it links.
630 test("content_perftests") {
632 "../browser/renderer_host/input/input_router_impl_perftest.cc",
633 "../common/cc_messages_perftest.cc",
634 "../test/run_all_perftests.cc",
638 "//base/test:test_support",
639 "//content/public/browser",
640 "//content/public/common",
641 "//content/test:test_support",
651 deps += [ "//testing/android/native_test:native_test_native_code" ]
655 test("content_gl_tests") {
657 "../common/gpu/client/gl_helper_unittest.cc",
658 "../common/gpu/client/gpu_in_process_context_tests.cc",
664 "//base/test:test_support",
665 "//content/public/common",
667 "//gpu/command_buffer/common",
669 "//third_party/WebKit/public:blink",
672 "//ui/gfx:test_support",
675 "//ui/gl: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",
706 "//ui/gl:test_support",