blob: 3588691047c0b24db5682bc3661b1c0125faa016 [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")
7import("//tools/grit/grit_rule.gni")
8import("//tools/grit/repack.gni")
9if (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") {
23 sources = [
24 "android/shell_jni_registrar.cc",
25 "android/shell_jni_registrar.h",
26 "android/shell_manager.cc",
27 "android/shell_manager.h",
28 "app/paths_mac.h",
29 "app/paths_mac.mm",
30 "app/shell_breakpad_client.cc",
31 "app/shell_breakpad_client.h",
32 "app/shell_main_delegate.cc",
33 "app/shell_main_delegate.h",
34 "app/shell_main_delegate_mac.h",
35 "app/shell_main_delegate_mac.mm",
36 "app/webkit_test_platform_support_android.cc",
37 "app/webkit_test_platform_support.h",
38 "app/webkit_test_platform_support_linux.cc",
39 "app/webkit_test_platform_support_mac.mm",
40 "app/webkit_test_platform_support_win.cc",
41 "browser/notify_done_forwarder.cc",
42 "browser/notify_done_forwarder.h",
43 "browser/shell_android.cc",
44 "browser/shell_application_mac.h",
45 "browser/shell_application_mac.mm",
46 "browser/shell_browser_context.cc",
47 "browser/shell_browser_context.h",
48 "browser/shell_browser_main.cc",
49 "browser/shell_browser_main.h",
50 "browser/shell_browser_main_parts.cc",
51 "browser/shell_browser_main_parts.h",
52 "browser/shell_browser_main_parts_mac.mm",
53 "browser/shell.cc",
54 "browser/shell_content_browser_client.cc",
55 "browser/shell_content_browser_client.h",
56 "browser/shell_devtools_delegate.cc",
57 "browser/shell_devtools_delegate.h",
58 "browser/shell_devtools_frontend.cc",
59 "browser/shell_devtools_frontend.h",
60 "browser/shell_download_manager_delegate.cc",
61 "browser/shell_download_manager_delegate.h",
62 "browser/shell.h",
63 "browser/shell_javascript_dialog.h",
64 "browser/shell_javascript_dialog_mac.mm",
65 "browser/shell_javascript_dialog_manager.cc",
66 "browser/shell_javascript_dialog_manager.h",
67 "browser/shell_javascript_dialog_win.cc",
68 "browser/shell_layout_tests_android.cc",
69 "browser/shell_layout_tests_android.h",
70 "browser/shell_login_dialog.cc",
71 "browser/shell_login_dialog.h",
72 "browser/shell_login_dialog_mac.mm",
73 "browser/shell_mac.mm",
74 "browser/shell_message_filter.cc",
75 "browser/shell_message_filter.h",
76 "browser/shell_net_log.cc",
77 "browser/shell_net_log.h",
78 "browser/shell_network_delegate.cc",
79 "browser/shell_network_delegate.h",
[email protected]945babb2014-07-30 14:25:3280 "browser/shell_notification_manager.cc",
81 "browser/shell_notification_manager.h",
[email protected]6b9028ab2014-07-23 17:15:3882 "browser/shell_platform_data_aura.cc",
83 "browser/shell_platform_data_aura.h",
84 "browser/shell_plugin_service_filter.cc",
85 "browser/shell_plugin_service_filter.h",
86 "browser/shell_quota_permission_context.cc",
87 "browser/shell_quota_permission_context.h",
88 "browser/shell_resource_dispatcher_host_delegate.cc",
89 "browser/shell_resource_dispatcher_host_delegate.h",
90 "browser/shell_speech_recognition_manager_delegate.cc",
91 "browser/shell_speech_recognition_manager_delegate.h",
92 "browser/shell_url_request_context_getter.cc",
93 "browser/shell_url_request_context_getter.h",
94 "browser/shell_web_contents_view_delegate_android.cc",
95 "browser/shell_web_contents_view_delegate_creator.h",
96 "browser/shell_web_contents_view_delegate.h",
97 "browser/shell_web_contents_view_delegate_mac.mm",
98 "browser/shell_web_contents_view_delegate_win.cc",
99 "browser/webkit_test_controller.cc",
100 "browser/webkit_test_controller.h",
101 "common/leak_detection_result.h",
102 "common/shell_content_client.cc",
103 "common/shell_content_client.h",
104 "common/shell_messages.cc",
105 "common/shell_messages.h",
106 "common/shell_switches.cc",
107 "common/shell_switches.h",
108 "common/shell_test_configuration.cc",
109 "common/shell_test_configuration.h",
110 "common/test_runner/test_preferences.cc",
111 "common/test_runner/test_preferences.h",
112 "common/webkit_test_helpers.cc",
113 "common/webkit_test_helpers.h",
114 "geolocation/shell_access_token_store.cc",
115 "geolocation/shell_access_token_store.h",
116 "renderer/gc_controller.cc",
117 "renderer/gc_controller.h",
118 "renderer/leak_detector.cc",
119 "renderer/leak_detector.h",
120 "renderer/shell_content_renderer_client.cc",
121 "renderer/shell_content_renderer_client.h",
122 "renderer/shell_render_frame_observer.cc",
123 "renderer/shell_render_frame_observer.h",
124 "renderer/shell_render_process_observer.cc",
125 "renderer/shell_render_process_observer.h",
126 "renderer/shell_render_view_observer.cc",
127 "renderer/shell_render_view_observer.h",
[email protected]6b9028ab2014-07-23 17:15:38128 "renderer/test_runner/TestPlugin.cpp",
129 "renderer/test_runner/TestPlugin.h",
130 "renderer/test_runner/WebTask.cpp",
131 "renderer/test_runner/WebTask.h",
132 "renderer/test_runner/WebTestDelegate.h",
133 "renderer/test_runner/WebTestInterfaces.cpp",
134 "renderer/test_runner/WebTestInterfaces.h",
[email protected]6b9028ab2014-07-23 17:15:38135 "renderer/test_runner/accessibility_controller.cc",
136 "renderer/test_runner/accessibility_controller.h",
137 "renderer/test_runner/event_sender.cc",
138 "renderer/test_runner/event_sender.h",
139 "renderer/test_runner/gamepad_controller.cc",
140 "renderer/test_runner/gamepad_controller.h",
[email protected]0e043592014-07-28 19:47:04141 "renderer/test_runner/mock_color_chooser.cc",
142 "renderer/test_runner/mock_color_chooser.h",
[email protected]6b9028ab2014-07-23 17:15:38143 "renderer/test_runner/mock_constraints.cc",
144 "renderer/test_runner/mock_constraints.h",
145 "renderer/test_runner/mock_grammar_check.cc",
146 "renderer/test_runner/mock_grammar_check.h",
147 "renderer/test_runner/mock_screen_orientation_client.cc",
148 "renderer/test_runner/mock_screen_orientation_client.h",
[email protected]f656a652014-07-25 12:19:52149 "renderer/test_runner/mock_spell_check.cc",
150 "renderer/test_runner/mock_spell_check.h",
[email protected]6b9028ab2014-07-23 17:15:38151 "renderer/test_runner/mock_web_audio_device.cc",
152 "renderer/test_runner/mock_web_audio_device.h",
[email protected]85afb6c2014-07-29 02:43:36153 "renderer/test_runner/mock_web_media_stream_center.cc",
154 "renderer/test_runner/mock_web_media_stream_center.h",
[email protected]6b950c32014-07-28 14:35:43155 "renderer/test_runner/mock_web_midi_accessor.cc",
156 "renderer/test_runner/mock_web_midi_accessor.h",
[email protected]6b9028ab2014-07-23 17:15:38157 "renderer/test_runner/mock_web_push_client.cc",
158 "renderer/test_runner/mock_web_push_client.h",
[email protected]ca35ef02014-07-31 11:46:49159 "renderer/test_runner/mock_web_speech_recognizer.cc",
160 "renderer/test_runner/mock_web_speech_recognizer.h",
[email protected]6b9028ab2014-07-23 17:15:38161 "renderer/test_runner/mock_web_theme_engine.cc",
162 "renderer/test_runner/mock_web_theme_engine.h",
[email protected]c92e06462014-07-26 21:24:22163 "renderer/test_runner/mock_web_theme_engine_mac.h",
164 "renderer/test_runner/mock_web_theme_engine_mac.mm",
[email protected]6b9028ab2014-07-23 17:15:38165 "renderer/test_runner/mock_web_user_media_client.cc",
166 "renderer/test_runner/mock_web_user_media_client.h",
167 "renderer/test_runner/mock_webrtc_data_channel_handler.cc",
168 "renderer/test_runner/mock_webrtc_data_channel_handler.h",
169 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc",
170 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.h",
171 "renderer/test_runner/mock_webrtc_peer_connection_handler.cc",
172 "renderer/test_runner/mock_webrtc_peer_connection_handler.h",
173 "renderer/test_runner/notification_presenter.cc",
174 "renderer/test_runner/notification_presenter.h",
[email protected]b38c8f312014-08-01 23:21:37175 "renderer/test_runner/spell_check_client.cc",
176 "renderer/test_runner/spell_check_client.h",
[email protected]f5b1ad882014-08-05 16:30:41177 "renderer/test_runner/test_common.cc",
178 "renderer/test_runner/test_common.h",
[email protected]8ed8bf432014-08-11 19:47:55179 "renderer/test_runner/test_interfaces.cc",
180 "renderer/test_runner/test_interfaces.h",
[email protected]6b9028ab2014-07-23 17:15:38181 "renderer/test_runner/test_runner.cc",
182 "renderer/test_runner/test_runner.h",
183 "renderer/test_runner/text_input_controller.cc",
184 "renderer/test_runner/text_input_controller.h",
185 "renderer/test_runner/web_ax_object_proxy.cc",
186 "renderer/test_runner/web_ax_object_proxy.h",
187 "renderer/test_runner/web_frame_test_proxy.h",
188 "renderer/test_runner/web_permissions.cc",
189 "renderer/test_runner/web_permissions.h",
190 "renderer/test_runner/web_test_proxy.cc",
191 "renderer/test_runner/web_test_proxy.h",
192 "renderer/test_runner/web_test_runner.h",
193 "renderer/webkit_test_runner.cc",
194 "renderer/webkit_test_runner.h",
195 ]
196
197 defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ]
198
199 deps = [
200 ":resources",
201 "//base",
202 "//base:base_static",
203 "//base/allocator",
204 "//base/third_party/dynamic_annotations",
205 "//cc",
[email protected]adf0e222014-07-23 22:09:51206 "//components/breakpad/app",
[email protected]6b9028ab2014-07-23 17:15:38207 "//content:resources",
[email protected]0e043592014-07-28 19:47:04208 "//content/app:both",
[email protected]6586a2e32014-08-09 19:24:12209 "//content/app/strings",
[email protected]6b9028ab2014-07-23 17:15:38210 "//content/gpu",
211 "//content/ppapi_plugin",
212 "//content/public/browser",
213 "//content/public/common",
214 "//content/public/plugin",
215 "//content/public/renderer",
216 "//content/public/utility",
[email protected]6b9028ab2014-07-23 17:15:38217 "//content/test:layouttest_support",
218 "//gin",
219 "//gpu",
220 "//ipc",
221 "//media",
222 "//net",
223 "//net:net_resources",
224 "//skia",
[email protected]6b9028ab2014-07-23 17:15:38225 "//third_party/WebKit/public:blink",
[email protected]4eebe74d2014-08-13 02:54:46226 "//third_party/WebKit/public:resources",
[email protected]0e043592014-07-28 19:47:04227 "//third_party/WebKit/public:test_support",
[email protected]4eebe74d2014-08-13 02:54:46228 "//third_party/icu",
[email protected]6b9028ab2014-07-23 17:15:38229 "//ui/base",
230 "//ui/events:events_base",
231 "//ui/gfx",
232 "//ui/gfx/geometry",
233 "//ui/gfx/ipc",
234 "//ui/gl",
235 "//url",
236 "//v8",
[email protected]6b9028ab2014-07-23 17:15:38237 "//webkit/browser:storage",
[email protected]4eebe74d2014-08-13 02:54:46238 "//webkit/glue/resources",
[email protected]6b9028ab2014-07-23 17:15:38239 #'copy_test_netscape_plugin', TODO(GYP)
[email protected]6b9028ab2014-07-23 17:15:38240 ]
241
242 if (is_win) {
[email protected]6b9028ab2014-07-23 17:15:38243 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP)
244
245 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
246 cflags = [ "/wd4267" ]
247 }
248
249 if (is_linux) {
250 configs += [ "//build/config/linux:fontconfig" ]
251 }
252
253 if (use_x11) {
[email protected]c7990dbf2014-07-23 22:35:10254 # Some tests rely on this tool at runtime. Note: it might be better if
255 # the tests that needed it had this as a dep instead of adding it here.
256 datadeps = [ "//tools/xdisplaycheck" ]
[email protected]6b9028ab2014-07-23 17:15:38257 }
258
259 if (is_android) {
260 #deps += [ 'content_shell_jni_headers' ] TODO(GYP)
261 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
262 }
263
264 if (is_posix && !is_mac && (!is_android || !is_android_webview_build)) {
[email protected]adf0e222014-07-23 22:09:51265 deps += [ "//components/breakpad/browser" ]
[email protected]6b9028ab2014-07-23 17:15:38266 }
267
268 if (use_aura) {
269 deps += [
270 "//ui/aura",
271 "//ui/aura:test_support",
272 "//ui/events",
273 "//ui/strings",
274 "//ui/wm",
275 ]
276
277 if (toolkit_views) {
278 sources += [ "browser/shell_views.cc" ]
279 deps += [
280 "//ui/resources",
281 "//ui/views/controls/webview",
282 "//ui/views",
283 "//ui/views:test_support",
284 ]
285 } else {
286 sources += [ "browser/shell_aura.cc" ]
287 }
288 }
289
290 # The test plugin relies on X11.
291 if (is_linux && !use_x11) {
292 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
293 }
294
295 if (is_chromeos) {
296 deps += [
297 "//ui/wm:test_support",
298 #'../chromeos/chromeos.gyp:chromeos', TODO(GYP)
299 ]
300 }
301
302 if (is_linux) {
303 deps += [ "//third_party/freetype2" ]
304 }
305
306 if (!enable_plugins) {
307 sources -= [
308 "browser/shell_plugin_service_filter.cc",
309 "browser/shell_plugin_service_filter.h",
310 ]
311 }
312}
313
314grit("content_shell_resources_grit") {
315 visibility = ":*"
316 source = "shell_resources.grd"
317 outputs = [
318 "grit/shell_resources.h",
319 "shell_resources.pak",
320 "shell_resources.rc",
321 ]
322}
323
324copy("copy_shell_resources") {
325 sources = [ "$target_gen_dir/shell_resources.pak" ]
326 outputs = [ "$root_out_dir/shell_resources.pak" ]
327
328 deps = [ ":content_shell_resources_grit" ]
329 forward_dependent_configs_from = [ ":content_shell_resources_grit" ]
330}
331
332# Font copies.
333if (!is_mac) {
334 copy("copy_ahem") {
335 visibility = ":*"
336 sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
337 outputs = [ "$root_out_dir/AHEM____.TTF" ]
338 }
339}
340if (use_x11) {
341 copy("copy_x11_fonts") {
342 visibility = ":*"
343 sources = [
344 "renderer/test_runner/resources/fonts/fonts.conf",
345 "//third_party/gardiner_mod/GardinerModBug.ttf",
346 "//third_party/gardiner_mod/GardinerModCat.ttf",
347 ]
348 outputs = [ "$root_out_dir/{{source_file_part}}" ]
349 }
350}
351if (is_android) {
352 copy("copy_android_fonts") {
353 visibility = ":*"
354 sources = [
355 "renderer/test_runner/resources/fonts/android_main_fonts.xml",
356 "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
357 ]
358 outputs = [ "$root_out_dir/{{source_file_part}}" ]
359 }
360}
361
362group("resources") {
363 deps = [
364 ":copy_shell_resources",
365 ]
366 forward_dependent_configs_from = [ ":copy_shell_resources" ]
367
368 if (is_mac) {
369 # TODO(GYP) Mac bundle resources.
370 #'all_dependent_settings': {
371 # 'mac_bundle_resources': [
372 # 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
373 # 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
374 # '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
375 # '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
376 # ],
377 #},
378 } else {
379 deps += [ ":copy_ahem" ]
380 }
381
382 if (use_x11) {
383 deps += [ ":copy_x11_fonts" ]
384 }
385 if (is_android) {
386 deps += [ ":copy_android_fonts" ]
387 }
388}
389
390repack("pak") {
391 sources = [
[email protected]6586a2e32014-08-09 19:24:12392 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
[email protected]6b9028ab2014-07-23 17:15:38393 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
[email protected]6586a2e32014-08-09 19:24:12394 "$root_gen_dir/content/content_resources.pak",
[email protected]6b9028ab2014-07-23 17:15:38395 "$root_gen_dir/content/shell/shell_resources.pak",
396 "$root_gen_dir/net/net_resources.pak",
397 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
398 "$root_gen_dir/ui/resources/webui_resources.pak",
399 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
400 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
401 "$root_gen_dir/webkit/blink_resources.pak",
402 "$root_gen_dir/webkit/webkit_resources_100_percent.pak",
[email protected]6b9028ab2014-07-23 17:15:38403 ]
404
405 deps = [
406 ":resources",
407 "//content:resources",
[email protected]6586a2e32014-08-09 19:24:12408 "//content/app/strings",
[email protected]6b9028ab2014-07-23 17:15:38409 "//content/browser/tracing:resources",
410 "//net:net_resources",
[email protected]4eebe74d2014-08-13 02:54:46411 "//third_party/WebKit/public:resources",
[email protected]6b9028ab2014-07-23 17:15:38412 "//ui/resources",
413 "//ui/strings",
[email protected]4eebe74d2014-08-13 02:54:46414 "//webkit/glue/resources",
[email protected]6b9028ab2014-07-23 17:15:38415 ]
416
417 if (is_android) {
418 output = "$root_out_dir/content_shell/assets/content_shell.pak"
419 } else {
420 sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
421 deps += [ "//content/browser/devtools:resources" ]
422 output = "$root_out_dir/content_shell.pak"
423 }
424}
425
[email protected]6b9028ab2014-07-23 17:15:38426executable("content_shell") {
427 # TODO(GYP) mac resource bundle stuff for this target.
428 # TODO(GYP) Windows content shell settings:
429 # - Manifest.
430 # - RC file.
431 # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
432 sources = [
433 "../app/startup_helper_win.cc",
434 "app/shell_main.cc",
435 ]
436
437 deps = [
438 ":content_shell_lib",
439 ":pak",
440 "//base/allocator",
[email protected]c7990dbf2014-07-23 22:35:10441 "//third_party/mesa:osmesa",
[email protected]6b9028ab2014-07-23 17:15:38442 ]
443
444 if (is_win) {
[email protected]086370372014-07-29 21:23:58445 deps += [ "//sandbox" ]
[email protected]6b9028ab2014-07-23 17:15:38446 if (!is_asan) {
447 configs -= [ "//build/config/win:console" ]
448 configs += [ "//build/config/win:windowed" ]
449 }
450 }
451
452 if (is_mac) {
453 # TODO(GYP) lots of stuff from GYP file here.
454 }
455
456 if (!is_android || !is_android_webview_build) {
[email protected]938c54d2014-07-23 21:15:14457 # Some tests rely on this tool. It might be nicer if these tests relied on
458 # image diff rather than having content shell depend on it.
459 datadeps = [
460 "//tools/imagediff($host_toolchain)",
[email protected]6b9028ab2014-07-23 17:15:38461 ]
462 }
463}