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_browser_context.cc",
45 "browser/layout_test/layout_test_browser_context.h",
46 "browser/layout_test/layout_test_browser_main_parts.cc",
47 "browser/layout_test/layout_test_browser_main_parts.h",
48 "browser/layout_test/layout_test_devtools_frontend.cc",
49 "browser/layout_test/layout_test_devtools_frontend.h",
50 "browser/layout_test/layout_test_download_manager_delegate.cc",
51 "browser/layout_test/layout_test_download_manager_delegate.h",
52 "browser/layout_test/layout_test_javascript_dialog_manager.cc",
53 "browser/layout_test/layout_test_javascript_dialog_manager.h",
54 "browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc",
55 "browser/layout_test/layout_test_resource_dispatcher_host_delegate.h",
56 "browser/layout_test/layout_test_url_request_context_getter.cc",
57 "browser/layout_test/layout_test_url_request_context_getter.h",
58 "browser/notify_done_forwarder.cc",
59 "browser/notify_done_forwarder.h",
60 "browser/shell_android.cc",
61 "browser/shell_application_mac.h",
62 "browser/shell_application_mac.mm",
63 "browser/shell_browser_context.cc",
64 "browser/shell_browser_context.h",
65 "browser/shell_browser_main.cc",
66 "browser/shell_browser_main.h",
67 "browser/shell_browser_main_parts.cc",
68 "browser/shell_browser_main_parts.h",
69 "browser/shell_browser_main_parts_mac.mm",
71 "browser/shell_content_browser_client.cc",
72 "browser/shell_content_browser_client.h",
73 "browser/shell_devtools_delegate.cc",
74 "browser/shell_devtools_delegate.h",
75 "browser/shell_devtools_frontend.cc",
76 "browser/shell_devtools_frontend.h",
77 "browser/shell_download_manager_delegate.cc",
78 "browser/shell_download_manager_delegate.h",
80 "browser/shell_javascript_dialog.h",
81 "browser/shell_javascript_dialog_mac.mm",
82 "browser/shell_javascript_dialog_manager.cc",
83 "browser/shell_javascript_dialog_manager.h",
84 "browser/shell_javascript_dialog_win.cc",
85 "browser/shell_layout_tests_android.cc",
86 "browser/shell_layout_tests_android.h",
87 "browser/shell_mojo_test_utils_android.cc",
88 "browser/shell_mojo_test_utils_android.h",
89 "browser/shell_login_dialog.cc",
90 "browser/shell_login_dialog.h",
91 "browser/shell_login_dialog_mac.mm",
92 "browser/shell_mac.mm",
93 "browser/shell_message_filter.cc",
94 "browser/shell_message_filter.h",
95 "browser/shell_net_log.cc",
96 "browser/shell_net_log.h",
97 "browser/shell_network_delegate.cc",
98 "browser/shell_network_delegate.h",
99 "browser/shell_notification_manager.cc",
100 "browser/shell_notification_manager.h",
101 "browser/shell_platform_data_aura.cc",
102 "browser/shell_platform_data_aura.h",
103 "browser/shell_plugin_service_filter.cc",
104 "browser/shell_plugin_service_filter.h",
105 "browser/shell_quota_permission_context.cc",
106 "browser/shell_quota_permission_context.h",
107 "browser/shell_resource_dispatcher_host_delegate.cc",
108 "browser/shell_resource_dispatcher_host_delegate.h",
109 "browser/shell_speech_recognition_manager_delegate.cc",
110 "browser/shell_speech_recognition_manager_delegate.h",
111 "browser/shell_url_request_context_getter.cc",
112 "browser/shell_url_request_context_getter.h",
113 "browser/shell_web_contents_view_delegate_android.cc",
114 "browser/shell_web_contents_view_delegate_creator.h",
115 "browser/shell_web_contents_view_delegate.h",
116 "browser/shell_web_contents_view_delegate_mac.mm",
117 "browser/shell_web_contents_view_delegate_win.cc",
118 "browser/webkit_test_controller.cc",
119 "browser/webkit_test_controller.h",
120 "common/leak_detection_result.h",
121 "common/shell_content_client.cc",
122 "common/shell_content_client.h",
123 "common/shell_messages.cc",
124 "common/shell_messages.h",
125 "common/shell_switches.cc",
126 "common/shell_switches.h",
127 "common/shell_test_configuration.cc",
128 "common/shell_test_configuration.h",
129 "common/test_runner/test_preferences.cc",
130 "common/test_runner/test_preferences.h",
131 "common/webkit_test_helpers.cc",
132 "common/webkit_test_helpers.h",
133 "geolocation/shell_access_token_store.cc",
134 "geolocation/shell_access_token_store.h",
135 "renderer/ipc_echo.cc",
136 "renderer/ipc_echo.h",
137 "renderer/layout_test/gc_controller.cc",
138 "renderer/layout_test/gc_controller.h",
139 "renderer/layout_test/layout_test_content_renderer_client.cc",
140 "renderer/layout_test/layout_test_content_renderer_client.h",
141 "renderer/layout_test/layout_test_render_frame_observer.cc",
142 "renderer/layout_test/layout_test_render_frame_observer.h",
143 "renderer/layout_test/layout_test_render_process_observer.cc",
144 "renderer/layout_test/layout_test_render_process_observer.h",
145 "renderer/layout_test/leak_detector.cc",
146 "renderer/layout_test/leak_detector.h",
147 "renderer/layout_test/webkit_test_runner.cc",
148 "renderer/layout_test/webkit_test_runner.h",
149 "renderer/shell_content_renderer_client.cc",
150 "renderer/shell_content_renderer_client.h",
151 "renderer/shell_render_view_observer.cc",
152 "renderer/shell_render_view_observer.h",
153 "renderer/test_runner/accessibility_controller.cc",
154 "renderer/test_runner/accessibility_controller.h",
155 "renderer/test_runner/event_sender.cc",
156 "renderer/test_runner/event_sender.h",
157 "renderer/test_runner/gamepad_controller.cc",
158 "renderer/test_runner/gamepad_controller.h",
159 "renderer/test_runner/mock_color_chooser.cc",
160 "renderer/test_runner/mock_color_chooser.h",
161 "renderer/test_runner/mock_constraints.cc",
162 "renderer/test_runner/mock_constraints.h",
163 "renderer/test_runner/mock_credential_manager_client.cc",
164 "renderer/test_runner/mock_credential_manager_client.h",
165 "renderer/test_runner/mock_grammar_check.cc",
166 "renderer/test_runner/mock_grammar_check.h",
167 "renderer/test_runner/mock_screen_orientation_client.cc",
168 "renderer/test_runner/mock_screen_orientation_client.h",
169 "renderer/test_runner/mock_spell_check.cc",
170 "renderer/test_runner/mock_spell_check.h",
171 "renderer/test_runner/mock_web_audio_device.cc",
172 "renderer/test_runner/mock_web_audio_device.h",
173 "renderer/test_runner/mock_web_media_stream_center.cc",
174 "renderer/test_runner/mock_web_media_stream_center.h",
175 "renderer/test_runner/mock_web_midi_accessor.cc",
176 "renderer/test_runner/mock_web_midi_accessor.h",
177 "renderer/test_runner/mock_web_push_client.cc",
178 "renderer/test_runner/mock_web_push_client.h",
179 "renderer/test_runner/mock_web_speech_recognizer.cc",
180 "renderer/test_runner/mock_web_speech_recognizer.h",
181 "renderer/test_runner/mock_web_theme_engine.cc",
182 "renderer/test_runner/mock_web_theme_engine.h",
183 "renderer/test_runner/mock_web_user_media_client.cc",
184 "renderer/test_runner/mock_web_user_media_client.h",
185 "renderer/test_runner/mock_webrtc_data_channel_handler.cc",
186 "renderer/test_runner/mock_webrtc_data_channel_handler.h",
187 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc",
188 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.h",
189 "renderer/test_runner/mock_webrtc_peer_connection_handler.cc",
190 "renderer/test_runner/mock_webrtc_peer_connection_handler.h",
191 "renderer/test_runner/notification_presenter.cc",
192 "renderer/test_runner/notification_presenter.h",
193 "renderer/test_runner/spell_check_client.cc",
194 "renderer/test_runner/spell_check_client.h",
195 "renderer/test_runner/test_common.cc",
196 "renderer/test_runner/test_common.h",
197 "renderer/test_runner/test_interfaces.cc",
198 "renderer/test_runner/test_interfaces.h",
199 "renderer/test_runner/test_plugin.cc",
200 "renderer/test_runner/test_plugin.h",
201 "renderer/test_runner/test_runner.cc",
202 "renderer/test_runner/test_runner.h",
203 "renderer/test_runner/text_input_controller.cc",
204 "renderer/test_runner/text_input_controller.h",
205 "renderer/test_runner/web_ax_object_proxy.cc",
206 "renderer/test_runner/web_ax_object_proxy.h",
207 "renderer/test_runner/web_frame_test_proxy.h",
208 "renderer/test_runner/web_permissions.cc",
209 "renderer/test_runner/web_permissions.h",
210 "renderer/test_runner/web_task.cc",
211 "renderer/test_runner/web_task.h",
212 "renderer/test_runner/web_test_delegate.h",
213 "renderer/test_runner/web_test_interfaces.cc",
214 "renderer/test_runner/web_test_interfaces.h",
215 "renderer/test_runner/web_test_proxy.cc",
216 "renderer/test_runner/web_test_proxy.h",
217 "renderer/test_runner/web_test_runner.h",
220 defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ]
223 # This exposes all public content APIs.
224 "//content/public/app:both",
225 "//content/public/browser",
226 "//content/public/common",
227 "//content/public/plugin",
228 "//content/public/renderer",
229 "//content/public/utility",
234 "//base:base_static",
236 "//base/third_party/dynamic_annotations",
238 "//components/crash/app",
239 "//components/web_cache/renderer",
240 "//content:resources",
241 "//content/app/resources",
242 "//content/app/strings",
244 "//content/test:layouttest_support",
250 "//net:net_resources",
253 "//third_party/WebKit/public:blink",
254 "//third_party/WebKit/public:resources",
255 "//third_party/WebKit/public:test_support",
258 "//ui/events:events_base",
265 #'copy_test_netscape_plugin', TODO(GYP)
267 if (enable_plugins) {
268 deps += [ "//content/ppapi_plugin" ]
272 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP)
274 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
275 cflags = [ "/wd4267" ]
279 configs += [ "//build/config/linux:fontconfig" ]
283 # Some tests rely on this tool at runtime. Note: it might be better if
284 # the tests that needed it had this as a dep instead of adding it here.
285 datadeps = [ "//tools/xdisplaycheck" ]
289 deps += [ "//content/shell/android:content_shell_jni_headers" ]
290 #deps -= [ "copy_test_netscape_plugin" ] TODO(GYP)
293 if (is_posix && !is_mac && (!is_android || !is_android_webview_build)) {
294 deps += [ "//components/crash/browser" ]
300 "//ui/aura:test_support",
307 sources += [ "browser/shell_views.cc" ]
310 "//ui/views/controls/webview",
312 "//ui/views:test_support",
315 sources += [ "browser/shell_aura.cc" ]
319 "browser/shell_platform_data_aura.cc",
320 "browser/shell_platform_data_aura.h",
324 # The test plugin relies on X11.
325 if (is_linux && !use_x11) {
326 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
332 "//ui/wm:test_support",
337 deps += [ "//third_party/freetype2" ]
340 if (!enable_plugins) {
342 "browser/shell_plugin_service_filter.cc",
343 "browser/shell_plugin_service_filter.h",
348 grit("content_shell_resources_grit") {
349 visibility = [ ":*" ]
350 source = "shell_resources.grd"
352 "grit/shell_resources.h",
353 "shell_resources.pak",
354 "shell_resources.rc",
358 copy("copy_shell_resources") {
359 sources = [ "$target_gen_dir/shell_resources.pak" ]
360 outputs = [ "$root_out_dir/shell_resources.pak" ]
362 public_deps = [ ":content_shell_resources_grit" ]
368 visibility = [ ":*" ]
369 sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
370 outputs = [ "$root_out_dir/AHEM____.TTF" ]
374 copy("copy_x11_fonts") {
375 visibility = [ ":*" ]
377 "renderer/test_runner/resources/fonts/fonts.conf",
378 "//third_party/gardiner_mod/GardinerModBug.ttf",
379 "//third_party/gardiner_mod/GardinerModCat.ttf",
381 outputs = [ "$root_out_dir/{{source_file_part}}" ]
385 copy("copy_android_fonts") {
386 visibility = [ ":*" ]
388 "renderer/test_runner/resources/fonts/android_main_fonts.xml",
389 "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
391 outputs = [ "$root_out_dir/{{source_file_part}}" ]
397 ":copy_shell_resources",
402 # TODO(GYP) Mac bundle resources.
403 #'all_dependent_settings': {
404 # 'mac_bundle_resources': [
405 # 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
406 # 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
407 # '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
408 # '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
412 deps += [ ":copy_ahem" ]
416 deps += [ ":copy_x11_fonts" ]
419 deps += [ ":copy_android_fonts" ]
425 "$root_gen_dir/blink/public/resources/blink_resources.pak",
426 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
427 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
428 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
429 "$root_gen_dir/content/content_resources.pak",
430 "$root_gen_dir/content/shell/shell_resources.pak",
431 "$root_gen_dir/net/net_resources.pak",
432 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
433 "$root_gen_dir/ui/resources/webui_resources.pak",
434 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
435 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
440 "//content:resources",
441 "//content/app/resources",
442 "//content/app/strings",
443 "//content/browser/tracing:resources",
444 "//net:net_resources",
445 "//third_party/WebKit/public:resources",
450 sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
451 deps += [ "//content/browser/devtools:resources" ]
452 output = "$root_out_dir/content_shell.pak"
455 # TODO(GYP): Figure out what this should be on android
458 executable("content_shell") {
460 # TODO(GYP) mac resource bundle stuff for this target.
461 # TODO(GYP) Windows content shell settings:
464 # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
466 "../app/startup_helper_win.cc",
471 ":content_shell_lib",
477 deps += [ "//sandbox" ]
479 configs -= [ "//build/config/win:console" ]
480 configs += [ "//build/config/win:windowed" ]
485 # TODO(GYP) lots of stuff from GYP file here.
488 if (is_android && !is_android_webview_build) {
489 # Some tests rely on this tool. It might be nicer if these tests relied on
490 # image diff rather than having content shell depend on it.
492 "//tools/imagediff($host_toolchain)",