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("//media/media_options.gni")
11 import("//testing/test.gni")
12 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
14 content_tests_gypi_values =
15 exec_script("//build/gypi_to_gn.py",
17 rebase_path("../content_tests.gypi"),
18 "--replace=<(SHARED_INTERMEDIATE_DIR)=$root_gen_dir",
21 [ "../content_tests.gypi" ])
23 # GYP version //content/content_tests.gypi:test_support_content
24 source_set("test_support") {
26 configs += [ "//build/config:precompiled_headers" ]
28 "//content/public/app:both",
29 "//content/public/browser",
30 "//content/public/common",
39 "//ui/accessibility:ax_gen",
42 "//ui/base:test_support",
43 "//ui/events:dom_keycode_converter",
44 "//ui/events:events_base",
45 "//ui/events:test_support",
46 "//ui/events:gesture_detection",
47 "//ui/gfx:test_support",
49 "//ui/gl:test_support",
56 rebase_path(content_tests_gypi_values.test_support_content_sources,
60 public_deps += [ "//third_party/WebKit/public:blink" ]
62 ":content_test_mojo_bindings",
63 "//components/scheduler:scheduler",
64 "//components/scheduler:test_support",
65 "//content/browser/speech/proto",
66 "//content/public/child",
68 "//content/public/plugin",
69 "//content/public/renderer",
70 "//content/public/utility",
71 "//content/shell:pak",
76 "//mojo/application/public/cpp:cpp_for_chromium",
77 "//mojo/environment:chromium",
80 "//ppapi/proxy:test_support",
81 "//ppapi/shared_impl",
82 "//ppapi/shared_impl:test_support",
90 deps += [ "//content/ppapi_plugin" ]
95 "../renderer/media/mock_data_channel_impl.cc",
96 "../renderer/media/mock_data_channel_impl.h",
97 "../renderer/media/mock_media_stream_dispatcher.cc",
98 "../renderer/media/mock_media_stream_dispatcher.h",
99 "../renderer/media/mock_peer_connection_impl.cc",
100 "../renderer/media/mock_peer_connection_impl.h",
101 "../renderer/media/mock_web_rtc_peer_connection_handler_client.cc",
102 "../renderer/media/mock_web_rtc_peer_connection_handler_client.h",
103 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.cc",
104 "../renderer/media/webrtc/mock_peer_connection_dependency_factory.h",
108 "//third_party/libjingle:libjingle_webrtc",
109 "//third_party/libjingle:libpeerconnection",
110 "//third_party/webrtc/modules/video_capture",
113 if (!enable_plugins) {
114 sources -= [ "ppapi_unittest.cc" ]
118 configs += [ "//build/config/linux:glib" ]
123 "//ui/aura:test_support",
124 "//ui/resources:ui_test_pak",
129 if (use_aura || is_mac) {
130 deps += [ "//ui/compositor" ]
134 deps += [ "//ui/ozone" ]
139 "//content:startup_helper_win",
140 "//third_party/iaccessible2",
144 if (!is_android && !is_ios) {
146 "../browser/compositor/test/no_transport_image_transport_factory.cc",
147 "../browser/compositor/test/no_transport_image_transport_factory.h",
151 "//third_party/libvpx_new",
157 "//content/shell/android:copy_content_shell_assets",
159 "//ui/shell_dialogs",
164 deps += [ "//sandbox" ]
168 "public/test/content_test_suite_base.cc",
169 "public/test/mock_notification_observer.cc",
170 "public/test/mock_resource_context.cc",
171 "public/test/test_browser_thread.cc",
172 "public/test/test_content_client_initializer.cc",
173 "public/test/test_notification_tracker.cc",
174 "public/test/test_utils.cc",
175 "public/test/unittest_test_suite.cc",
176 "test/content_test_suite.cc",
177 "test/test_content_browser_client.cc",
178 "test/test_content_client.cc",
181 if (v8_use_external_startup_data) {
182 deps += [ "//gin:gin" ]
186 source_set("browsertest_support") {
190 "../public/test/content_browser_test.cc",
191 "../public/test/content_browser_test.h",
192 "../public/test/content_browser_test_utils.cc",
193 "../public/test/content_browser_test_utils.h",
194 "../public/test/content_browser_test_utils_mac.mm",
195 "content_browser_test_utils_internal.cc",
196 "content_browser_test_utils_internal.h",
197 "content_test_launcher.cc",
201 "//content/shell:content_shell_lib",
204 "//ui/accessibility:ax_gen",
208 deps += [ "//content/public/app:both" ]
210 deps += [ "//content/public/browser" ]
214 mojom("content_test_mojo_bindings") {
216 "../public/test/test_mojo_service.mojom",
220 mojom("web_ui_test_mojo_bindings") {
222 "data/web_ui_test_mojo_bindings.mojom",
227 # GYP version //content/content_tests.gypi:layouttest_support_content
228 static_library("layouttest_support") {
230 sources = rebase_path(
231 content_tests_gypi_values.layouttest_support_content_sources,
239 "//components/test_runner:test_runner",
240 "//content/public/common",
243 "//ui/accessibility:ax_gen",
252 import("//build/config/android/rules.gni")
254 generate_jni("jni") {
256 "../public/test/android/javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java",
258 jni_package = "content/public/test"
263 # TODO(GYP) enable content_browsertests on Mac when it links.
265 # TODO(GYP): Delete this after we've converted everything to GN.
266 # The _run targets exist only for compatibility w/ GYP.
267 group("content_browsertests_run") {
270 ":content_browsertests",
274 test("content_browsertests") {
276 rebase_path(content_tests_gypi_values.content_browsertests_sources,
280 if (is_android || is_linux || is_mac || is_win) {
284 "//media/test/data/",
288 data += [ "$root_out_dir/content_shell_assets/content_shell.pak" ]
291 "$root_out_dir/content_shell.pak",
292 "//net/tools/testserver/",
293 "//ppapi/tests/test_case.html",
294 "//ppapi/tests/test_page.css",
295 "//third_party/pyftpdlib/",
296 "//third_party/pywebsocket/",
297 "//third_party/tlslite/",
302 "$root_out_dir/Content Shell.app/",
303 "$root_out_dir/plugins/test_netscape_plugin.plugin/",
307 data += [ "$root_out_dir/plugins/np_test_netscape_plugin.dll" ]
312 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
314 if (proprietary_codecs && enable_hevc_demuxing) {
315 defines += [ "ENABLE_HEVC_DEMUXING" ]
319 "//build/config:precompiled_headers",
320 "//build/config/compiler:no_size_t_to_int_warning",
324 ":browsertest_support",
325 ":web_ui_test_mojo_bindings",
327 "//base/test:test_support",
328 "//content/browser/background_sync:background_sync_proto",
329 "//content/common:mojo_bindings",
331 "//content/public/common",
332 "//content/public/plugin",
333 "//content/public/renderer",
334 "//content:resources",
335 "//content/shell:content_shell_lib",
336 "//content/shell:pak",
337 "//content/test:test_support",
339 "//device/battery:mojo_bindings",
342 "//ipc:test_support",
343 "//media:test_support",
344 "//media/audio:test_support",
345 "//media/base:test_support",
346 "//media:shared_memory_support",
347 "//mojo/application/public/cpp:cpp_for_chromium",
348 "//mojo/environment:chromium",
349 "//mojo/test:test_support",
350 "//net:test_support",
354 "//ppapi/shared_impl",
355 "//third_party/mojo/src/mojo/edk/system",
356 "//third_party/mojo/src/mojo/edk/test:test_support",
357 "//third_party/mojo/src/mojo/public/cpp/bindings",
358 "//third_party/mojo/src/mojo/public/js",
361 "//third_party/WebKit/public:blink",
362 "//third_party/leveldatabase",
363 "//third_party/mesa:osmesa",
364 "//third_party/zlib",
365 "//ui/accessibility",
366 "//ui/accessibility:ax_gen",
372 "//ui/gl:test_support",
374 "//ui/shell_dialogs",
379 "//ppapi:ppapi_tests",
380 "//third_party/mesa:osmesa",
384 sources += rebase_path(
385 content_tests_gypi_values.content_browsertests_win_sources,
390 "//content/app/strings",
391 "//net:net_resources",
392 "//third_party/WebKit/public:resources",
393 "//third_party/iaccessible2",
394 "//third_party/isimpledom",
397 libs = [ "oleacc.lib" ]
402 [ "../browser/accessibility/dump_accessibility_tree_browsertest.cc" ]
406 sources += rebase_path(
407 content_tests_gypi_values.content_browsertests_android_sources,
411 [ "../browser/battery_status/battery_monitor_impl_browsertest.cc" ]
412 deps -= [ "//device/battery" ]
414 "//content/shell/android:content_shell_jni_headers",
415 "//content/shell:content_shell_lib",
416 "//testing/android/native_test:native_test_support",
423 sources += [ "../renderer/external_popup_menu_browsertest.cc" ]
425 # Needed for Content Shell.app's Helper.
426 #"//content/shell:content_shell", #TODO(GYP) enable for mac
430 if (use_aura && !is_win) {
431 deps += [ "//ui/events:test_support" ]
434 if (!use_aura && !is_mac) {
436 [ "../browser/compositor/image_transport_factory_browsertest.cc" ]
440 sources += rebase_path(
441 content_tests_gypi_values.content_browsertests_webrtc_sources,
444 deps += [ "//testing/perf" ]
447 if (enable_plugins) {
448 sources += rebase_path(
449 content_tests_gypi_values.content_browsertests_plugins_sources,
452 data_deps += [ "//ppapi:ppapi_tests" ]
455 if (enable_web_speech) {
456 sources += rebase_path(
457 content_tests_gypi_values.content_browsertests_speech_sources,
462 if (!is_chrome_branded) {
463 sources += rebase_path(
464 content_tests_gypi_values.content_browsertests_unofficial_build_sources,
471 "//ui/touch_selection:test_support",
472 "//ui/touch_selection:touch_selection",
476 "../browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc",
477 "../browser/web_contents/web_contents_view_aura_browsertest.cc",
483 # TODO(GYP): Delete this after we've converted everything to GN.
484 # The _run targets exist only for compatibility w/ GYP.
485 group("content_unittests_run") {
488 ":content_unittests",
492 test("content_unittests") {
493 sources = rebase_path(content_tests_gypi_values.content_unittests_sources,
497 if (is_android || is_linux || is_mac || is_win) {
500 "//net/data/ssl/certificates/",
501 "//media/test/data/",
505 data += [ "$root_out_dir/content_shell_assets/content_shell.pak" ]
507 data += [ "$root_out_dir/content_shell.pak" ]
511 configs += [ "//build/config:precompiled_headers" ]
516 "//base/test:test_support",
517 "//content/browser/background_sync:background_sync_proto",
518 "//content/browser/notifications:notification_proto",
519 "//content/browser/service_worker:service_worker_proto",
520 "//content/browser/speech/proto",
521 "//content/common:mojo_bindings",
522 "//content/public/browser",
523 "//content/public/common",
524 "//content/public/common:mojo_bindings",
527 "//device/battery:mojo_bindings",
528 "//mojo/environment:chromium",
530 "//net:test_support",
533 "//sql:test_support",
536 "//third_party/mojo/src/mojo/edk/test:test_support",
537 "//third_party/mojo/src/mojo/public/cpp/bindings",
539 "//ui/accessibility",
549 "//base/third_party/dynamic_annotations",
553 "//content:resources",
555 "//content/public/browser",
556 "//content/public/child",
557 "//content/public/plugin",
558 "//content/public/renderer",
561 "//gpu:test_support",
562 "//ipc:test_support",
563 "//media:test_support",
564 "//media:shared_memory_support",
565 "//media/audio:test_support",
566 "//media/base:test_support",
570 "//third_party/WebKit/public:blink",
572 "//third_party/leveldatabase",
573 "//third_party/libjingle",
574 "//ui/compositor:test_support",
576 "//ui/gl:test_support",
580 data_deps = [ "//third_party/mesa:osmesa" ]
583 sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ]
586 if (enable_plugins) {
588 rebase_path(content_tests_gypi_values.content_unittests_plugins_sources,
595 rebase_path(content_tests_gypi_values.content_unittests_webrtc_sources,
599 "//third_party/libjingle:libjingle_webrtc",
600 "//third_party/libjingle:libpeerconnection",
601 "//third_party/webrtc/modules/video_capture",
604 if (is_linux || is_mac || is_win) {
606 [ "../browser/media/capture/desktop_capture_device_unittest.cc" ]
607 deps += [ "//third_party/webrtc/modules/desktop_capture" ]
612 [ "../browser/media/capture/desktop_capture_device_aura_unittest.cc" ]
616 if (enable_web_speech) {
618 rebase_path(content_tests_gypi_values.content_unittests_speech_sources,
625 deps += [ "//dbus:test_support" ]
628 [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
632 deps += [ "//third_party/iaccessible2" ]
635 # These flags are needed to run the test on Mac.
636 # Search for comments about "xcode_settings" in chrome_tests.gypi.
637 ldflags = [ "-Wl,-ObjC" ]
639 deps += [ "//third_party/ocmock" ]
642 sources -= [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
643 deps += [ "//chromeos" ]
647 rebase_path(content_tests_gypi_values.content_unittests_android_sources,
651 "../browser/geolocation/network_location_provider_unittest.cc",
652 "../browser/geolocation/wifi_data_provider_common_unittest.cc",
653 "../browser/power_usage_monitor_impl_unittest.cc",
654 "../browser/renderer_host/begin_frame_observer_proxy_unittest.cc",
655 "../browser/webui/url_data_manager_backend_unittest.cc",
657 deps -= [ "//device/battery" ]
658 deps += [ "//testing/android/native_test:native_test_native_code" ]
660 if (!is_android && !is_ios) {
661 deps += [ "//third_party/libvpx_new" ]
672 "../browser/renderer_host/render_widget_host_view_aura_unittest.cc",
673 "../browser/renderer_host/web_input_event_aura_unittest.cc",
674 "../browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc",
675 "../browser/web_contents/aura/overscroll_window_animation_unittest.cc",
676 "../browser/web_contents/aura/overscroll_window_delegate_unittest.cc",
677 "../browser/web_contents/web_contents_view_aura_unittest.cc",
680 if (use_aura || toolkit_views) {
681 deps += [ "//ui/events:test_support" ]
683 if (!use_aura && !is_mac) {
685 "../browser/compositor/buffer_queue_unittest.cc",
686 "../browser/compositor/reflector_impl_unittest.cc",
687 "../browser/compositor/software_browser_compositor_output_surface_unittest.cc",
691 if (!is_win && !is_mac) {
692 sources -= [ "../common/plugin_list_unittest.cc" ]
698 "//ui/ozone:ozone_base",
702 [ "../browser/compositor/software_output_device_ozone_unittest.cc" ]
705 if (is_mac && use_openssl) {
706 deps += [ "//third_party/boringssl" ]
710 if (!is_mac) { # TODO(GYP) enable on Mac once it links.
711 test("content_perftests") {
713 "../browser/renderer_host/input/input_router_impl_perftest.cc",
714 "../common/cc_messages_perftest.cc",
715 "../test/run_all_perftests.cc",
719 "//base/test:test_support",
720 "//content/public/browser",
721 "//content/public/common",
722 "//content/test:test_support",
732 deps += [ "//testing/android/native_test:native_test_native_code" ]
736 # TODO(GYP): Delete this after we've converted everything to GN.
737 # The _run targets exist only for compatibility w/ GYP.
738 group("content_gl_tests_run") {
745 test("content_gl_tests") {
747 "../common/gpu/client/gl_helper_unittest.cc",
748 "../common/gpu/client/gpu_in_process_context_tests.cc",
754 "//base/test:test_support",
755 "//content/public/common",
757 "//gpu/command_buffer/common",
759 "//third_party/WebKit/public:blink",
762 "//ui/gfx:test_support",
765 "//ui/gl:test_support",
770 deps += [ "//testing/android/native_test:native_test_native_code" ]
773 "//third_party/ffmpeg",
774 "//third_party/mesa:osmesa",
779 test("content_gl_benchmark") {
781 "../common/gpu/client/gl_helper_benchmark.cc",
787 "//base/test:test_support",
788 "//content/public/common",
791 "//third_party/WebKit/public:blink",
796 "//ui/gl:test_support",