blob: 22df8689b68d17be6be22d26767cd43ea94cd54e [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",
225 "//third_party/icu",
226 "//third_party/WebKit/public:blink",
[email protected]0e043592014-07-28 19:47:04227 "//third_party/WebKit/public:test_support",
[email protected]6b9028ab2014-07-23 17:15:38228 "//ui/base",
229 "//ui/events:events_base",
230 "//ui/gfx",
231 "//ui/gfx/geometry",
232 "//ui/gfx/ipc",
233 "//ui/gl",
234 "//url",
235 "//v8",
236 "//webkit:resources",
237 "//webkit/browser:storage",
[email protected]6b9028ab2014-07-23 17:15:38238 #'copy_test_netscape_plugin', TODO(GYP)
[email protected]6b9028ab2014-07-23 17:15:38239 ]
240
241 if (is_win) {
[email protected]6b9028ab2014-07-23 17:15:38242 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP)
243
244 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
245 cflags = [ "/wd4267" ]
246 }
247
248 if (is_linux) {
249 configs += [ "//build/config/linux:fontconfig" ]
250 }
251
252 if (use_x11) {
[email protected]c7990dbf2014-07-23 22:35:10253 # Some tests rely on this tool at runtime. Note: it might be better if
254 # the tests that needed it had this as a dep instead of adding it here.
255 datadeps = [ "//tools/xdisplaycheck" ]
[email protected]6b9028ab2014-07-23 17:15:38256 }
257
258 if (is_android) {
259 #deps += [ 'content_shell_jni_headers' ] TODO(GYP)
260 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
261 }
262
263 if (is_posix && !is_mac && (!is_android || !is_android_webview_build)) {
[email protected]adf0e222014-07-23 22:09:51264 deps += [ "//components/breakpad/browser" ]
[email protected]6b9028ab2014-07-23 17:15:38265 }
266
267 if (use_aura) {
268 deps += [
269 "//ui/aura",
270 "//ui/aura:test_support",
271 "//ui/events",
272 "//ui/strings",
273 "//ui/wm",
274 ]
275
276 if (toolkit_views) {
277 sources += [ "browser/shell_views.cc" ]
278 deps += [
279 "//ui/resources",
280 "//ui/views/controls/webview",
281 "//ui/views",
282 "//ui/views:test_support",
283 ]
284 } else {
285 sources += [ "browser/shell_aura.cc" ]
286 }
287 }
288
289 # The test plugin relies on X11.
290 if (is_linux && !use_x11) {
291 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
292 }
293
294 if (is_chromeos) {
295 deps += [
296 "//ui/wm:test_support",
297 #'../chromeos/chromeos.gyp:chromeos', TODO(GYP)
298 ]
299 }
300
301 if (is_linux) {
302 deps += [ "//third_party/freetype2" ]
303 }
304
305 if (!enable_plugins) {
306 sources -= [
307 "browser/shell_plugin_service_filter.cc",
308 "browser/shell_plugin_service_filter.h",
309 ]
310 }
311}
312
313grit("content_shell_resources_grit") {
314 visibility = ":*"
315 source = "shell_resources.grd"
316 outputs = [
317 "grit/shell_resources.h",
318 "shell_resources.pak",
319 "shell_resources.rc",
320 ]
321}
322
323copy("copy_shell_resources") {
324 sources = [ "$target_gen_dir/shell_resources.pak" ]
325 outputs = [ "$root_out_dir/shell_resources.pak" ]
326
327 deps = [ ":content_shell_resources_grit" ]
328 forward_dependent_configs_from = [ ":content_shell_resources_grit" ]
329}
330
331# Font copies.
332if (!is_mac) {
333 copy("copy_ahem") {
334 visibility = ":*"
335 sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
336 outputs = [ "$root_out_dir/AHEM____.TTF" ]
337 }
338}
339if (use_x11) {
340 copy("copy_x11_fonts") {
341 visibility = ":*"
342 sources = [
343 "renderer/test_runner/resources/fonts/fonts.conf",
344 "//third_party/gardiner_mod/GardinerModBug.ttf",
345 "//third_party/gardiner_mod/GardinerModCat.ttf",
346 ]
347 outputs = [ "$root_out_dir/{{source_file_part}}" ]
348 }
349}
350if (is_android) {
351 copy("copy_android_fonts") {
352 visibility = ":*"
353 sources = [
354 "renderer/test_runner/resources/fonts/android_main_fonts.xml",
355 "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
356 ]
357 outputs = [ "$root_out_dir/{{source_file_part}}" ]
358 }
359}
360
361group("resources") {
362 deps = [
363 ":copy_shell_resources",
364 ]
365 forward_dependent_configs_from = [ ":copy_shell_resources" ]
366
367 if (is_mac) {
368 # TODO(GYP) Mac bundle resources.
369 #'all_dependent_settings': {
370 # 'mac_bundle_resources': [
371 # 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
372 # 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
373 # '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
374 # '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
375 # ],
376 #},
377 } else {
378 deps += [ ":copy_ahem" ]
379 }
380
381 if (use_x11) {
382 deps += [ ":copy_x11_fonts" ]
383 }
384 if (is_android) {
385 deps += [ ":copy_android_fonts" ]
386 }
387}
388
389repack("pak") {
390 sources = [
[email protected]6586a2e32014-08-09 19:24:12391 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
[email protected]6b9028ab2014-07-23 17:15:38392 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
[email protected]6586a2e32014-08-09 19:24:12393 "$root_gen_dir/content/content_resources.pak",
[email protected]6b9028ab2014-07-23 17:15:38394 "$root_gen_dir/content/shell/shell_resources.pak",
395 "$root_gen_dir/net/net_resources.pak",
396 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
397 "$root_gen_dir/ui/resources/webui_resources.pak",
398 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
399 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
400 "$root_gen_dir/webkit/blink_resources.pak",
401 "$root_gen_dir/webkit/webkit_resources_100_percent.pak",
[email protected]6b9028ab2014-07-23 17:15:38402 ]
403
404 deps = [
405 ":resources",
406 "//content:resources",
[email protected]6586a2e32014-08-09 19:24:12407 "//content/app/strings",
[email protected]6b9028ab2014-07-23 17:15:38408 "//content/browser/tracing:resources",
409 "//net:net_resources",
410 "//ui/resources",
411 "//ui/strings",
412 "//webkit:resources",
[email protected]6b9028ab2014-07-23 17:15:38413 ]
414
415 if (is_android) {
416 output = "$root_out_dir/content_shell/assets/content_shell.pak"
417 } else {
418 sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
419 deps += [ "//content/browser/devtools:resources" ]
420 output = "$root_out_dir/content_shell.pak"
421 }
422}
423
[email protected]6b9028ab2014-07-23 17:15:38424executable("content_shell") {
425 # TODO(GYP) mac resource bundle stuff for this target.
426 # TODO(GYP) Windows content shell settings:
427 # - Manifest.
428 # - RC file.
429 # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
430 sources = [
431 "../app/startup_helper_win.cc",
432 "app/shell_main.cc",
433 ]
434
435 deps = [
436 ":content_shell_lib",
437 ":pak",
438 "//base/allocator",
[email protected]c7990dbf2014-07-23 22:35:10439 "//third_party/mesa:osmesa",
[email protected]6b9028ab2014-07-23 17:15:38440 ]
441
442 if (is_win) {
[email protected]086370372014-07-29 21:23:58443 deps += [ "//sandbox" ]
[email protected]6b9028ab2014-07-23 17:15:38444 if (!is_asan) {
445 configs -= [ "//build/config/win:console" ]
446 configs += [ "//build/config/win:windowed" ]
447 }
448 }
449
450 if (is_mac) {
451 # TODO(GYP) lots of stuff from GYP file here.
452 }
453
454 if (!is_android || !is_android_webview_build) {
[email protected]938c54d2014-07-23 21:15:14455 # Some tests rely on this tool. It might be nicer if these tests relied on
456 # image diff rather than having content shell depend on it.
457 datadeps = [
458 "//tools/imagediff($host_toolchain)",
[email protected]6b9028ab2014-07-23 17:15:38459 ]
460 }
461}