[DevTools] Remove forwarded connections counting
[chromium-blink-merge.git] / content / shell / BUILD.gn
blob08a5e56c013daa498de2c0b1ebe8901f739a0968
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/features.gni")
6 import("//build/config/ui.gni")
7 import("//tools/grit/repack.gni")
8 import("//tools/grit/grit_rule.gni")
9 if (is_android) {
10   import("//build/config/android/config.gni")
13 declare_args() {
14   content_shell_product_name = "Content Shell"
16   # The "19" is so that sites that sniff for version think that this is
17   # something reasonably current; the "77.34.5" is a hint that this isn't a
18   # standard Chrome.
19   content_shell_version = "19.77.34.5"
22 static_library("content_shell_lib") {
23   testonly = true
24   sources = [
25     "android/shell_jni_registrar.cc",
26     "android/shell_jni_registrar.h",
27     "android/shell_manager.cc",
28     "android/shell_manager.h",
29     "app/blink_test_platform_support.h",
30     "app/blink_test_platform_support_android.cc",
31     "app/blink_test_platform_support_linux.cc",
32     "app/blink_test_platform_support_mac.mm",
33     "app/blink_test_platform_support_win.cc",
34     "app/paths_mac.h",
35     "app/paths_mac.mm",
36     "app/shell_crash_reporter_client.cc",
37     "app/shell_crash_reporter_client.h",
38     "app/shell_main_delegate.cc",
39     "app/shell_main_delegate.h",
40     "app/shell_main_delegate_mac.h",
41     "app/shell_main_delegate_mac.mm",
42     "browser/ipc_echo_message_filter.cc",
43     "browser/ipc_echo_message_filter.h",
44     "browser/layout_test/layout_test_android.cc",
45     "browser/layout_test/layout_test_android.h",
46     "browser/layout_test/layout_test_browser_context.cc",
47     "browser/layout_test/layout_test_browser_context.h",
48     "browser/layout_test/layout_test_browser_main.cc",
49     "browser/layout_test/layout_test_browser_main.h",
50     "browser/layout_test/layout_test_browser_main_parts.cc",
51     "browser/layout_test/layout_test_browser_main_parts.h",
52     "browser/layout_test/layout_test_content_browser_client.cc",
53     "browser/layout_test/layout_test_content_browser_client.h",
54     "browser/layout_test/layout_test_devtools_frontend.cc",
55     "browser/layout_test/layout_test_devtools_frontend.h",
56     "browser/layout_test/layout_test_download_manager_delegate.cc",
57     "browser/layout_test/layout_test_download_manager_delegate.h",
58     "browser/layout_test/layout_test_javascript_dialog_manager.cc",
59     "browser/layout_test/layout_test_javascript_dialog_manager.h",
60     "browser/layout_test/layout_test_message_filter.cc",
61     "browser/layout_test/layout_test_message_filter.h",
62     "browser/layout_test/layout_test_navigator_connect_service_factory.cc",
63     "browser/layout_test/layout_test_navigator_connect_service_factory.h",
64     "browser/layout_test/layout_test_notification_manager.cc",
65     "browser/layout_test/layout_test_notification_manager.h",
66     "browser/layout_test/layout_test_permission_manager.cc",
67     "browser/layout_test/layout_test_permission_manager.h",
68     "browser/layout_test/layout_test_push_messaging_service.cc",
69     "browser/layout_test/layout_test_push_messaging_service.h",
70     "browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc",
71     "browser/layout_test/layout_test_resource_dispatcher_host_delegate.h",
72     "browser/layout_test/layout_test_url_request_context_getter.cc",
73     "browser/layout_test/layout_test_url_request_context_getter.h",
74     "browser/notify_done_forwarder.cc",
75     "browser/notify_done_forwarder.h",
76     "browser/shell.cc",
77     "browser/shell.h",
78     "browser/shell_access_token_store.cc",
79     "browser/shell_access_token_store.h",
80     "browser/shell_android.cc",
81     "browser/shell_application_mac.h",
82     "browser/shell_application_mac.mm",
83     "browser/shell_browser_context.cc",
84     "browser/shell_browser_context.h",
85     "browser/shell_browser_main.cc",
86     "browser/shell_browser_main.h",
87     "browser/shell_browser_main_parts.cc",
88     "browser/shell_browser_main_parts.h",
89     "browser/shell_browser_main_parts_mac.mm",
90     "browser/shell_content_browser_client.cc",
91     "browser/shell_content_browser_client.h",
92     "browser/shell_devtools_frontend.cc",
93     "browser/shell_devtools_frontend.h",
94     "browser/shell_devtools_manager_delegate.cc",
95     "browser/shell_devtools_manager_delegate.h",
96     "browser/shell_download_manager_delegate.cc",
97     "browser/shell_download_manager_delegate.h",
98     "browser/shell_javascript_dialog.h",
99     "browser/shell_javascript_dialog_mac.mm",
100     "browser/shell_javascript_dialog_manager.cc",
101     "browser/shell_javascript_dialog_manager.h",
102     "browser/shell_javascript_dialog_win.cc",
103     "browser/shell_login_dialog.cc",
104     "browser/shell_login_dialog.h",
105     "browser/shell_login_dialog_mac.mm",
106     "browser/shell_mac.mm",
107     "browser/shell_mojo_test_utils_android.cc",
108     "browser/shell_mojo_test_utils_android.h",
109     "browser/shell_net_log.cc",
110     "browser/shell_net_log.h",
111     "browser/shell_network_delegate.cc",
112     "browser/shell_network_delegate.h",
113     "browser/shell_permission_manager.cc",
114     "browser/shell_permission_manager.h",
115     "browser/shell_platform_data_aura.cc",
116     "browser/shell_platform_data_aura.h",
117     "browser/shell_plugin_service_filter.cc",
118     "browser/shell_plugin_service_filter.h",
119     "browser/shell_quota_permission_context.cc",
120     "browser/shell_quota_permission_context.h",
121     "browser/shell_resource_dispatcher_host_delegate.cc",
122     "browser/shell_resource_dispatcher_host_delegate.h",
123     "browser/shell_speech_recognition_manager_delegate.cc",
124     "browser/shell_speech_recognition_manager_delegate.h",
125     "browser/shell_url_request_context_getter.cc",
126     "browser/shell_url_request_context_getter.h",
127     "browser/shell_web_contents_view_delegate.h",
128     "browser/shell_web_contents_view_delegate_android.cc",
129     "browser/shell_web_contents_view_delegate_creator.h",
130     "browser/shell_web_contents_view_delegate_mac.mm",
131     "browser/shell_web_contents_view_delegate_win.cc",
132     "browser/webkit_test_controller.cc",
133     "browser/webkit_test_controller.h",
134     "common/layout_test/layout_test_messages.cc",
135     "common/layout_test/layout_test_messages.h",
136     "common/leak_detection_result.h",
137     "common/shell_content_client.cc",
138     "common/shell_content_client.h",
139     "common/shell_messages.cc",
140     "common/shell_messages.h",
141     "common/shell_switches.cc",
142     "common/shell_switches.h",
143     "common/shell_test_configuration.cc",
144     "common/shell_test_configuration.h",
145     "common/test_runner/test_preferences.cc",
146     "common/test_runner/test_preferences.h",
147     "common/webkit_test_helpers.cc",
148     "common/webkit_test_helpers.h",
149     "renderer/ipc_echo.cc",
150     "renderer/ipc_echo.h",
151     "renderer/layout_test/gc_controller.cc",
152     "renderer/layout_test/gc_controller.h",
153     "renderer/layout_test/layout_test_content_renderer_client.cc",
154     "renderer/layout_test/layout_test_content_renderer_client.h",
155     "renderer/layout_test/layout_test_render_frame_observer.cc",
156     "renderer/layout_test/layout_test_render_frame_observer.h",
157     "renderer/layout_test/layout_test_render_process_observer.cc",
158     "renderer/layout_test/layout_test_render_process_observer.h",
159     "renderer/layout_test/leak_detector.cc",
160     "renderer/layout_test/leak_detector.h",
161     "renderer/layout_test/webkit_test_runner.cc",
162     "renderer/layout_test/webkit_test_runner.h",
163     "renderer/shell_content_renderer_client.cc",
164     "renderer/shell_content_renderer_client.h",
165     "renderer/shell_render_view_observer.cc",
166     "renderer/shell_render_view_observer.h",
167     "renderer/test_runner/accessibility_controller.cc",
168     "renderer/test_runner/accessibility_controller.h",
169     "renderer/test_runner/event_sender.cc",
170     "renderer/test_runner/event_sender.h",
171     "renderer/test_runner/gamepad_controller.cc",
172     "renderer/test_runner/gamepad_controller.h",
173     "renderer/test_runner/mock_color_chooser.cc",
174     "renderer/test_runner/mock_color_chooser.h",
175     "renderer/test_runner/mock_constraints.cc",
176     "renderer/test_runner/mock_constraints.h",
177     "renderer/test_runner/mock_credential_manager_client.cc",
178     "renderer/test_runner/mock_credential_manager_client.h",
179     "renderer/test_runner/mock_grammar_check.cc",
180     "renderer/test_runner/mock_grammar_check.h",
181     "renderer/test_runner/mock_screen_orientation_client.cc",
182     "renderer/test_runner/mock_screen_orientation_client.h",
183     "renderer/test_runner/mock_spell_check.cc",
184     "renderer/test_runner/mock_spell_check.h",
185     "renderer/test_runner/mock_web_audio_device.cc",
186     "renderer/test_runner/mock_web_audio_device.h",
187     "renderer/test_runner/mock_web_media_stream_center.cc",
188     "renderer/test_runner/mock_web_media_stream_center.h",
189     "renderer/test_runner/mock_web_midi_accessor.cc",
190     "renderer/test_runner/mock_web_midi_accessor.h",
191     "renderer/test_runner/mock_web_speech_recognizer.cc",
192     "renderer/test_runner/mock_web_speech_recognizer.h",
193     "renderer/test_runner/mock_web_theme_engine.cc",
194     "renderer/test_runner/mock_web_theme_engine.h",
195     "renderer/test_runner/mock_web_user_media_client.cc",
196     "renderer/test_runner/mock_web_user_media_client.h",
197     "renderer/test_runner/mock_webrtc_data_channel_handler.cc",
198     "renderer/test_runner/mock_webrtc_data_channel_handler.h",
199     "renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc",
200     "renderer/test_runner/mock_webrtc_dtmf_sender_handler.h",
201     "renderer/test_runner/mock_webrtc_peer_connection_handler.cc",
202     "renderer/test_runner/mock_webrtc_peer_connection_handler.h",
203     "renderer/test_runner/spell_check_client.cc",
204     "renderer/test_runner/spell_check_client.h",
205     "renderer/test_runner/test_common.cc",
206     "renderer/test_runner/test_common.h",
207     "renderer/test_runner/test_interfaces.cc",
208     "renderer/test_runner/test_interfaces.h",
209     "renderer/test_runner/test_plugin.cc",
210     "renderer/test_runner/test_plugin.h",
211     "renderer/test_runner/test_runner.cc",
212     "renderer/test_runner/test_runner.h",
213     "renderer/test_runner/text_input_controller.cc",
214     "renderer/test_runner/text_input_controller.h",
215     "renderer/test_runner/web_ax_object_proxy.cc",
216     "renderer/test_runner/web_ax_object_proxy.h",
217     "renderer/test_runner/web_content_settings.cc",
218     "renderer/test_runner/web_content_settings.h",
219     "renderer/test_runner/web_frame_test_proxy.h",
220     "renderer/test_runner/web_task.cc",
221     "renderer/test_runner/web_task.h",
222     "renderer/test_runner/web_test_delegate.h",
223     "renderer/test_runner/web_test_interfaces.cc",
224     "renderer/test_runner/web_test_interfaces.h",
225     "renderer/test_runner/web_test_proxy.cc",
226     "renderer/test_runner/web_test_proxy.h",
227     "renderer/test_runner/web_test_runner.h",
228   ]
230   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
231   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
233   defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ]
235   public_deps = [
236     # This exposes all public content APIs.
237     "//content/public/app:both",
238     "//content/public/browser",
239     "//content/public/common",
240     "//content/public/plugin",
241     "//content/public/renderer",
242     "//content/public/utility",
243   ]
244   deps = [
245     ":resources",
246     "//base",
247     "//base:base_static",
248     "//base/allocator",
249     "//base/third_party/dynamic_annotations",
250     "//cc",
251     "//components/crash/app",
252     "//components/devtools_discovery",
253     "//components/devtools_http_handler",
254     "//components/web_cache/renderer",
255     "//content:resources",
256     "//content/app/resources",
257     "//content/app/strings",
258     "//content/gpu",
259     "//content/test:layouttest_support",
260     "//gin",
261     "//gpu",
262     "//ipc",
263     "//media",
264     "//net",
265     "//net:net_resources",
266     "//skia",
267     "//storage/browser",
268     "//third_party/WebKit/public:blink",
269     "//third_party/WebKit/public:image_resources",
270     "//third_party/WebKit/public:resources",
271     "//third_party/WebKit/public:test_support",
272     "//third_party/icu",
273     "//ui/base",
274     "//ui/base/ime",
275     "//ui/events:events_base",
276     "//ui/gfx",
277     "//ui/gfx/geometry",
278     "//ui/gfx/ipc",
279     "//ui/gl",
280     "//url",
281     "//v8",
283     #'copy_test_netscape_plugin',  TODO(GYP)
284   ]
285   if (enable_plugins) {
286     deps += [ "//content/ppapi_plugin" ]
287   }
289   if (is_win) {
290     #'LinkIncremental': '<(msvs_large_module_debug_link_mode)',  TODO(GYP)
291     sources += [
292       "common/v8_breakpad_support_win.cc",
293       "common/v8_breakpad_support_win.h",
294     ]
295   }
297   if (is_linux) {
298     configs += [ "//build/config/linux:fontconfig" ]
299   }
301   if (use_x11) {
302     # Some tests rely on this tool at runtime. Note: it might be better if
303     # the tests that needed it had this as a dep instead of adding it here.
304     datadeps = [
305       "//tools/xdisplaycheck",
306     ]
308     deps += [ "//ui/events/devices" ]
309   }
311   if (is_android) {
312     deps += [ "//content/shell/android:content_shell_jni_headers" ]
313     #deps -= [ "copy_test_netscape_plugin" ]  TODO(GYP)
314   }
316   if (is_posix && !is_mac) {
317     deps += [ "//components/crash/browser" ]
318   }
320   if (use_aura) {
321     deps += [
322       "//ui/aura",
323       "//ui/aura:test_support",
324       "//ui/events",
325       "//ui/strings",
326       "//ui/wm",
327     ]
329     if (toolkit_views) {
330       sources += [ "browser/shell_views.cc" ]
331       deps += [
332         "//ui/resources",
333         "//ui/views/controls/webview",
334         "//ui/views",
335         "//ui/views:test_support",
336       ]
337     } else {
338       sources += [ "browser/shell_aura.cc" ]
339     }
340   } else {
341     sources -= [
342       "browser/shell_platform_data_aura.cc",
343       "browser/shell_platform_data_aura.h",
344     ]
345   }
347   # The test plugin relies on X11.
348   if (is_linux && !use_x11) {
349     #deps -= [ 'copy_test_netscape_plugin' ]  TODO(GYP)
350   }
352   if (is_chromeos) {
353     deps += [
354       "//chromeos",
355       "//ui/wm:test_support",
356     ]
357   }
359   if (is_linux) {
360     deps += [ "//third_party/freetype2" ]
361   }
363   if (!enable_plugins) {
364     sources -= [
365       "browser/shell_plugin_service_filter.cc",
366       "browser/shell_plugin_service_filter.h",
367     ]
368   }
371 grit("content_shell_resources_grit") {
372   visibility = [ ":*" ]
373   source = "shell_resources.grd"
374   outputs = [
375     "grit/shell_resources.h",
376     "shell_resources.pak",
377     "shell_resources.rc",
378   ]
381 copy("copy_shell_resources") {
382   sources = [
383     "$target_gen_dir/shell_resources.pak",
384   ]
385   outputs = [
386     "$root_out_dir/shell_resources.pak",
387   ]
389   public_deps = [
390     ":content_shell_resources_grit",
391   ]
394 # Font copies.
395 if (!is_mac) {
396   copy("copy_ahem") {
397     visibility = [ ":*" ]
398     sources = [
399       "renderer/test_runner/resources/fonts/AHEM____.TTF",
400     ]
401     outputs = [
402       "$root_out_dir/AHEM____.TTF",
403     ]
404   }
406 if (use_x11) {
407   copy("copy_x11_fonts") {
408     visibility = [ ":*" ]
409     sources = [
410       "//third_party/gardiner_mod/GardinerModBug.ttf",
411       "//third_party/gardiner_mod/GardinerModCat.ttf",
412       "renderer/test_runner/resources/fonts/fonts.conf",
413     ]
414     outputs = [
415       "$root_out_dir/{{source_file_part}}",
416     ]
417   }
419 if (is_android) {
420   copy("copy_android_fonts") {
421     visibility = [ ":*" ]
422     sources = [
423       "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
424       "renderer/test_runner/resources/fonts/android_main_fonts.xml",
425     ]
426     outputs = [
427       "$root_out_dir/{{source_file_part}}",
428     ]
429   }
432 group("resources") {
433   public_deps = [
434     ":copy_shell_resources",
435   ]
436   deps = []
438   if (is_mac) {
439     # TODO(GYP) Mac bundle resources.
440     #'all_dependent_settings': {
441     #  'mac_bundle_resources': [
442     #    'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
443     #    'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
444     #    '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
445     #    '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
446     #  ],
447     #},
448   } else {
449     deps += [ ":copy_ahem" ]
450   }
452   if (use_x11) {
453     deps += [ ":copy_x11_fonts" ]
454   }
455   if (is_android) {
456     deps += [ ":copy_android_fonts" ]
457   }
460 repack("pak") {
461   sources = [
462     "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
463     "$root_gen_dir/blink/public/resources/blink_resources.pak",
464     "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
465     "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
466     "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
467     "$root_gen_dir/content/content_resources.pak",
468     "$root_gen_dir/content/shell/shell_resources.pak",
469     "$root_gen_dir/net/net_resources.pak",
470     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
471     "$root_gen_dir/ui/resources/webui_resources.pak",
472     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
473     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
474   ]
476   deps = [
477     ":resources",
478     "//content:resources",
479     "//content/app/resources",
480     "//content/app/strings",
481     "//content/browser/tracing:resources",
482     "//net:net_resources",
483     "//third_party/WebKit/public:image_resources",
484     "//third_party/WebKit/public:resources",
485     "//ui/resources",
486     "//ui/strings",
487   ]
489   sources += [ "$root_gen_dir/blink/devtools_resources.pak" ]
490   deps += [ "//content/browser/devtools:resources" ]
491   output = "$root_out_dir/content_shell.pak"
494 # TODO(GYP): Figure out what this should be on android
495 # and make linking this work on the Mac.
496 if (!is_android && !is_mac) {
497   executable("content_shell") {
498     testonly = true
500     # TODO(GYP) mac resource bundle stuff for this target.
501     # TODO(GYP) Windows content shell settings:
502     #  - Manifest.
503     #  - RC file.
504     #  - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
505     sources = [
506       "app/shell_main.cc",
507     ]
509     deps = [
510       ":content_shell_lib",
511       ":pak",
512       "//base/allocator",
513     ]
515     if (is_win) {
516       deps += [ "//sandbox" ]
517       if (!is_asan) {
518         configs -= [ "//build/config/win:console" ]
519         configs += [ "//build/config/win:windowed" ]
520       }
521     }
523     if (is_mac) {
524       # TODO(GYP) lots of stuff from GYP file here.
525     }
527     if (is_android) {
528       # Some tests rely on this tool. It might be nicer if these tests relied on
529       # image diff rather than having content shell depend on it.
530       datadeps = [
531         "//tools/imagediff($host_toolchain)",
532       ]
533     }
534   }
535 } else {
536   group("content_shell") {
537   }