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") {
25 configs += [ "//build/config:precompiled_headers" ]
27 "//content/public/app:both",
28 "//content/public/browser",
29 "//content/public/common",
38 "//ui/accessibility:ax_gen",
41 "//ui/base:test_support",
42 "//ui/events:dom_keycode_converter",
43 "//ui/events:events_base",
44 "//ui/events:test_support",
45 "//ui/events:gesture_detection",
46 "//ui/gfx:test_support",
48 "//ui/gl:test_support",
55 rebase_path(content_tests_gypi_values.test_support_content_sources,
59 public_deps += [ "//third_party/WebKit/public:blink" ]
61 ":content_test_mojo_bindings",
62 "//components/scheduler:scheduler",
63 "//components/scheduler:test_support",
64 "//content/browser/speech/proto",
65 "//content/public/child",
67 "//content/public/plugin",
68 "//content/public/renderer",
69 "//content/public/utility",
70 "//content/shell:pak",
75 "//mojo/application/public/cpp:cpp_for_chromium",
76 "//mojo/environment:chromium",
79 "//ppapi/proxy:test_support",
80 "//ppapi/shared_impl",
81 "//ppapi/shared_impl:test_support",
89 deps += [ "//content/ppapi_plugin" ]
94 "../renderer/media/mock_data_channel_impl.cc",
95 "../renderer/media/mock_data_channel_impl.h",
96 "../renderer/media/mock_media_stream_dispatcher.cc",
97 "../renderer/media/mock_media_stream_dispatcher.h",
98 "../renderer/media/mock_peer_connection_impl.cc",
99 "../renderer/media/mock_peer_connection_impl.h",
100 "../renderer/media/mock_web_rtc_peer_connection_handler_client.cc",
101 "../renderer/media/mock_web_rtc_peer_connection_handler_client.h",
102 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.cc",
103 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.h",
107 "//third_party/libjingle:libjingle_webrtc",
108 "//third_party/libjingle:libpeerconnection",
109 "//third_party/webrtc/modules/video_capture",
112 if (!enable_plugins) {
113 sources -= [ "ppapi_unittest.cc" ]
117 configs += [ "//build/config/linux:glib" ]
122 "//ui/aura:test_support",
123 "//ui/resources:ui_test_pak",
128 if (use_aura || is_mac) {
129 deps += [ "//ui/compositor" ]
133 deps += [ "//ui/ozone" ]
138 "//content:startup_helper_win",
139 "//third_party/iaccessible2",
143 if (!is_android && !is_ios) {
145 "../browser/compositor/test/no_transport_image_transport_factory.cc",
146 "../browser/compositor/test/no_transport_image_transport_factory.h",
150 "//third_party/libvpx",
156 "//content/shell/android:copy_content_shell_assets",
158 "//ui/shell_dialogs",
163 deps += [ "//sandbox" ]
167 "public/test/content_test_suite_base.cc",
168 "public/test/mock_notification_observer.cc",
169 "public/test/mock_resource_context.cc",
170 "public/test/test_browser_thread.cc",
171 "public/test/test_content_client_initializer.cc",
172 "public/test/test_notification_tracker.cc",
173 "public/test/test_utils.cc",
174 "public/test/unittest_test_suite.cc",
175 "test/content_test_suite.cc",
176 "test/test_content_browser_client.cc",
177 "test/test_content_client.cc",
180 if (v8_use_external_startup_data) {
181 deps += [ "//gin:gin" ]
185 source_set("browsertest_support") {
189 "../public/test/content_browser_test.cc",
190 "../public/test/content_browser_test.h",
191 "../public/test/content_browser_test_utils.cc",
192 "../public/test/content_browser_test_utils.h",
193 "../public/test/content_browser_test_utils_mac.mm",
194 "content_browser_test_utils_internal.cc",
195 "content_browser_test_utils_internal.h",
196 "content_test_launcher.cc",
200 "//content/shell:content_shell_lib",
203 "//ui/accessibility:ax_gen",
207 deps += [ "//content/public/app:both" ]
209 deps += [ "//content/public/browser" ]
213 mojom("content_test_mojo_bindings") {
215 "../public/test/test_mojo_service.mojom",
219 mojom("web_ui_test_mojo_bindings") {
221 "data/web_ui_test_mojo_bindings.mojom",
226 # GYP version //content/content_tests.gypi:layouttest_support_content
227 static_library("layouttest_support") {
229 sources = rebase_path(
230 content_tests_gypi_values.layouttest_support_content_sources,
238 "//components/test_runner:test_runner",
239 "//content/public/common",
242 "//ui/accessibility:ax_gen",
251 import("//build/config/android/rules.gni")
253 generate_jni("jni") {
255 "../public/test/android/javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java",
257 jni_package = "content/public/test"
262 # TODO(GYP) enable content_browsertests on Mac when it links.
264 # TODO(GYP): Delete this after we've converted everything to GN.
265 # The _run targets exist only for compatibility w/ GYP.
266 group("content_browsertests_run") {
269 ":content_browsertests",
273 test("content_browsertests") {
275 rebase_path(content_tests_gypi_values.content_browsertests_sources,
279 if (is_android || is_linux || is_mac || is_win) {
283 "//media/test/data/",
287 data += [ "$root_out_dir/content_shell_assets/content_shell.pak" ]
290 "$root_out_dir/content_shell.pak",
291 "//net/tools/testserver/",
292 "//ppapi/tests/test_case.html",
293 "//ppapi/tests/test_page.css",
294 "//third_party/pyftpdlib/",
295 "//third_party/pywebsocket/",
296 "//third_party/tlslite/",
301 "$root_out_dir/Content Shell.app/",
302 "$root_out_dir/plugins/test_netscape_plugin.plugin/",
306 data += [ "$root_out_dir/plugins/np_test_netscape_plugin.dll" ]
311 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
314 "//build/config:precompiled_headers",
315 "//build/config/compiler:no_size_t_to_int_warning",
319 ":browsertest_support",
320 ":web_ui_test_mojo_bindings",
322 "//base/test:test_support",
323 "//content/browser/background_sync:background_sync_proto",
324 "//content/common:mojo_bindings",
326 "//content/public/common",
327 "//content/public/plugin",
328 "//content/public/renderer",
329 "//content:resources",
330 "//content/shell:content_shell_lib",
331 "//content/shell:pak",
332 "//content/test:test_support",
334 "//device/battery:mojo_bindings",
337 "//ipc:test_support",
338 "//media:test_support",
339 "//media/audio:test_support",
340 "//media/base:test_support",
341 "//media:shared_memory_support",
342 "//mojo/application/public/cpp:cpp_for_chromium",
343 "//mojo/environment:chromium",
344 "//mojo/test:test_support",
345 "//net:test_support",
349 "//ppapi/shared_impl",
350 "//third_party/mojo/src/mojo/edk/system",
351 "//third_party/mojo/src/mojo/edk/test:test_support",
352 "//third_party/mojo/src/mojo/public/cpp/bindings",
353 "//third_party/mojo/src/mojo/public/js",
356 "//third_party/WebKit/public:blink",
357 "//third_party/leveldatabase",
358 "//third_party/mesa:osmesa",
359 "//third_party/zlib",
360 "//ui/accessibility",
361 "//ui/accessibility:ax_gen",
367 "//ui/gl:test_support",
369 "//ui/shell_dialogs",
374 "//ppapi:ppapi_tests",
375 "//third_party/mesa:osmesa",
379 sources += rebase_path(
380 content_tests_gypi_values.content_browsertests_win_sources,
385 "//content/app/strings",
386 "//net:net_resources",
387 "//third_party/WebKit/public:resources",
388 "//third_party/iaccessible2",
389 "//third_party/isimpledom",
392 libs = [ "oleacc.lib" ]
397 [ "../browser/accessibility/dump_accessibility_tree_browsertest.cc" ]
401 sources += rebase_path(
402 content_tests_gypi_values.content_browsertests_android_sources,
406 [ "../browser/battery_status/battery_monitor_impl_browsertest.cc" ]
408 "//content/shell/android:content_shell_jni_headers",
409 "//content/shell:content_shell_lib",
410 "//testing/android/native_test:native_test_support",
417 sources += [ "../renderer/external_popup_menu_browsertest.cc" ]
419 # Needed for Content Shell.app's Helper.
420 #"//content/shell:content_shell", #TODO(GYP) enable for mac
424 if (use_aura && !is_win) {
425 deps += [ "//ui/events:test_support" ]
428 if (!use_aura && !is_mac) {
430 [ "../browser/compositor/image_transport_factory_browsertest.cc" ]
434 sources += rebase_path(
435 content_tests_gypi_values.content_browsertests_webrtc_sources,
438 deps += [ "//testing/perf" ]
441 if (enable_plugins) {
442 sources += rebase_path(
443 content_tests_gypi_values.content_browsertests_plugins_sources,
446 data_deps += [ "//ppapi:ppapi_tests" ]
449 if (enable_web_speech) {
450 sources += rebase_path(
451 content_tests_gypi_values.content_browsertests_speech_sources,
456 if (!is_chrome_branded) {
457 sources += rebase_path(
458 content_tests_gypi_values.content_browsertests_unofficial_build_sources,
465 "//ui/touch_selection:test_support",
466 "//ui/touch_selection:touch_selection",
470 "../browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc",
471 "../browser/web_contents/web_contents_view_aura_browsertest.cc",
477 # TODO(GYP): Delete this after we've converted everything to GN.
478 # The _run targets exist only for compatibility w/ GYP.
479 group("content_unittests_run") {
482 ":content_unittests",
486 test("content_unittests") {
487 sources = rebase_path(content_tests_gypi_values.content_unittests_sources,
491 if (is_android || is_linux || is_mac || is_win) {
494 "//net/data/ssl/certificates/",
495 "//media/test/data/",
499 data += [ "$root_out_dir/content_shell_assets/content_shell.pak" ]
501 data += [ "$root_out_dir/content_shell.pak" ]
505 configs += [ "//build/config:precompiled_headers" ]
510 "//base/test:test_support",
511 "//content/browser/background_sync:background_sync_proto",
512 "//content/browser/notifications:notification_proto",
513 "//content/browser/service_worker:service_worker_proto",
514 "//content/browser/speech/proto",
515 "//content/common:mojo_bindings",
516 "//content/public/browser",
517 "//content/public/common",
518 "//content/public/common:mojo_bindings",
521 "//device/battery:mojo_bindings",
522 "//mojo/environment:chromium",
524 "//net:test_support",
527 "//sql:test_support",
530 "//third_party/mojo/src/mojo/edk/test:test_support",
531 "//third_party/mojo/src/mojo/public/cpp/bindings",
533 "//ui/accessibility",
543 "//base/third_party/dynamic_annotations",
547 "//content:resources",
549 "//content/public/browser",
550 "//content/public/child",
551 "//content/public/plugin",
552 "//content/public/renderer",
555 "//gpu:test_support",
556 "//ipc:test_support",
557 "//media:test_support",
558 "//media:shared_memory_support",
559 "//media/audio:test_support",
560 "//media/base:test_support",
564 "//third_party/WebKit/public:blink",
566 "//third_party/leveldatabase",
567 "//third_party/libjingle",
568 "//ui/compositor:test_support",
570 "//ui/gl:test_support",
574 data_deps = [ "//third_party/mesa:osmesa" ]
577 sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ]
580 if (enable_plugins) {
582 rebase_path(content_tests_gypi_values.content_unittests_plugins_sources,
589 rebase_path(content_tests_gypi_values.content_unittests_webrtc_sources,
593 "//third_party/libjingle:libjingle_webrtc",
594 "//third_party/libjingle:libpeerconnection",
595 "//third_party/webrtc/modules/video_capture",
598 if (is_linux || is_mac || is_win) {
600 [ "../browser/media/capture/desktop_capture_device_unittest.cc" ]
601 deps += [ "//third_party/webrtc/modules/desktop_capture" ]
606 [ "../browser/media/capture/desktop_capture_device_aura_unittest.cc" ]
609 if (enable_plugins) {
610 # This file is added only when plugins are enabled, but we don't want it
611 # unless webrtc is also enabled.
613 [ "../renderer/media/webrtc/video_destination_handler_unittest.cc" ]
617 if (enable_web_speech) {
619 rebase_path(content_tests_gypi_values.content_unittests_speech_sources,
626 deps += [ "//dbus:test_support" ]
629 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
633 deps += [ "//third_party/iaccessible2" ]
636 # These flags are needed to run the test on Mac.
637 # Search for comments about "xcode_settings" in chrome_tests.gypi.
638 ldflags = [ "-Wl,-ObjC" ]
640 deps += [ "//third_party/ocmock" ]
643 sources -= [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
644 deps += [ "//chromeos" ]
648 rebase_path(content_tests_gypi_values.content_unittests_android_sources,
652 "../browser/geolocation/network_location_provider_unittest.cc",
653 "../browser/geolocation/wifi_data_provider_common_unittest.cc",
654 "../browser/renderer_host/begin_frame_observer_proxy_unittest.cc",
655 "../browser/webui/url_data_manager_backend_unittest.cc",
657 deps += [ "//testing/android/native_test:native_test_native_code" ]
659 if (!is_android && !is_ios) {
660 deps += [ "//third_party/libvpx" ]
671 "../browser/renderer_host/render_widget_host_view_aura_unittest.cc",
672 "../browser/renderer_host/web_input_event_aura_unittest.cc",
673 "../browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc",
674 "../browser/web_contents/aura/overscroll_window_animation_unittest.cc",
675 "../browser/web_contents/aura/overscroll_window_delegate_unittest.cc",
676 "../browser/web_contents/web_contents_view_aura_unittest.cc",
679 if (use_aura || toolkit_views) {
680 deps += [ "//ui/events:test_support" ]
682 if (!use_aura && !is_mac) {
684 "../browser/compositor/buffer_queue_unittest.cc",
685 "../browser/compositor/reflector_impl_unittest.cc",
686 "../browser/compositor/software_browser_compositor_output_surface_unittest.cc",
690 if (!is_win && !is_mac) {
691 sources -= [ "../common/plugin_list_unittest.cc" ]
697 "//ui/ozone:ozone_base",
701 [ "../browser/compositor/software_output_device_ozone_unittest.cc" ]
704 if (is_mac && use_openssl) {
705 deps += [ "//third_party/boringssl" ]
709 if (!is_mac) { # TODO(GYP) enable on Mac once it links.
710 test("content_perftests") {
712 "../browser/renderer_host/input/input_router_impl_perftest.cc",
713 "../common/cc_messages_perftest.cc",
714 "../test/run_all_perftests.cc",
718 "//base/test:test_support",
719 "//content/public/browser",
720 "//content/public/common",
721 "//content/test:test_support",
731 deps += [ "//testing/android/native_test:native_test_native_code" ]
735 # TODO(GYP): Delete this after we've converted everything to GN.
736 # The _run targets exist only for compatibility w/ GYP.
737 group("content_gl_tests_run") {
744 test("content_gl_tests") {
746 "../common/gpu/client/gl_helper_unittest.cc",
747 "../common/gpu/client/gpu_in_process_context_tests.cc",
753 "//base/test:test_support",
754 "//content/public/common",
756 "//gpu/command_buffer/common",
758 "//third_party/WebKit/public:blink",
761 "//ui/gfx:test_support",
764 "//ui/gl:test_support",
769 deps += [ "//testing/android/native_test:native_test_native_code" ]
772 "//third_party/ffmpeg",
773 "//third_party/mesa:osmesa",
778 test("content_gl_benchmark") {
780 "../common/gpu/client/gl_helper_benchmark.cc",
786 "//base/test:test_support",
787 "//content/public/common",
790 "//third_party/WebKit/public:blink",
795 "//ui/gl:test_support",