blob: b3fb27b6f0014bd11967406c324ee04fb7819d56 [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",
rseseka0a7a042014-09-18 23:59:2031 "app/shell_crash_reporter_client.cc",
32 "app/shell_crash_reporter_client.h",
[email protected]6b9028ab2014-07-23 17:15:3833 "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/WebTestDelegate.h",
134 "renderer/test_runner/WebTestInterfaces.cpp",
135 "renderer/test_runner/WebTestInterfaces.h",
[email protected]6b9028ab2014-07-23 17:15:38136 "renderer/test_runner/accessibility_controller.cc",
137 "renderer/test_runner/accessibility_controller.h",
138 "renderer/test_runner/event_sender.cc",
139 "renderer/test_runner/event_sender.h",
140 "renderer/test_runner/gamepad_controller.cc",
141 "renderer/test_runner/gamepad_controller.h",
[email protected]0e043592014-07-28 19:47:04142 "renderer/test_runner/mock_color_chooser.cc",
143 "renderer/test_runner/mock_color_chooser.h",
[email protected]6b9028ab2014-07-23 17:15:38144 "renderer/test_runner/mock_constraints.cc",
145 "renderer/test_runner/mock_constraints.h",
mkwst41667ab2014-09-16 06:52:43146 "renderer/test_runner/mock_credential_manager_client.cc",
147 "renderer/test_runner/mock_credential_manager_client.h",
[email protected]6b9028ab2014-07-23 17:15:38148 "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",
abhishek.a21ab71acb2014-09-12 16:46:31195 "renderer/test_runner/web_task.cc",
196 "renderer/test_runner/web_task.h",
[email protected]6b9028ab2014-07-23 17:15:38197 "renderer/test_runner/web_test_proxy.cc",
198 "renderer/test_runner/web_test_proxy.h",
199 "renderer/test_runner/web_test_runner.h",
200 "renderer/webkit_test_runner.cc",
201 "renderer/webkit_test_runner.h",
202 ]
203
204 defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ]
205
206 deps = [
207 ":resources",
208 "//base",
209 "//base:base_static",
210 "//base/allocator",
211 "//base/third_party/dynamic_annotations",
212 "//cc",
Robert Sesekabcd8102014-08-27 16:12:44213 "//components/crash/app",
hanxi149b92d2014-09-11 21:57:18214 "//components/web_cache/renderer",
[email protected]6b9028ab2014-07-23 17:15:38215 "//content:resources",
[email protected]a9ca8d52014-08-22 10:21:08216 "//content/app/resources",
[email protected]6586a2e32014-08-09 19:24:12217 "//content/app/strings",
[email protected]6b9028ab2014-07-23 17:15:38218 "//content/gpu",
Brett Wilson8f1323042014-09-11 16:58:56219 "//content/public/app:both",
[email protected]6b9028ab2014-07-23 17:15:38220 "//content/public/browser",
221 "//content/public/common",
222 "//content/public/plugin",
223 "//content/public/renderer",
224 "//content/public/utility",
[email protected]6b9028ab2014-07-23 17:15:38225 "//content/test:layouttest_support",
226 "//gin",
227 "//gpu",
228 "//ipc",
229 "//media",
230 "//net",
231 "//net:net_resources",
232 "//skia",
pilgrim4af8c212014-09-05 17:30:15233 "//storage/browser",
[email protected]6b9028ab2014-07-23 17:15:38234 "//third_party/WebKit/public:blink",
[email protected]4eebe74d2014-08-13 02:54:46235 "//third_party/WebKit/public:resources",
[email protected]0e043592014-07-28 19:47:04236 "//third_party/WebKit/public:test_support",
[email protected]4eebe74d2014-08-13 02:54:46237 "//third_party/icu",
[email protected]6b9028ab2014-07-23 17:15:38238 "//ui/base",
239 "//ui/events:events_base",
240 "//ui/gfx",
241 "//ui/gfx/geometry",
242 "//ui/gfx/ipc",
243 "//ui/gl",
244 "//url",
245 "//v8",
[email protected]6b9028ab2014-07-23 17:15:38246 #'copy_test_netscape_plugin', TODO(GYP)
[email protected]6b9028ab2014-07-23 17:15:38247 ]
jamesr50081742014-09-09 07:52:22248 if (enable_plugins) {
249 deps += [ "//content/ppapi_plugin" ]
250 }
[email protected]6b9028ab2014-07-23 17:15:38251
252 if (is_win) {
[email protected]6b9028ab2014-07-23 17:15:38253 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP)
254
255 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
256 cflags = [ "/wd4267" ]
257 }
258
259 if (is_linux) {
260 configs += [ "//build/config/linux:fontconfig" ]
261 }
262
263 if (use_x11) {
[email protected]c7990dbf2014-07-23 22:35:10264 # Some tests rely on this tool at runtime. Note: it might be better if
265 # the tests that needed it had this as a dep instead of adding it here.
266 datadeps = [ "//tools/xdisplaycheck" ]
[email protected]6b9028ab2014-07-23 17:15:38267 }
268
269 if (is_android) {
James Robinson060f2e32014-09-10 22:31:37270 deps += [ "//content/shell/android:content_shell_jni_headers" ]
cjhopmancd7694af2014-09-08 00:00:04271 #deps -= [ "copy_test_netscape_plugin" ] TODO(GYP)
[email protected]6b9028ab2014-07-23 17:15:38272 }
273
274 if (is_posix && !is_mac && (!is_android || !is_android_webview_build)) {
Robert Sesekabcd8102014-08-27 16:12:44275 deps += [ "//components/crash/browser" ]
[email protected]6b9028ab2014-07-23 17:15:38276 }
277
278 if (use_aura) {
279 deps += [
280 "//ui/aura",
281 "//ui/aura:test_support",
282 "//ui/events",
283 "//ui/strings",
284 "//ui/wm",
285 ]
286
287 if (toolkit_views) {
288 sources += [ "browser/shell_views.cc" ]
289 deps += [
290 "//ui/resources",
291 "//ui/views/controls/webview",
292 "//ui/views",
293 "//ui/views:test_support",
294 ]
295 } else {
296 sources += [ "browser/shell_aura.cc" ]
297 }
James Robinson060f2e32014-09-10 22:31:37298 } else {
299 sources -= [
300 "browser/shell_platform_data_aura.cc",
301 "browser/shell_platform_data_aura.h",
302 ]
[email protected]6b9028ab2014-07-23 17:15:38303 }
304
305 # The test plugin relies on X11.
306 if (is_linux && !use_x11) {
307 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
308 }
309
310 if (is_chromeos) {
311 deps += [
312 "//ui/wm:test_support",
313 #'../chromeos/chromeos.gyp:chromeos', TODO(GYP)
314 ]
315 }
316
317 if (is_linux) {
318 deps += [ "//third_party/freetype2" ]
319 }
320
321 if (!enable_plugins) {
322 sources -= [
323 "browser/shell_plugin_service_filter.cc",
324 "browser/shell_plugin_service_filter.h",
325 ]
326 }
327}
328
329grit("content_shell_resources_grit") {
brettw9af42622014-09-06 21:21:02330 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38331 source = "shell_resources.grd"
332 outputs = [
333 "grit/shell_resources.h",
334 "shell_resources.pak",
335 "shell_resources.rc",
336 ]
337}
338
339copy("copy_shell_resources") {
340 sources = [ "$target_gen_dir/shell_resources.pak" ]
341 outputs = [ "$root_out_dir/shell_resources.pak" ]
342
343 deps = [ ":content_shell_resources_grit" ]
344 forward_dependent_configs_from = [ ":content_shell_resources_grit" ]
345}
346
347# Font copies.
348if (!is_mac) {
349 copy("copy_ahem") {
brettw9af42622014-09-06 21:21:02350 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38351 sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
352 outputs = [ "$root_out_dir/AHEM____.TTF" ]
353 }
354}
355if (use_x11) {
356 copy("copy_x11_fonts") {
brettw9af42622014-09-06 21:21:02357 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38358 sources = [
359 "renderer/test_runner/resources/fonts/fonts.conf",
360 "//third_party/gardiner_mod/GardinerModBug.ttf",
361 "//third_party/gardiner_mod/GardinerModCat.ttf",
362 ]
363 outputs = [ "$root_out_dir/{{source_file_part}}" ]
364 }
365}
366if (is_android) {
367 copy("copy_android_fonts") {
brettw9af42622014-09-06 21:21:02368 visibility = [ ":*" ]
[email protected]6b9028ab2014-07-23 17:15:38369 sources = [
370 "renderer/test_runner/resources/fonts/android_main_fonts.xml",
371 "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
372 ]
373 outputs = [ "$root_out_dir/{{source_file_part}}" ]
374 }
375}
376
377group("resources") {
378 deps = [
379 ":copy_shell_resources",
380 ]
381 forward_dependent_configs_from = [ ":copy_shell_resources" ]
382
383 if (is_mac) {
384 # TODO(GYP) Mac bundle resources.
385 #'all_dependent_settings': {
386 # 'mac_bundle_resources': [
387 # 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
388 # 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
389 # '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
390 # '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
391 # ],
392 #},
393 } else {
394 deps += [ ":copy_ahem" ]
395 }
396
397 if (use_x11) {
398 deps += [ ":copy_x11_fonts" ]
399 }
400 if (is_android) {
401 deps += [ ":copy_android_fonts" ]
402 }
403}
404
405repack("pak") {
406 sources = [
[email protected]48885492014-08-13 11:22:41407 "$root_gen_dir/blink/public/resources/blink_resources.pak",
[email protected]a9ca8d52014-08-22 10:21:08408 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
[email protected]6586a2e32014-08-09 19:24:12409 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
[email protected]6b9028ab2014-07-23 17:15:38410 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
[email protected]6586a2e32014-08-09 19:24:12411 "$root_gen_dir/content/content_resources.pak",
[email protected]6b9028ab2014-07-23 17:15:38412 "$root_gen_dir/content/shell/shell_resources.pak",
413 "$root_gen_dir/net/net_resources.pak",
414 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
415 "$root_gen_dir/ui/resources/webui_resources.pak",
416 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
417 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
[email protected]6b9028ab2014-07-23 17:15:38418 ]
419
420 deps = [
421 ":resources",
422 "//content:resources",
[email protected]a9ca8d52014-08-22 10:21:08423 "//content/app/resources",
[email protected]6586a2e32014-08-09 19:24:12424 "//content/app/strings",
[email protected]6b9028ab2014-07-23 17:15:38425 "//content/browser/tracing:resources",
426 "//net:net_resources",
[email protected]4eebe74d2014-08-13 02:54:46427 "//third_party/WebKit/public:resources",
[email protected]6b9028ab2014-07-23 17:15:38428 "//ui/resources",
429 "//ui/strings",
[email protected]6b9028ab2014-07-23 17:15:38430 ]
431
432 if (is_android) {
433 output = "$root_out_dir/content_shell/assets/content_shell.pak"
434 } else {
435 sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
436 deps += [ "//content/browser/devtools:resources" ]
437 output = "$root_out_dir/content_shell.pak"
438 }
439}
440
James Robinson060f2e32014-09-10 22:31:37441# TODO(GYP): Figure out what this should be on android
442if (!is_android) {
443
[email protected]6b9028ab2014-07-23 17:15:38444executable("content_shell") {
Brett Wilson8f80ad0b2014-09-08 19:50:24445 testonly = true
[email protected]6b9028ab2014-07-23 17:15:38446 # TODO(GYP) mac resource bundle stuff for this target.
447 # TODO(GYP) Windows content shell settings:
448 # - Manifest.
449 # - RC file.
450 # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
451 sources = [
452 "../app/startup_helper_win.cc",
453 "app/shell_main.cc",
454 ]
455
456 deps = [
457 ":content_shell_lib",
458 ":pak",
459 "//base/allocator",
[email protected]6b9028ab2014-07-23 17:15:38460 ]
461
462 if (is_win) {
[email protected]086370372014-07-29 21:23:58463 deps += [ "//sandbox" ]
[email protected]6b9028ab2014-07-23 17:15:38464 if (!is_asan) {
465 configs -= [ "//build/config/win:console" ]
466 configs += [ "//build/config/win:windowed" ]
467 }
468 }
469
470 if (is_mac) {
471 # TODO(GYP) lots of stuff from GYP file here.
472 }
473
James Robinson060f2e32014-09-10 22:31:37474 if (is_android && !is_android_webview_build) {
[email protected]938c54d2014-07-23 21:15:14475 # Some tests rely on this tool. It might be nicer if these tests relied on
476 # image diff rather than having content shell depend on it.
477 datadeps = [
478 "//tools/imagediff($host_toolchain)",
[email protected]6b9028ab2014-07-23 17:15:38479 ]
480 }
481}
James Robinson060f2e32014-09-10 22:31:37482
483}