Remove unused code calling WebMediaPlayerClient::requestFullscreen()
[chromium-blink-merge.git] / content / test / BUILD.gn
blob83758658afc5d548ef886dfed3104137091115af
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",
15                 [
16                   rebase_path("../content_tests.gypi"),
17                   "--replace=<(SHARED_INTERMEDIATE_DIR)=$root_gen_dir",
18                 ],
19                 "scope",
20                 [ "../content_tests.gypi" ])
22 # GYP version //content/content_tests.gypi:test_support_content
23 source_set("test_support") {
24   testonly = true
25   public_deps = []
26   deps = [
27     "//cc/blink",
28     "//content/public/app:both",
29     "//content/public/browser",
30     "//content/public/common",
31     "//net:test_support",
32     "//skia",
33     "//storage/common",
34     "//testing/gmock",
35     "//testing/gtest",
36     "//ui/accessibility:ax_gen",
37     "//ui/base",
38     "//ui/base/ime",
39     "//ui/base:test_support",
40     "//ui/events:dom_keycode_converter",
41     "//ui/events:events_base",
42     "//ui/events:test_support",
43     "//ui/events:gesture_detection",
44     "//ui/gfx:test_support",
45     "//ui/gl",
46     "//ui/resources",
47     "//url",
48   ]
50   if (!is_ios) {
51     sources =
52         rebase_path(content_tests_gypi_values.test_support_content_sources,
53                     ".",
54                     "//content")
56     public_deps += [ "//third_party/WebKit/public:blink" ]
57     deps += [
58       ":content_test_mojo_bindings",
59       "//components/scheduler:scheduler",
60       "//components/scheduler:test_support",
61       "//content/browser/speech/proto",
62       "//content/public/child",
63       "//content/gpu",
64       "//content/public/plugin",
65       "//content/public/renderer",
66       "//content/public/utility",
67       "//content/shell:pak",
68       "//cc",
69       "//cc:test_support",
70       "//ipc/mojo",
71       "//media",
72       "//mojo/application/public/cpp:cpp_for_chromium",
73       "//mojo/environment:chromium",
74       "//ppapi/host",
75       "//ppapi/proxy",
76       "//ppapi/proxy:test_support",
77       "//ppapi/shared_impl",
78       "//ppapi/shared_impl:test_support",
79       "//storage/browser",
80       "//storage/common",
81       "//ui/surface",
82       "//v8",
83     ]
85     if (enable_plugins) {
86       deps += [ "//content/ppapi_plugin" ]
87     }
89     if (enable_webrtc) {
90       sources += [
91         "../renderer/media/mock_data_channel_impl.cc",
92         "../renderer/media/mock_data_channel_impl.h",
93         "../renderer/media/mock_media_stream_dispatcher.cc",
94         "../renderer/media/mock_media_stream_dispatcher.h",
95         "../renderer/media/mock_peer_connection_impl.cc",
96         "../renderer/media/mock_peer_connection_impl.h",
97         "../renderer/media/mock_web_rtc_peer_connection_handler_client.cc",
98         "../renderer/media/mock_web_rtc_peer_connection_handler_client.h",
99         "../renderer/media/webrtc/mock_peer_connection_dependency_factory.cc",
100         "../renderer/media/webrtc/mock_peer_connection_dependency_factory.h",
101       ]
103       deps += [
104         "//third_party/libjingle:libjingle_webrtc",
105         "//third_party/libjingle:libpeerconnection",
106         "//third_party/webrtc/modules/video_capture",
107       ]
108     }
109     if (!enable_plugins) {
110       sources -= [ "ppapi_unittest.cc" ]
111     }
113     if (use_glib) {
114       configs += [ "//build/config/linux:glib" ]
115     }
117     if (use_aura) {
118       deps += [
119         "//ui/aura:test_support",
120         "//ui/resources:ui_test_pak",
121         "//ui/wm",
122       ]
123     }
125     if (use_aura || is_mac) {
126       deps += [ "//ui/compositor" ]
127     }
129     if (use_ozone) {
130       deps += [ "//ui/ozone" ]
131     }
133     if (is_win) {
134       deps += [
135         "//content:startup_helper_win",
136         "//third_party/iaccessible2",
137       ]
138     }
140     if (!is_android && !is_ios) {
141       sources += [
142         "../browser/compositor/test/no_transport_image_transport_factory.cc",
143         "../browser/compositor/test/no_transport_image_transport_factory.h",
144       ]
145       deps += [
146         "//ui/compositor",
147         "//third_party/libvpx",
148       ]
149     }
151     if (is_android) {
152       deps += [
153         "//ui/android",
154         "//ui/shell_dialogs",
155       ]
156     }
158     if (is_win) {
159       deps += [ "//sandbox" ]
160     }
161   } else {  # is_ios
162     sources = [
163       "public/test/content_test_suite_base.cc",
164       "public/test/mock_notification_observer.cc",
165       "public/test/mock_resource_context.cc",
166       "public/test/test_browser_thread.cc",
167       "public/test/test_content_client_initializer.cc",
168       "public/test/test_notification_tracker.cc",
169       "public/test/test_utils.cc",
170       "public/test/unittest_test_suite.cc",
171       "test/content_test_suite.cc",
172       "test/test_content_browser_client.cc",
173       "test/test_content_client.cc",
174     ]
175   }
176   if (v8_use_external_startup_data) {
177     deps += [ "//gin:gin" ]
178   }
181 source_set("browsertest_support") {
182   testonly = true
184   sources = [
185     "../public/test/content_browser_test.cc",
186     "../public/test/content_browser_test.h",
187     "../public/test/content_browser_test_utils.cc",
188     "../public/test/content_browser_test_utils.h",
189     "../public/test/content_browser_test_utils_mac.mm",
190     "content_test_launcher.cc",
191   ]
193   deps = [
194     "//content/shell:content_shell_lib",
195     "//skia",
196     "//testing/gtest",
197     "//ui/accessibility:ax_gen",
198   ]
200   if (is_android) {
201     deps += [ "//content/public/app:both" ]
202   } else {
203     deps += [ "//content/public/browser" ]
204   }
207 mojom("content_test_mojo_bindings") {
208   sources = [
209     "../public/test/test_mojo_service.mojom",
210   ]
213 mojom("web_ui_test_mojo_bindings") {
214   sources = [
215     "data/web_ui_test_mojo_bindings.mojom",
216   ]
219 if (!is_ios) {
220   # GYP version //content/content_tests.gypi:layouttest_support_content
221   static_library("layouttest_support") {
222     testonly = true
223     sources = rebase_path(
224             content_tests_gypi_values.layouttest_support_content_sources,
225             ".",
226             "//content")
228     deps = [
229       ":test_support",
230       "//cc",
231       "//cc/blink",
232       "//components/test_runner:test_runner",
233       "//content/public/common",
234       "//skia",
235       "//v8",
236       "//ui/accessibility:ax_gen",
237     ]
239     if (is_android) {
240       deps += [ ":jni" ]
241     }
242   }
244   if (is_android) {
245     import("//build/config/android/rules.gni")
247     generate_jni("jni") {
248       sources = [
249         "../public/test/android/javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java",
250       ]
251       jni_package = "content/public/test"
252     }
253   }
254 }  # !is_ios
256 # TODO(GYP) enable content_browsertests on Mac when it links.
257 if (!is_mac) {
258   test("content_browsertests") {
259     sources =
260         rebase_path(content_tests_gypi_values.content_browsertests_sources,
261                     ".",
262                     "//content")
264     defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
266     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
268     deps = [
269       ":browsertest_support",
270       ":web_ui_test_mojo_bindings",
271       "//base/allocator",
272       "//base/test:test_support",
273       "//content/common:mojo_bindings",
274       "//content/gpu",
275       "//content/public/common",
276       "//content/public/plugin",
277       "//content/public/renderer",
278       "//content:resources",
279       "//content/shell:content_shell_lib",
280       "//content/shell:pak",
281       "//content/test:test_support",
282       "//device/battery",
283       "//device/battery:mojo_bindings",
284       "//gin",
285       "//gpu",
286       "//ipc:test_support",
287       "//media:test_support",
288       "//media/audio:test_support",
289       "//media/base:test_support",
290       "//media:shared_memory_support",
291       "//mojo/application/public/cpp:cpp_for_chromium",
292       "//mojo/environment:chromium",
293       "//net:test_support",
294       "//ppapi/host",
295       "//ppapi/proxy",
296       "//ppapi/proxy:ipc",
297       "//ppapi/shared_impl",
298       "//third_party/mojo/src/mojo/edk/system",
299       "//third_party/mojo/src/mojo/edk/test:test_support",
300       "//third_party/mojo/src/mojo/public/cpp/bindings",
301       "//third_party/mojo/src/mojo/public/js",
302       "//testing/gmock",
303       "//testing/gtest",
304       "//third_party/WebKit/public:blink",
305       "//third_party/leveldatabase",
306       "//third_party/mesa:osmesa",
307       "//third_party/zlib",
308       "//ui/accessibility",
309       "//ui/accessibility:ax_gen",
310       "//ui/base",
311       "//ui/base/ime",
312       "//ui/gfx",
313       "//ui/gfx/geometry",
314       "//ui/gl",
315       "//ui/resources",
316       "//ui/shell_dialogs",
317       "//ui/snapshot",
318     ]
320     data_deps = [ "//ppapi:ppapi_tests" ]  # Loaded at runtime.
322     if (!is_chromeos) {
323       sources -=
324           [ "../browser/web_contents/touch_editable_impl_aura_browsertest.cc" ]
325     }
327     if (is_win) {
328       sources += rebase_path(
329               content_tests_gypi_values.content_browsertests_win_sources,
330               ".",
331               "//content")
333       deps += [
334         "//content/app/strings",
335         "//net:net_resources",
336         "//third_party/WebKit/public:resources",
337         "//third_party/iaccessible2",
338         "//third_party/isimpledom",
339       ]
341       libs = [ "oleacc.lib" ]
342     }
344     if (is_linux) {
345       sources -=
346           [ "../browser/accessibility/dump_accessibility_tree_browsertest.cc" ]
347     }
349     if (is_android) {
350       sources += rebase_path(
351               content_tests_gypi_values.content_browsertests_android_sources,
352               ".",
353               "//content")
354       sources -=
355           [ "../browser/battery_status/battery_monitor_impl_browsertest.cc" ]
356       deps += [
357         "//content/shell/android:content_shell_jni_headers",
358         "//content/shell:content_shell_lib",
359         "//testing/android/native_test:native_test_support",
360       ]
362       use_launcher = false
363     }
365     if (is_mac) {
366       sources += [ "../renderer/external_popup_menu_browsertest.cc" ]
367       deps += [
368         # Needed for Content Shell.app's Helper.
369         #"//content/shell:content_shell",  #TODO(GYP) enable for mac
370       ]
371     }
373     if (use_aura && !is_win) {
374       deps += [ "//ui/events:test_support" ]
375     }
377     if (!use_aura && !is_mac) {
378       sources -=
379           [ "../browser/compositor/image_transport_factory_browsertest.cc" ]
380     }
382     if (use_aura && !is_win) {
383       sources -= [ "../browser/plugin_browsertest.cc" ]
384     }
386     if (!is_android && !is_ios && !is_linux) {
387       # Npapi test plugin doesn't build on Android or iOS.
388       #data_deps += [ 'copy_npapi_test_plugin' ]  TODO(GYP)
389     }
391     if (enable_webrtc) {
392       sources += rebase_path(
393               content_tests_gypi_values.content_browsertests_webrtc_sources,
394               ".",
395               "//content")
396       deps += [ "//testing/perf" ]
397     }
399     if (enable_plugins) {
400       sources += rebase_path(
401               content_tests_gypi_values.content_browsertests_plugins_sources,
402               ".",
403               "//content")
404       data_deps += [ "//ppapi:ppapi_tests" ]
405     }
407     if (enable_web_speech) {
408       sources += rebase_path(
409               content_tests_gypi_values.content_browsertests_speech_sources,
410               ".",
411               "//content")
412     }
414     if (!is_chrome_branded) {
415       sources += rebase_path(
416               content_tests_gypi_values.content_browsertests_unofficial_build_sources,
417               ".",
418               "//content")
419     }
421     if (!use_aura) {
422       sources -=
423           [ "../browser/web_contents/web_contents_view_aura_browsertest.cc" ]
424     }
425   }
428 test("content_unittests") {
429   sources = rebase_path(content_tests_gypi_values.content_unittests_sources,
430                         ".",
431                         "//content")
432   deps = [
433     ":test_support",
434     "//base/allocator",
435     "//base/test:test_support",
436     "//content/browser/background_sync:background_sync_proto",
437     "//content/browser/notifications:notification_proto",
438     "//content/browser/service_worker:service_worker_proto",
439     "//content/browser/speech/proto",
440     "//content/common:mojo_bindings",
441     "//content/public/browser",
442     "//content/public/common",
443     "//content/public/common:mojo_bindings",
444     "//crypto",
445     "//device/battery",
446     "//device/battery:mojo_bindings",
447     "//mojo/environment:chromium",
448     "//net:extras",
449     "//net:test_support",
450     "//skia",
451     "//sql",
452     "//sql:test_support",
453     "//testing/gmock",
454     "//testing/gtest",
455     "//third_party/mojo/src/mojo/edk/test:test_support",
456     "//third_party/mojo/src/mojo/public/cpp/bindings",
457     "//third_party/re2",
458     "//ui/accessibility",
459     "//ui/base",
460     "//ui/events/blink",
461     "//ui/gfx",
462     "//ui/gfx/geometry",
463     "//ui/gfx/ipc",
464   ]
466   if (!is_ios) {
467     deps += [
468       "//base/third_party/dynamic_annotations",
469       "//cc",
470       "//cc:test_support",
471       "//cc/surfaces",
472       "//content:resources",
473       "//content/gpu",
474       "//content/public/browser",
475       "//content/public/child",
476       "//content/public/plugin",
477       "//content/public/renderer",
478       "//gin",
479       "//gpu",
480       "//gpu:test_support",
481       "//ipc:test_support",
482       "//media:test_support",
483       "//media:shared_memory_support",
484       "//media/audio:test_support",
485       "//media/base:test_support",
486       "//media/midi:midi",
487       "//storage/browser",
488       "//storage/common",
489       "//third_party/WebKit/public:blink",
490       "//third_party/icu",
491       "//third_party/leveldatabase",
492       "//third_party/libjingle",
493       "//ui/gl",
494     ]
495   }
497   if (!is_win) {
498     sources += [ "../browser/file_descriptor_info_impl_unittest.cc" ]
499   }
501   if (enable_plugins) {
502     sources +=
503         rebase_path(content_tests_gypi_values.content_unittests_plugins_sources,
504                     ".",
505                     "//content")
506   }
508   if (enable_webrtc) {
509     sources +=
510         rebase_path(content_tests_gypi_values.content_unittests_webrtc_sources,
511                     ".",
512                     "//content")
513     deps += [
514       "//third_party/libjingle:libjingle_webrtc",
515       "//third_party/libjingle:libpeerconnection",
516       "//third_party/webrtc/modules/video_capture",
517     ]
519     if (is_linux || is_mac || is_win) {
520       sources +=
521           [ "../browser/media/capture/desktop_capture_device_unittest.cc" ]
522       deps += [ "//third_party/webrtc/modules/desktop_capture" ]
523     }
525     if (is_chromeos) {
526       sources +=
527           [ "../browser/media/capture/desktop_capture_device_aura_unittest.cc" ]
528     }
529   } else {
530     if (enable_plugins) {
531       # This file is added only when plugins are enabled, but we don't want it
532       # unless webrtc is also enabled.
533       sources -=
534           [ "../renderer/media/webrtc/video_destination_handler_unittest.cc" ]
535     }
536   }
538   if (enable_web_speech) {
539     sources +=
540         rebase_path(content_tests_gypi_values.content_unittests_speech_sources,
541                     ".",
542                     "//content")
543   }
545   if (is_linux) {
546     if (use_dbus) {
547       deps += [ "//dbus:test_support" ]
548     } else {
549       sources -=
550           [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
551     }
552   }
553   if (is_win) {
554     deps += [ "//third_party/iaccessible2" ]
555   }
556   if (is_mac) {
557     # These flags are needed to run the test on Mac.
558     # Search for comments about "xcode_settings" in chrome_tests.gypi.
559     ldflags = [ "-Wl,-ObjC" ]
561     deps += [ "//third_party/ocmock" ]
562   }
563   if (is_chromeos) {
564     sources -= [ "../browser/geolocation/wifi_data_provider_linux_unittest.cc" ]
565     deps += [ "//chromeos" ]
566   }
567   if (is_android) {
568     sources +=
569         rebase_path(content_tests_gypi_values.content_unittests_android_sources,
570                     ".",
571                     "//content")
572     sources -= [
573       "../browser/geolocation/network_location_provider_unittest.cc",
574       "../browser/geolocation/wifi_data_provider_common_unittest.cc",
575       "../browser/renderer_host/begin_frame_observer_proxy_unittest.cc",
576       "../browser/webui/url_data_manager_backend_unittest.cc",
577     ]
578     deps += [ "//testing/android/native_test:native_test_native_code" ]
579   }
580   if (!is_android && !is_ios) {
581     deps += [ "//third_party/libvpx" ]
582   }
584   if (use_aura) {
585     deps += [
586       "//ui/aura",
587       "//ui/aura_extra",
588       "//ui/wm",
589     ]
590   } else {
591     sources -= [
592       "../browser/renderer_host/render_widget_host_view_aura_unittest.cc",
593       "../browser/renderer_host/web_input_event_aura_unittest.cc",
594       "../browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc",
595       "../browser/web_contents/aura/overscroll_window_animation_unittest.cc",
596       "../browser/web_contents/aura/overscroll_window_delegate_unittest.cc",
597       "../browser/web_contents/web_contents_view_aura_unittest.cc",
598     ]
599   }
600   if (use_aura || toolkit_views) {
601     deps += [ "//ui/events:test_support" ]
602   }
603   if (!use_aura && !is_mac) {
604     sources -= [
605       "../browser/compositor/buffer_queue_unittest.cc",
606       "../browser/compositor/reflector_impl_unittest.cc",
607       "../browser/compositor/software_browser_compositor_output_surface_unittest.cc",
608     ]
609   }
611   if (!is_win && !is_mac) {
612     sources -= [ "../common/plugin_list_unittest.cc" ]
613   }
615   if (use_ozone) {
616     deps += [
617       "//ui/ozone",
618       "//ui/ozone:ozone_base",
619     ]
620   } else {
621     sources -=
622         [ "../browser/compositor/software_output_device_ozone_unittest.cc" ]
623   }
625   if (is_mac && use_openssl) {
626     deps += [ "//third_party/boringssl" ]
627   }
630 if (!is_mac) {  # TODO(GYP) enable on Mac once it links.
631   test("content_perftests") {
632     sources = [
633       "../browser/renderer_host/input/input_router_impl_perftest.cc",
634       "../common/cc_messages_perftest.cc",
635       "../test/run_all_perftests.cc",
636     ]
637     deps = [
638       "//base/allocator",
639       "//base/test:test_support",
640       "//content/public/browser",
641       "//content/public/common",
642       "//content/test:test_support",
643       "//cc",
644       "//skia",
645       "//testing/gtest",
646       "//testing/perf",
647       "//ui/gfx",
648       "//ui/gfx/geometry",
649     ]
651     if (is_android) {
652       deps += [ "//testing/android/native_test:native_test_native_code" ]
653     }
654   }
656   test("content_gl_tests") {
657     sources = [
658       "../common/gpu/client/gl_helper_unittest.cc",
659       "../common/gpu/client/gpu_in_process_context_tests.cc",
660     ]
662     deps = [
663       ":test_support",
664       "//base/allocator",
665       "//base/test:test_support",
666       "//content/public/common",
667       "//gpu/blink",
668       "//gpu/command_buffer/common",
669       "//testing/gtest",
670       "//third_party/WebKit/public:blink",
671       "//ui/base",
672       "//ui/gfx",
673       "//ui/gfx:test_support",
674       "//ui/gfx/geometry",
675       "//ui/gl",
676       "//v8",
677     ]
679     if (is_android) {
680       deps += [ "//testing/android/native_test:native_test_native_code" ]
681     } else {
682       data_deps = [
683         "//third_party/ffmpeg",
684         "//third_party/mesa:osmesa",
685       ]
686     }
687   }
689   test("content_gl_benchmark") {
690     sources = [
691       "../common/gpu/client/gl_helper_benchmark.cc",
692     ]
694     deps = [
695       ":test_support",
696       "//base/allocator",
697       "//base/test:test_support",
698       "//content/public/common",
699       "//gpu/blink",
700       "//testing/gtest",
701       "//third_party/WebKit/public:blink",
702       "//ui/base",
703       "//ui/gfx",
704       "//ui/gfx/geometry",
705       "//ui/gl",
706     ]
707   }