blob: 6621e63c253f173800387757b0747c612d47e1e2 [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",
[email protected]6b9028ab2014-07-23 17:15:38217 "//content/public/browser",
218 "//content/public/common",
219 "//content/public/plugin",
220 "//content/public/renderer",
221 "//content/public/utility",
[email protected]6b9028ab2014-07-23 17:15:38222 "//content/test:layouttest_support",
223 "//gin",
224 "//gpu",
225 "//ipc",
226 "//media",
227 "//net",
228 "//net:net_resources",
229 "//skia",
pilgrim4af8c212014-09-05 17:30:15230 "//storage/browser",
[email protected]6b9028ab2014-07-23 17:15:38231 "//third_party/WebKit/public:blink",
[email protected]4eebe74d2014-08-13 02:54:46232 "//third_party/WebKit/public:resources",
[email protected]0e043592014-07-28 19:47:04233 "//third_party/WebKit/public:test_support",
[email protected]4eebe74d2014-08-13 02:54:46234 "//third_party/icu",
[email protected]6b9028ab2014-07-23 17:15:38235 "//ui/base",
236 "//ui/events:events_base",
237 "//ui/gfx",
238 "//ui/gfx/geometry",
239 "//ui/gfx/ipc",
240 "//ui/gl",
241 "//url",
242 "//v8",
[email protected]6b9028ab2014-07-23 17:15:38243 #'copy_test_netscape_plugin', TODO(GYP)
[email protected]6b9028ab2014-07-23 17:15:38244 ]
jamesr50081742014-09-09 07:52:22245 if (enable_plugins) {
246 deps += [ "//content/ppapi_plugin" ]
247 }
[email protected]6b9028ab2014-07-23 17:15:38248
249 if (is_win) {
[email protected]6b9028ab2014-07-23 17:15:38250 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP)
251
252 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
253 cflags = [ "/wd4267" ]
254 }
255
256 if (is_linux) {
257 configs += [ "//build/config/linux:fontconfig" ]
258 }
259
260 if (use_x11) {
[email protected]c7990dbf2014-07-23 22:35:10261 # Some tests rely on this tool at runtime. Note: it might be better if
262 # the tests that needed it had this as a dep instead of adding it here.
263 datadeps = [ "//tools/xdisplaycheck" ]
[email protected]6b9028ab2014-07-23 17:15:38264 }
265
266 if (is_android) {
cjhopmancd7694af2014-09-08 00:00:04267 deps += [ ":content_shell_jni_headers" ]
268 #deps -= [ "copy_test_netscape_plugin" ] TODO(GYP)
[email protected]6b9028ab2014-07-23 17:15:38269 }
270
271 if (is_posix && !is_mac && (!is_android || !is_android_webview_build)) {
Robert Sesekabcd8102014-08-27 16:12:44272 deps += [ "//components/crash/browser" ]
[email protected]6b9028ab2014-07-23 17:15:38273 }
274
275 if (use_aura) {
276 deps += [
277 "//ui/aura",
278 "//ui/aura:test_support",
279 "//ui/events",
280 "//ui/strings",
281 "//ui/wm",
282 ]
283
284 if (toolkit_views) {
285 sources += [ "browser/shell_views.cc" ]
286 deps += [
287 "//ui/resources",
288 "//ui/views/controls/webview",
289 "//ui/views",
290 "//ui/views:test_support",
291 ]
292 } else {
293 sources += [ "browser/shell_aura.cc" ]
294 }
295 }
296
297 # The test plugin relies on X11.
298 if (is_linux && !use_x11) {
299 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
300 }
301
302 if (is_chromeos) {
303 deps += [
304 "//ui/wm:test_support",
305 #'../chromeos/chromeos.gyp:chromeos', TODO(GYP)
306 ]
307 }
308
309 if (is_linux) {
310 deps += [ "//third_party/freetype2" ]
311 }
312
313 if (!enable_plugins) {
314 sources -= [
315 "browser/shell_plugin_service_filter.cc",
316 "browser/shell_plugin_service_filter.h",
317 ]
318 }
319}
320
321grit("content_shell_resources_grit") {
brettw9af42622014-09-06 21:21:02322 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38323 source = "shell_resources.grd"
324 outputs = [
325 "grit/shell_resources.h",
326 "shell_resources.pak",
327 "shell_resources.rc",
328 ]
329}
330
331copy("copy_shell_resources") {
332 sources = [ "$target_gen_dir/shell_resources.pak" ]
333 outputs = [ "$root_out_dir/shell_resources.pak" ]
334
335 deps = [ ":content_shell_resources_grit" ]
336 forward_dependent_configs_from = [ ":content_shell_resources_grit" ]
337}
338
339# Font copies.
340if (!is_mac) {
341 copy("copy_ahem") {
brettw9af42622014-09-06 21:21:02342 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38343 sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
344 outputs = [ "$root_out_dir/AHEM____.TTF" ]
345 }
346}
347if (use_x11) {
348 copy("copy_x11_fonts") {
brettw9af42622014-09-06 21:21:02349 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38350 sources = [
351 "renderer/test_runner/resources/fonts/fonts.conf",
352 "//third_party/gardiner_mod/GardinerModBug.ttf",
353 "//third_party/gardiner_mod/GardinerModCat.ttf",
354 ]
355 outputs = [ "$root_out_dir/{{source_file_part}}" ]
356 }
357}
358if (is_android) {
359 copy("copy_android_fonts") {
brettw9af42622014-09-06 21:21:02360 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38361 sources = [
362 "renderer/test_runner/resources/fonts/android_main_fonts.xml",
363 "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
364 ]
365 outputs = [ "$root_out_dir/{{source_file_part}}" ]
366 }
367}
368
369group("resources") {
370 deps = [
371 ":copy_shell_resources",
372 ]
373 forward_dependent_configs_from = [ ":copy_shell_resources" ]
374
375 if (is_mac) {
376 # TODO(GYP) Mac bundle resources.
377 #'all_dependent_settings': {
378 # 'mac_bundle_resources': [
379 # 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
380 # 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
381 # '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
382 # '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
383 # ],
384 #},
385 } else {
386 deps += [ ":copy_ahem" ]
387 }
388
389 if (use_x11) {
390 deps += [ ":copy_x11_fonts" ]
391 }
392 if (is_android) {
393 deps += [ ":copy_android_fonts" ]
394 }
395}
396
397repack("pak") {
398 sources = [
[email protected]48885492014-08-13 11:22:41399 "$root_gen_dir/blink/public/resources/blink_resources.pak",
[email protected]a9ca8d52014-08-22 10:21:08400 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
[email protected]6586a2e32014-08-09 19:24:12401 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
[email protected]6b9028ab2014-07-23 17:15:38402 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
[email protected]6586a2e32014-08-09 19:24:12403 "$root_gen_dir/content/content_resources.pak",
[email protected]6b9028ab2014-07-23 17:15:38404 "$root_gen_dir/content/shell/shell_resources.pak",
405 "$root_gen_dir/net/net_resources.pak",
406 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
407 "$root_gen_dir/ui/resources/webui_resources.pak",
408 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
409 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
[email protected]6b9028ab2014-07-23 17:15:38410 ]
411
412 deps = [
413 ":resources",
414 "//content:resources",
[email protected]a9ca8d52014-08-22 10:21:08415 "//content/app/resources",
[email protected]6586a2e32014-08-09 19:24:12416 "//content/app/strings",
[email protected]6b9028ab2014-07-23 17:15:38417 "//content/browser/tracing:resources",
418 "//net:net_resources",
[email protected]4eebe74d2014-08-13 02:54:46419 "//third_party/WebKit/public:resources",
[email protected]6b9028ab2014-07-23 17:15:38420 "//ui/resources",
421 "//ui/strings",
[email protected]6b9028ab2014-07-23 17:15:38422 ]
423
424 if (is_android) {
425 output = "$root_out_dir/content_shell/assets/content_shell.pak"
426 } else {
427 sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
428 deps += [ "//content/browser/devtools:resources" ]
429 output = "$root_out_dir/content_shell.pak"
430 }
431}
432
[email protected]6b9028ab2014-07-23 17:15:38433executable("content_shell") {
Brett Wilson8f80ad0b2014-09-08 19:50:24434 testonly = true
[email protected]6b9028ab2014-07-23 17:15:38435 # TODO(GYP) mac resource bundle stuff for this target.
436 # TODO(GYP) Windows content shell settings:
437 # - Manifest.
438 # - RC file.
439 # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
440 sources = [
441 "../app/startup_helper_win.cc",
442 "app/shell_main.cc",
443 ]
444
445 deps = [
446 ":content_shell_lib",
447 ":pak",
448 "//base/allocator",
[email protected]c7990dbf2014-07-23 22:35:10449 "//third_party/mesa:osmesa",
[email protected]6b9028ab2014-07-23 17:15:38450 ]
451
452 if (is_win) {
[email protected]086370372014-07-29 21:23:58453 deps += [ "//sandbox" ]
[email protected]6b9028ab2014-07-23 17:15:38454 if (!is_asan) {
455 configs -= [ "//build/config/win:console" ]
456 configs += [ "//build/config/win:windowed" ]
457 }
458 }
459
460 if (is_mac) {
461 # TODO(GYP) lots of stuff from GYP file here.
462 }
463
464 if (!is_android || !is_android_webview_build) {
[email protected]938c54d2014-07-23 21:15:14465 # Some tests rely on this tool. It might be nicer if these tests relied on
466 # image diff rather than having content shell depend on it.
467 datadeps = [
468 "//tools/imagediff($host_toolchain)",
[email protected]6b9028ab2014-07-23 17:15:38469 ]
470 }
471}