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")
10 import("//build/config/android/config.gni")
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
19 content_shell_version = "19.77.34.5"
22 static_library("content_shell_lib") {
25 "android/shell_jni_registrar.cc",
26 "android/shell_jni_registrar.h",
27 "android/shell_manager.cc",
28 "android/shell_manager.h",
31 "app/shell_crash_reporter_client.cc",
32 "app/shell_crash_reporter_client.h",
33 "app/shell_main_delegate.cc",
34 "app/shell_main_delegate.h",
35 "app/shell_main_delegate_mac.h",
36 "app/shell_main_delegate_mac.mm",
37 "app/webkit_test_platform_support_android.cc",
38 "app/webkit_test_platform_support.h",
39 "app/webkit_test_platform_support_linux.cc",
40 "app/webkit_test_platform_support_mac.mm",
41 "app/webkit_test_platform_support_win.cc",
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_devtools_frontend.cc",
53 "browser/layout_test/layout_test_devtools_frontend.h",
54 "browser/layout_test/layout_test_download_manager_delegate.cc",
55 "browser/layout_test/layout_test_download_manager_delegate.h",
56 "browser/layout_test/layout_test_javascript_dialog_manager.cc",
57 "browser/layout_test/layout_test_javascript_dialog_manager.h",
58 "browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc",
59 "browser/layout_test/layout_test_resource_dispatcher_host_delegate.h",
60 "browser/layout_test/layout_test_url_request_context_getter.cc",
61 "browser/layout_test/layout_test_url_request_context_getter.h",
62 "browser/notify_done_forwarder.cc",
63 "browser/notify_done_forwarder.h",
64 "browser/shell_android.cc",
65 "browser/shell_application_mac.h",
66 "browser/shell_application_mac.mm",
67 "browser/shell_browser_context.cc",
68 "browser/shell_browser_context.h",
69 "browser/shell_browser_main.cc",
70 "browser/shell_browser_main.h",
71 "browser/shell_browser_main_parts.cc",
72 "browser/shell_browser_main_parts.h",
73 "browser/shell_browser_main_parts_mac.mm",
75 "browser/shell_content_browser_client.cc",
76 "browser/shell_content_browser_client.h",
77 "browser/shell_devtools_delegate.cc",
78 "browser/shell_devtools_delegate.h",
79 "browser/shell_devtools_frontend.cc",
80 "browser/shell_devtools_frontend.h",
81 "browser/shell_download_manager_delegate.cc",
82 "browser/shell_download_manager_delegate.h",
84 "browser/shell_javascript_dialog.h",
85 "browser/shell_javascript_dialog_mac.mm",
86 "browser/shell_javascript_dialog_manager.cc",
87 "browser/shell_javascript_dialog_manager.h",
88 "browser/shell_javascript_dialog_win.cc",
89 "browser/shell_mojo_test_utils_android.cc",
90 "browser/shell_mojo_test_utils_android.h",
91 "browser/shell_login_dialog.cc",
92 "browser/shell_login_dialog.h",
93 "browser/shell_login_dialog_mac.mm",
94 "browser/shell_mac.mm",
95 "browser/shell_message_filter.cc",
96 "browser/shell_message_filter.h",
97 "browser/shell_net_log.cc",
98 "browser/shell_net_log.h",
99 "browser/shell_network_delegate.cc",
100 "browser/shell_network_delegate.h",
101 "browser/shell_notification_manager.cc",
102 "browser/shell_notification_manager.h",
103 "browser/shell_platform_data_aura.cc",
104 "browser/shell_platform_data_aura.h",
105 "browser/shell_plugin_service_filter.cc",
106 "browser/shell_plugin_service_filter.h",
107 "browser/shell_quota_permission_context.cc",
108 "browser/shell_quota_permission_context.h",
109 "browser/shell_resource_dispatcher_host_delegate.cc",
110 "browser/shell_resource_dispatcher_host_delegate.h",
111 "browser/shell_speech_recognition_manager_delegate.cc",
112 "browser/shell_speech_recognition_manager_delegate.h",
113 "browser/shell_url_request_context_getter.cc",
114 "browser/shell_url_request_context_getter.h",
115 "browser/shell_web_contents_view_delegate_android.cc",
116 "browser/shell_web_contents_view_delegate_creator.h",
117 "browser/shell_web_contents_view_delegate.h",
118 "browser/shell_web_contents_view_delegate_mac.mm",
119 "browser/shell_web_contents_view_delegate_win.cc",
120 "browser/webkit_test_controller.cc",
121 "browser/webkit_test_controller.h",
122 "common/leak_detection_result.h",
123 "common/shell_content_client.cc",
124 "common/shell_content_client.h",
125 "common/shell_messages.cc",
126 "common/shell_messages.h",
127 "common/shell_switches.cc",
128 "common/shell_switches.h",
129 "common/shell_test_configuration.cc",
130 "common/shell_test_configuration.h",
131 "common/test_runner/test_preferences.cc",
132 "common/test_runner/test_preferences.h",
133 "common/webkit_test_helpers.cc",
134 "common/webkit_test_helpers.h",
135 "geolocation/shell_access_token_store.cc",
136 "geolocation/shell_access_token_store.h",
137 "renderer/ipc_echo.cc",
138 "renderer/ipc_echo.h",
139 "renderer/layout_test/gc_controller.cc",
140 "renderer/layout_test/gc_controller.h",
141 "renderer/layout_test/layout_test_content_renderer_client.cc",
142 "renderer/layout_test/layout_test_content_renderer_client.h",
143 "renderer/layout_test/layout_test_render_frame_observer.cc",
144 "renderer/layout_test/layout_test_render_frame_observer.h",
145 "renderer/layout_test/layout_test_render_process_observer.cc",
146 "renderer/layout_test/layout_test_render_process_observer.h",
147 "renderer/layout_test/leak_detector.cc",
148 "renderer/layout_test/leak_detector.h",
149 "renderer/layout_test/webkit_test_runner.cc",
150 "renderer/layout_test/webkit_test_runner.h",
151 "renderer/shell_content_renderer_client.cc",
152 "renderer/shell_content_renderer_client.h",
153 "renderer/shell_render_view_observer.cc",
154 "renderer/shell_render_view_observer.h",
155 "renderer/test_runner/accessibility_controller.cc",
156 "renderer/test_runner/accessibility_controller.h",
157 "renderer/test_runner/event_sender.cc",
158 "renderer/test_runner/event_sender.h",
159 "renderer/test_runner/gamepad_controller.cc",
160 "renderer/test_runner/gamepad_controller.h",
161 "renderer/test_runner/mock_color_chooser.cc",
162 "renderer/test_runner/mock_color_chooser.h",
163 "renderer/test_runner/mock_constraints.cc",
164 "renderer/test_runner/mock_constraints.h",
165 "renderer/test_runner/mock_credential_manager_client.cc",
166 "renderer/test_runner/mock_credential_manager_client.h",
167 "renderer/test_runner/mock_grammar_check.cc",
168 "renderer/test_runner/mock_grammar_check.h",
169 "renderer/test_runner/mock_screen_orientation_client.cc",
170 "renderer/test_runner/mock_screen_orientation_client.h",
171 "renderer/test_runner/mock_spell_check.cc",
172 "renderer/test_runner/mock_spell_check.h",
173 "renderer/test_runner/mock_web_audio_device.cc",
174 "renderer/test_runner/mock_web_audio_device.h",
175 "renderer/test_runner/mock_web_media_stream_center.cc",
176 "renderer/test_runner/mock_web_media_stream_center.h",
177 "renderer/test_runner/mock_web_midi_accessor.cc",
178 "renderer/test_runner/mock_web_midi_accessor.h",
179 "renderer/test_runner/mock_web_push_client.cc",
180 "renderer/test_runner/mock_web_push_client.h",
181 "renderer/test_runner/mock_web_speech_recognizer.cc",
182 "renderer/test_runner/mock_web_speech_recognizer.h",
183 "renderer/test_runner/mock_web_theme_engine.cc",
184 "renderer/test_runner/mock_web_theme_engine.h",
185 "renderer/test_runner/mock_web_user_media_client.cc",
186 "renderer/test_runner/mock_web_user_media_client.h",
187 "renderer/test_runner/mock_webrtc_data_channel_handler.cc",
188 "renderer/test_runner/mock_webrtc_data_channel_handler.h",
189 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc",
190 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.h",
191 "renderer/test_runner/mock_webrtc_peer_connection_handler.cc",
192 "renderer/test_runner/mock_webrtc_peer_connection_handler.h",
193 "renderer/test_runner/notification_presenter.cc",
194 "renderer/test_runner/notification_presenter.h",
195 "renderer/test_runner/spell_check_client.cc",
196 "renderer/test_runner/spell_check_client.h",
197 "renderer/test_runner/test_common.cc",
198 "renderer/test_runner/test_common.h",
199 "renderer/test_runner/test_interfaces.cc",
200 "renderer/test_runner/test_interfaces.h",
201 "renderer/test_runner/test_plugin.cc",
202 "renderer/test_runner/test_plugin.h",
203 "renderer/test_runner/test_runner.cc",
204 "renderer/test_runner/test_runner.h",
205 "renderer/test_runner/text_input_controller.cc",
206 "renderer/test_runner/text_input_controller.h",
207 "renderer/test_runner/web_ax_object_proxy.cc",
208 "renderer/test_runner/web_ax_object_proxy.h",
209 "renderer/test_runner/web_frame_test_proxy.h",
210 "renderer/test_runner/web_permissions.cc",
211 "renderer/test_runner/web_permissions.h",
212 "renderer/test_runner/web_task.cc",
213 "renderer/test_runner/web_task.h",
214 "renderer/test_runner/web_test_delegate.h",
215 "renderer/test_runner/web_test_interfaces.cc",
216 "renderer/test_runner/web_test_interfaces.h",
217 "renderer/test_runner/web_test_proxy.cc",
218 "renderer/test_runner/web_test_proxy.h",
219 "renderer/test_runner/web_test_runner.h",
222 defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ]
225 # This exposes all public content APIs.
226 "//content/public/app:both",
227 "//content/public/browser",
228 "//content/public/common",
229 "//content/public/plugin",
230 "//content/public/renderer",
231 "//content/public/utility",
236 "//base:base_static",
238 "//base/third_party/dynamic_annotations",
240 "//components/crash/app",
241 "//components/web_cache/renderer",
242 "//content:resources",
243 "//content/app/resources",
244 "//content/app/strings",
246 "//content/test:layouttest_support",
252 "//net:net_resources",
255 "//third_party/WebKit/public:blink",
256 "//third_party/WebKit/public:resources",
257 "//third_party/WebKit/public:test_support",
260 "//ui/events:events_base",
267 #'copy_test_netscape_plugin', TODO(GYP)
269 if (enable_plugins) {
270 deps += [ "//content/ppapi_plugin" ]
274 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP)
276 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
277 cflags = [ "/wd4267" ]
281 configs += [ "//build/config/linux:fontconfig" ]
285 # Some tests rely on this tool at runtime. Note: it might be better if
286 # the tests that needed it had this as a dep instead of adding it here.
287 datadeps = [ "//tools/xdisplaycheck" ]
291 deps += [ "//content/shell/android:content_shell_jni_headers" ]
292 #deps -= [ "copy_test_netscape_plugin" ] TODO(GYP)
295 if (is_posix && !is_mac && (!is_android || !is_android_webview_build)) {
296 deps += [ "//components/crash/browser" ]
302 "//ui/aura:test_support",
309 sources += [ "browser/shell_views.cc" ]
312 "//ui/views/controls/webview",
314 "//ui/views:test_support",
317 sources += [ "browser/shell_aura.cc" ]
321 "browser/shell_platform_data_aura.cc",
322 "browser/shell_platform_data_aura.h",
326 # The test plugin relies on X11.
327 if (is_linux && !use_x11) {
328 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
334 "//ui/wm:test_support",
339 deps += [ "//third_party/freetype2" ]
342 if (!enable_plugins) {
344 "browser/shell_plugin_service_filter.cc",
345 "browser/shell_plugin_service_filter.h",
350 grit("content_shell_resources_grit") {
351 visibility = [ ":*" ]
352 source = "shell_resources.grd"
354 "grit/shell_resources.h",
355 "shell_resources.pak",
356 "shell_resources.rc",
360 copy("copy_shell_resources") {
361 sources = [ "$target_gen_dir/shell_resources.pak" ]
362 outputs = [ "$root_out_dir/shell_resources.pak" ]
364 public_deps = [ ":content_shell_resources_grit" ]
370 visibility = [ ":*" ]
371 sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
372 outputs = [ "$root_out_dir/AHEM____.TTF" ]
376 copy("copy_x11_fonts") {
377 visibility = [ ":*" ]
379 "renderer/test_runner/resources/fonts/fonts.conf",
380 "//third_party/gardiner_mod/GardinerModBug.ttf",
381 "//third_party/gardiner_mod/GardinerModCat.ttf",
383 outputs = [ "$root_out_dir/{{source_file_part}}" ]
387 copy("copy_android_fonts") {
388 visibility = [ ":*" ]
390 "renderer/test_runner/resources/fonts/android_main_fonts.xml",
391 "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
393 outputs = [ "$root_out_dir/{{source_file_part}}" ]
399 ":copy_shell_resources",
404 # TODO(GYP) Mac bundle resources.
405 #'all_dependent_settings': {
406 # 'mac_bundle_resources': [
407 # 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
408 # 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
409 # '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
410 # '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
414 deps += [ ":copy_ahem" ]
418 deps += [ ":copy_x11_fonts" ]
421 deps += [ ":copy_android_fonts" ]
427 "$root_gen_dir/blink/public/resources/blink_resources.pak",
428 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
429 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
430 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
431 "$root_gen_dir/content/content_resources.pak",
432 "$root_gen_dir/content/shell/shell_resources.pak",
433 "$root_gen_dir/net/net_resources.pak",
434 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
435 "$root_gen_dir/ui/resources/webui_resources.pak",
436 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
437 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
442 "//content:resources",
443 "//content/app/resources",
444 "//content/app/strings",
445 "//content/browser/tracing:resources",
446 "//net:net_resources",
447 "//third_party/WebKit/public:resources",
452 sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
453 deps += [ "//content/browser/devtools:resources" ]
454 output = "$root_out_dir/content_shell.pak"
457 # TODO(GYP): Figure out what this should be on android
460 executable("content_shell") {
462 # TODO(GYP) mac resource bundle stuff for this target.
463 # TODO(GYP) Windows content shell settings:
466 # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
468 "../app/startup_helper_win.cc",
473 ":content_shell_lib",
479 deps += [ "//sandbox" ]
481 configs -= [ "//build/config/win:console" ]
482 configs += [ "//build/config/win:windowed" ]
487 # TODO(GYP) lots of stuff from GYP file here.
490 if (is_android && !is_android_webview_build) {
491 # Some tests rely on this tool. It might be nicer if these tests relied on
492 # image diff rather than having content shell depend on it.
494 "//tools/imagediff($host_toolchain)",