blob: bad7f4d6e4042dc9a49d384b624b3915a842237f [file] [log] [blame]
[email protected]6b9028ab2014-07-23 17:15:381# 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.
4
5import("//build/config/features.gni")
6import("//build/config/ui.gni")
[email protected]6b9028ab2014-07-23 17:15:387import("//tools/grit/repack.gni")
cjhopmancd7694af2014-09-08 00:00:048import("//tools/grit/grit_rule.gni")
[email protected]6b9028ab2014-07-23 17:15:389if (is_android) {
10 import("//build/config/android/config.gni")
11}
12
13declare_args() {
14 content_shell_product_name = "Content Shell"
15
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"
20}
21
22static_library("content_shell_lib") {
Brett Wilson8f80ad0b2014-09-08 19:50:2423 testonly = true
[email protected]6b9028ab2014-07-23 17:15:3824 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/paths_mac.h",
30 "app/paths_mac.mm",
31 "app/shell_breakpad_client.cc",
32 "app/shell_breakpad_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",
[email protected]9cd36bfb2014-08-20 00:32:0042 "browser/ipc_echo_message_filter.cc",
43 "browser/ipc_echo_message_filter.h",
[email protected]6b9028ab2014-07-23 17:15:3844 "browser/notify_done_forwarder.cc",
45 "browser/notify_done_forwarder.h",
46 "browser/shell_android.cc",
47 "browser/shell_application_mac.h",
48 "browser/shell_application_mac.mm",
49 "browser/shell_browser_context.cc",
50 "browser/shell_browser_context.h",
51 "browser/shell_browser_main.cc",
52 "browser/shell_browser_main.h",
53 "browser/shell_browser_main_parts.cc",
54 "browser/shell_browser_main_parts.h",
55 "browser/shell_browser_main_parts_mac.mm",
56 "browser/shell.cc",
57 "browser/shell_content_browser_client.cc",
58 "browser/shell_content_browser_client.h",
59 "browser/shell_devtools_delegate.cc",
60 "browser/shell_devtools_delegate.h",
61 "browser/shell_devtools_frontend.cc",
62 "browser/shell_devtools_frontend.h",
63 "browser/shell_download_manager_delegate.cc",
64 "browser/shell_download_manager_delegate.h",
65 "browser/shell.h",
66 "browser/shell_javascript_dialog.h",
67 "browser/shell_javascript_dialog_mac.mm",
68 "browser/shell_javascript_dialog_manager.cc",
69 "browser/shell_javascript_dialog_manager.h",
70 "browser/shell_javascript_dialog_win.cc",
71 "browser/shell_layout_tests_android.cc",
72 "browser/shell_layout_tests_android.h",
73 "browser/shell_login_dialog.cc",
74 "browser/shell_login_dialog.h",
75 "browser/shell_login_dialog_mac.mm",
76 "browser/shell_mac.mm",
77 "browser/shell_message_filter.cc",
78 "browser/shell_message_filter.h",
79 "browser/shell_net_log.cc",
80 "browser/shell_net_log.h",
81 "browser/shell_network_delegate.cc",
82 "browser/shell_network_delegate.h",
[email protected]945babb2014-07-30 14:25:3283 "browser/shell_notification_manager.cc",
84 "browser/shell_notification_manager.h",
[email protected]6b9028ab2014-07-23 17:15:3885 "browser/shell_platform_data_aura.cc",
86 "browser/shell_platform_data_aura.h",
87 "browser/shell_plugin_service_filter.cc",
88 "browser/shell_plugin_service_filter.h",
89 "browser/shell_quota_permission_context.cc",
90 "browser/shell_quota_permission_context.h",
91 "browser/shell_resource_dispatcher_host_delegate.cc",
92 "browser/shell_resource_dispatcher_host_delegate.h",
93 "browser/shell_speech_recognition_manager_delegate.cc",
94 "browser/shell_speech_recognition_manager_delegate.h",
95 "browser/shell_url_request_context_getter.cc",
96 "browser/shell_url_request_context_getter.h",
97 "browser/shell_web_contents_view_delegate_android.cc",
98 "browser/shell_web_contents_view_delegate_creator.h",
99 "browser/shell_web_contents_view_delegate.h",
100 "browser/shell_web_contents_view_delegate_mac.mm",
101 "browser/shell_web_contents_view_delegate_win.cc",
102 "browser/webkit_test_controller.cc",
103 "browser/webkit_test_controller.h",
104 "common/leak_detection_result.h",
105 "common/shell_content_client.cc",
106 "common/shell_content_client.h",
107 "common/shell_messages.cc",
108 "common/shell_messages.h",
109 "common/shell_switches.cc",
110 "common/shell_switches.h",
111 "common/shell_test_configuration.cc",
112 "common/shell_test_configuration.h",
113 "common/test_runner/test_preferences.cc",
114 "common/test_runner/test_preferences.h",
115 "common/webkit_test_helpers.cc",
116 "common/webkit_test_helpers.h",
117 "geolocation/shell_access_token_store.cc",
118 "geolocation/shell_access_token_store.h",
119 "renderer/gc_controller.cc",
120 "renderer/gc_controller.h",
[email protected]9cd36bfb2014-08-20 00:32:00121 "renderer/ipc_echo.cc",
122 "renderer/ipc_echo.h",
[email protected]6b9028ab2014-07-23 17:15:38123 "renderer/leak_detector.cc",
124 "renderer/leak_detector.h",
125 "renderer/shell_content_renderer_client.cc",
126 "renderer/shell_content_renderer_client.h",
127 "renderer/shell_render_frame_observer.cc",
128 "renderer/shell_render_frame_observer.h",
129 "renderer/shell_render_process_observer.cc",
130 "renderer/shell_render_process_observer.h",
131 "renderer/shell_render_view_observer.cc",
132 "renderer/shell_render_view_observer.h",
[email protected]6b9028ab2014-07-23 17:15:38133 "renderer/test_runner/WebTask.cpp",
134 "renderer/test_runner/WebTask.h",
135 "renderer/test_runner/WebTestDelegate.h",
136 "renderer/test_runner/WebTestInterfaces.cpp",
137 "renderer/test_runner/WebTestInterfaces.h",
[email protected]6b9028ab2014-07-23 17:15:38138 "renderer/test_runner/accessibility_controller.cc",
139 "renderer/test_runner/accessibility_controller.h",
140 "renderer/test_runner/event_sender.cc",
141 "renderer/test_runner/event_sender.h",
142 "renderer/test_runner/gamepad_controller.cc",
143 "renderer/test_runner/gamepad_controller.h",
[email protected]0e043592014-07-28 19:47:04144 "renderer/test_runner/mock_color_chooser.cc",
145 "renderer/test_runner/mock_color_chooser.h",
[email protected]6b9028ab2014-07-23 17:15:38146 "renderer/test_runner/mock_constraints.cc",
147 "renderer/test_runner/mock_constraints.h",
148 "renderer/test_runner/mock_grammar_check.cc",
149 "renderer/test_runner/mock_grammar_check.h",
150 "renderer/test_runner/mock_screen_orientation_client.cc",
151 "renderer/test_runner/mock_screen_orientation_client.h",
[email protected]f656a652014-07-25 12:19:52152 "renderer/test_runner/mock_spell_check.cc",
153 "renderer/test_runner/mock_spell_check.h",
[email protected]6b9028ab2014-07-23 17:15:38154 "renderer/test_runner/mock_web_audio_device.cc",
155 "renderer/test_runner/mock_web_audio_device.h",
[email protected]85afb6c2014-07-29 02:43:36156 "renderer/test_runner/mock_web_media_stream_center.cc",
157 "renderer/test_runner/mock_web_media_stream_center.h",
[email protected]6b950c32014-07-28 14:35:43158 "renderer/test_runner/mock_web_midi_accessor.cc",
159 "renderer/test_runner/mock_web_midi_accessor.h",
[email protected]6b9028ab2014-07-23 17:15:38160 "renderer/test_runner/mock_web_push_client.cc",
161 "renderer/test_runner/mock_web_push_client.h",
[email protected]ca35ef02014-07-31 11:46:49162 "renderer/test_runner/mock_web_speech_recognizer.cc",
163 "renderer/test_runner/mock_web_speech_recognizer.h",
[email protected]6b9028ab2014-07-23 17:15:38164 "renderer/test_runner/mock_web_theme_engine.cc",
165 "renderer/test_runner/mock_web_theme_engine.h",
[email protected]c92e06462014-07-26 21:24:22166 "renderer/test_runner/mock_web_theme_engine_mac.h",
167 "renderer/test_runner/mock_web_theme_engine_mac.mm",
[email protected]6b9028ab2014-07-23 17:15:38168 "renderer/test_runner/mock_web_user_media_client.cc",
169 "renderer/test_runner/mock_web_user_media_client.h",
170 "renderer/test_runner/mock_webrtc_data_channel_handler.cc",
171 "renderer/test_runner/mock_webrtc_data_channel_handler.h",
172 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc",
173 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.h",
174 "renderer/test_runner/mock_webrtc_peer_connection_handler.cc",
175 "renderer/test_runner/mock_webrtc_peer_connection_handler.h",
176 "renderer/test_runner/notification_presenter.cc",
177 "renderer/test_runner/notification_presenter.h",
[email protected]b38c8f312014-08-01 23:21:37178 "renderer/test_runner/spell_check_client.cc",
179 "renderer/test_runner/spell_check_client.h",
[email protected]f5b1ad882014-08-05 16:30:41180 "renderer/test_runner/test_common.cc",
181 "renderer/test_runner/test_common.h",
[email protected]8ed8bf432014-08-11 19:47:55182 "renderer/test_runner/test_interfaces.cc",
183 "renderer/test_runner/test_interfaces.h",
abhishek.a21dd9554f2014-09-03 17:19:12184 "renderer/test_runner/test_plugin.cc",
185 "renderer/test_runner/test_plugin.h",
[email protected]6b9028ab2014-07-23 17:15:38186 "renderer/test_runner/test_runner.cc",
187 "renderer/test_runner/test_runner.h",
188 "renderer/test_runner/text_input_controller.cc",
189 "renderer/test_runner/text_input_controller.h",
190 "renderer/test_runner/web_ax_object_proxy.cc",
191 "renderer/test_runner/web_ax_object_proxy.h",
192 "renderer/test_runner/web_frame_test_proxy.h",
193 "renderer/test_runner/web_permissions.cc",
194 "renderer/test_runner/web_permissions.h",
195 "renderer/test_runner/web_test_proxy.cc",
196 "renderer/test_runner/web_test_proxy.h",
197 "renderer/test_runner/web_test_runner.h",
198 "renderer/webkit_test_runner.cc",
199 "renderer/webkit_test_runner.h",
200 ]
201
202 defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ]
203
204 deps = [
205 ":resources",
206 "//base",
207 "//base:base_static",
208 "//base/allocator",
209 "//base/third_party/dynamic_annotations",
210 "//cc",
Robert Sesekabcd8102014-08-27 16:12:44211 "//components/crash/app",
[email protected]6b9028ab2014-07-23 17:15:38212 "//content:resources",
[email protected]0e043592014-07-28 19:47:04213 "//content/app:both",
[email protected]a9ca8d52014-08-22 10:21:08214 "//content/app/resources",
[email protected]6586a2e32014-08-09 19:24:12215 "//content/app/strings",
[email protected]6b9028ab2014-07-23 17:15:38216 "//content/gpu",
217 "//content/ppapi_plugin",
218 "//content/public/browser",
219 "//content/public/common",
220 "//content/public/plugin",
221 "//content/public/renderer",
222 "//content/public/utility",
[email protected]6b9028ab2014-07-23 17:15:38223 "//content/test:layouttest_support",
224 "//gin",
225 "//gpu",
226 "//ipc",
227 "//media",
228 "//net",
229 "//net:net_resources",
230 "//skia",
pilgrim4af8c212014-09-05 17:30:15231 "//storage/browser",
[email protected]6b9028ab2014-07-23 17:15:38232 "//third_party/WebKit/public:blink",
[email protected]4eebe74d2014-08-13 02:54:46233 "//third_party/WebKit/public:resources",
[email protected]0e043592014-07-28 19:47:04234 "//third_party/WebKit/public:test_support",
[email protected]4eebe74d2014-08-13 02:54:46235 "//third_party/icu",
[email protected]6b9028ab2014-07-23 17:15:38236 "//ui/base",
237 "//ui/events:events_base",
238 "//ui/gfx",
239 "//ui/gfx/geometry",
240 "//ui/gfx/ipc",
241 "//ui/gl",
242 "//url",
243 "//v8",
[email protected]6b9028ab2014-07-23 17:15:38244 #'copy_test_netscape_plugin', TODO(GYP)
[email protected]6b9028ab2014-07-23 17:15:38245 ]
246
247 if (is_win) {
[email protected]6b9028ab2014-07-23 17:15:38248 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP)
249
250 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
251 cflags = [ "/wd4267" ]
252 }
253
254 if (is_linux) {
255 configs += [ "//build/config/linux:fontconfig" ]
256 }
257
258 if (use_x11) {
[email protected]c7990dbf2014-07-23 22:35:10259 # Some tests rely on this tool at runtime. Note: it might be better if
260 # the tests that needed it had this as a dep instead of adding it here.
261 datadeps = [ "//tools/xdisplaycheck" ]
[email protected]6b9028ab2014-07-23 17:15:38262 }
263
264 if (is_android) {
cjhopmancd7694af2014-09-08 00:00:04265 deps += [ ":content_shell_jni_headers" ]
266 #deps -= [ "copy_test_netscape_plugin" ] TODO(GYP)
[email protected]6b9028ab2014-07-23 17:15:38267 }
268
269 if (is_posix && !is_mac && (!is_android || !is_android_webview_build)) {
Robert Sesekabcd8102014-08-27 16:12:44270 deps += [ "//components/crash/browser" ]
[email protected]6b9028ab2014-07-23 17:15:38271 }
272
273 if (use_aura) {
274 deps += [
275 "//ui/aura",
276 "//ui/aura:test_support",
277 "//ui/events",
278 "//ui/strings",
279 "//ui/wm",
280 ]
281
282 if (toolkit_views) {
283 sources += [ "browser/shell_views.cc" ]
284 deps += [
285 "//ui/resources",
286 "//ui/views/controls/webview",
287 "//ui/views",
288 "//ui/views:test_support",
289 ]
290 } else {
291 sources += [ "browser/shell_aura.cc" ]
292 }
293 }
294
295 # The test plugin relies on X11.
296 if (is_linux && !use_x11) {
297 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
298 }
299
300 if (is_chromeos) {
301 deps += [
302 "//ui/wm:test_support",
303 #'../chromeos/chromeos.gyp:chromeos', TODO(GYP)
304 ]
305 }
306
307 if (is_linux) {
308 deps += [ "//third_party/freetype2" ]
309 }
310
311 if (!enable_plugins) {
312 sources -= [
313 "browser/shell_plugin_service_filter.cc",
314 "browser/shell_plugin_service_filter.h",
315 ]
316 }
317}
318
319grit("content_shell_resources_grit") {
brettw9af42622014-09-06 21:21:02320 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38321 source = "shell_resources.grd"
322 outputs = [
323 "grit/shell_resources.h",
324 "shell_resources.pak",
325 "shell_resources.rc",
326 ]
327}
328
329copy("copy_shell_resources") {
330 sources = [ "$target_gen_dir/shell_resources.pak" ]
331 outputs = [ "$root_out_dir/shell_resources.pak" ]
332
333 deps = [ ":content_shell_resources_grit" ]
334 forward_dependent_configs_from = [ ":content_shell_resources_grit" ]
335}
336
337# Font copies.
338if (!is_mac) {
339 copy("copy_ahem") {
brettw9af42622014-09-06 21:21:02340 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38341 sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
342 outputs = [ "$root_out_dir/AHEM____.TTF" ]
343 }
344}
345if (use_x11) {
346 copy("copy_x11_fonts") {
brettw9af42622014-09-06 21:21:02347 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38348 sources = [
349 "renderer/test_runner/resources/fonts/fonts.conf",
350 "//third_party/gardiner_mod/GardinerModBug.ttf",
351 "//third_party/gardiner_mod/GardinerModCat.ttf",
352 ]
353 outputs = [ "$root_out_dir/{{source_file_part}}" ]
354 }
355}
356if (is_android) {
357 copy("copy_android_fonts") {
brettw9af42622014-09-06 21:21:02358 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38359 sources = [
360 "renderer/test_runner/resources/fonts/android_main_fonts.xml",
361 "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
362 ]
363 outputs = [ "$root_out_dir/{{source_file_part}}" ]
364 }
365}
366
367group("resources") {
368 deps = [
369 ":copy_shell_resources",
370 ]
371 forward_dependent_configs_from = [ ":copy_shell_resources" ]
372
373 if (is_mac) {
374 # TODO(GYP) Mac bundle resources.
375 #'all_dependent_settings': {
376 # 'mac_bundle_resources': [
377 # 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
378 # 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
379 # '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
380 # '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
381 # ],
382 #},
383 } else {
384 deps += [ ":copy_ahem" ]
385 }
386
387 if (use_x11) {
388 deps += [ ":copy_x11_fonts" ]
389 }
390 if (is_android) {
391 deps += [ ":copy_android_fonts" ]
392 }
393}
394
395repack("pak") {
396 sources = [
[email protected]48885492014-08-13 11:22:41397 "$root_gen_dir/blink/public/resources/blink_resources.pak",
[email protected]a9ca8d52014-08-22 10:21:08398 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
[email protected]6586a2e32014-08-09 19:24:12399 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
[email protected]6b9028ab2014-07-23 17:15:38400 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
[email protected]6586a2e32014-08-09 19:24:12401 "$root_gen_dir/content/content_resources.pak",
[email protected]6b9028ab2014-07-23 17:15:38402 "$root_gen_dir/content/shell/shell_resources.pak",
403 "$root_gen_dir/net/net_resources.pak",
404 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
405 "$root_gen_dir/ui/resources/webui_resources.pak",
406 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
407 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
[email protected]6b9028ab2014-07-23 17:15:38408 ]
409
410 deps = [
411 ":resources",
412 "//content:resources",
[email protected]a9ca8d52014-08-22 10:21:08413 "//content/app/resources",
[email protected]6586a2e32014-08-09 19:24:12414 "//content/app/strings",
[email protected]6b9028ab2014-07-23 17:15:38415 "//content/browser/tracing:resources",
416 "//net:net_resources",
[email protected]4eebe74d2014-08-13 02:54:46417 "//third_party/WebKit/public:resources",
[email protected]6b9028ab2014-07-23 17:15:38418 "//ui/resources",
419 "//ui/strings",
[email protected]6b9028ab2014-07-23 17:15:38420 ]
421
422 if (is_android) {
423 output = "$root_out_dir/content_shell/assets/content_shell.pak"
424 } else {
425 sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
426 deps += [ "//content/browser/devtools:resources" ]
427 output = "$root_out_dir/content_shell.pak"
428 }
429}
430
[email protected]6b9028ab2014-07-23 17:15:38431executable("content_shell") {
Brett Wilson8f80ad0b2014-09-08 19:50:24432 testonly = true
[email protected]6b9028ab2014-07-23 17:15:38433 # TODO(GYP) mac resource bundle stuff for this target.
434 # TODO(GYP) Windows content shell settings:
435 # - Manifest.
436 # - RC file.
437 # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
438 sources = [
439 "../app/startup_helper_win.cc",
440 "app/shell_main.cc",
441 ]
442
443 deps = [
444 ":content_shell_lib",
445 ":pak",
446 "//base/allocator",
[email protected]c7990dbf2014-07-23 22:35:10447 "//third_party/mesa:osmesa",
[email protected]6b9028ab2014-07-23 17:15:38448 ]
449
450 if (is_win) {
[email protected]086370372014-07-29 21:23:58451 deps += [ "//sandbox" ]
[email protected]6b9028ab2014-07-23 17:15:38452 if (!is_asan) {
453 configs -= [ "//build/config/win:console" ]
454 configs += [ "//build/config/win:windowed" ]
455 }
456 }
457
458 if (is_mac) {
459 # TODO(GYP) lots of stuff from GYP file here.
460 }
461
462 if (!is_android || !is_android_webview_build) {
[email protected]938c54d2014-07-23 21:15:14463 # Some tests rely on this tool. It might be nicer if these tests relied on
464 # image diff rather than having content shell depend on it.
465 datadeps = [
466 "//tools/imagediff($host_toolchain)",
[email protected]6b9028ab2014-07-23 17:15:38467 ]
468 }
469}