blob: ee7dccfc27ba4f1f228fa5da510f3ff7d0739f5a [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",
80 "browser/shell_platform_data_aura.cc",
81 "browser/shell_platform_data_aura.h",
82 "browser/shell_plugin_service_filter.cc",
83 "browser/shell_plugin_service_filter.h",
84 "browser/shell_quota_permission_context.cc",
85 "browser/shell_quota_permission_context.h",
86 "browser/shell_resource_dispatcher_host_delegate.cc",
87 "browser/shell_resource_dispatcher_host_delegate.h",
88 "browser/shell_speech_recognition_manager_delegate.cc",
89 "browser/shell_speech_recognition_manager_delegate.h",
90 "browser/shell_url_request_context_getter.cc",
91 "browser/shell_url_request_context_getter.h",
92 "browser/shell_web_contents_view_delegate_android.cc",
93 "browser/shell_web_contents_view_delegate_creator.h",
94 "browser/shell_web_contents_view_delegate.h",
95 "browser/shell_web_contents_view_delegate_mac.mm",
96 "browser/shell_web_contents_view_delegate_win.cc",
97 "browser/webkit_test_controller.cc",
98 "browser/webkit_test_controller.h",
99 "common/leak_detection_result.h",
100 "common/shell_content_client.cc",
101 "common/shell_content_client.h",
102 "common/shell_messages.cc",
103 "common/shell_messages.h",
104 "common/shell_switches.cc",
105 "common/shell_switches.h",
106 "common/shell_test_configuration.cc",
107 "common/shell_test_configuration.h",
108 "common/test_runner/test_preferences.cc",
109 "common/test_runner/test_preferences.h",
110 "common/webkit_test_helpers.cc",
111 "common/webkit_test_helpers.h",
112 "geolocation/shell_access_token_store.cc",
113 "geolocation/shell_access_token_store.h",
114 "renderer/gc_controller.cc",
115 "renderer/gc_controller.h",
116 "renderer/leak_detector.cc",
117 "renderer/leak_detector.h",
118 "renderer/shell_content_renderer_client.cc",
119 "renderer/shell_content_renderer_client.h",
120 "renderer/shell_render_frame_observer.cc",
121 "renderer/shell_render_frame_observer.h",
122 "renderer/shell_render_process_observer.cc",
123 "renderer/shell_render_process_observer.h",
124 "renderer/shell_render_view_observer.cc",
125 "renderer/shell_render_view_observer.h",
[email protected]6b9028ab2014-07-23 17:15:38126 "renderer/test_runner/MockWebSpeechRecognizer.cpp",
127 "renderer/test_runner/MockWebSpeechRecognizer.h",
128 "renderer/test_runner/SpellCheckClient.cpp",
129 "renderer/test_runner/SpellCheckClient.h",
130 "renderer/test_runner/TestCommon.cpp",
131 "renderer/test_runner/TestCommon.h",
132 "renderer/test_runner/TestInterfaces.cpp",
133 "renderer/test_runner/TestInterfaces.h",
134 "renderer/test_runner/TestPlugin.cpp",
135 "renderer/test_runner/TestPlugin.h",
136 "renderer/test_runner/WebTask.cpp",
137 "renderer/test_runner/WebTask.h",
138 "renderer/test_runner/WebTestDelegate.h",
139 "renderer/test_runner/WebTestInterfaces.cpp",
140 "renderer/test_runner/WebTestInterfaces.h",
[email protected]6b9028ab2014-07-23 17:15:38141 "renderer/test_runner/accessibility_controller.cc",
142 "renderer/test_runner/accessibility_controller.h",
143 "renderer/test_runner/event_sender.cc",
144 "renderer/test_runner/event_sender.h",
145 "renderer/test_runner/gamepad_controller.cc",
146 "renderer/test_runner/gamepad_controller.h",
[email protected]0e043592014-07-28 19:47:04147 "renderer/test_runner/mock_color_chooser.cc",
148 "renderer/test_runner/mock_color_chooser.h",
[email protected]6b9028ab2014-07-23 17:15:38149 "renderer/test_runner/mock_constraints.cc",
150 "renderer/test_runner/mock_constraints.h",
151 "renderer/test_runner/mock_grammar_check.cc",
152 "renderer/test_runner/mock_grammar_check.h",
153 "renderer/test_runner/mock_screen_orientation_client.cc",
154 "renderer/test_runner/mock_screen_orientation_client.h",
[email protected]f656a652014-07-25 12:19:52155 "renderer/test_runner/mock_spell_check.cc",
156 "renderer/test_runner/mock_spell_check.h",
[email protected]6b9028ab2014-07-23 17:15:38157 "renderer/test_runner/mock_web_audio_device.cc",
158 "renderer/test_runner/mock_web_audio_device.h",
[email protected]85afb6c2014-07-29 02:43:36159 "renderer/test_runner/mock_web_media_stream_center.cc",
160 "renderer/test_runner/mock_web_media_stream_center.h",
[email protected]6b950c32014-07-28 14:35:43161 "renderer/test_runner/mock_web_midi_accessor.cc",
162 "renderer/test_runner/mock_web_midi_accessor.h",
[email protected]6b9028ab2014-07-23 17:15:38163 "renderer/test_runner/mock_web_push_client.cc",
164 "renderer/test_runner/mock_web_push_client.h",
165 "renderer/test_runner/mock_web_theme_engine.cc",
166 "renderer/test_runner/mock_web_theme_engine.h",
[email protected]c92e06462014-07-26 21:24:22167 "renderer/test_runner/mock_web_theme_engine_mac.h",
168 "renderer/test_runner/mock_web_theme_engine_mac.mm",
[email protected]6b9028ab2014-07-23 17:15:38169 "renderer/test_runner/mock_web_user_media_client.cc",
170 "renderer/test_runner/mock_web_user_media_client.h",
171 "renderer/test_runner/mock_webrtc_data_channel_handler.cc",
172 "renderer/test_runner/mock_webrtc_data_channel_handler.h",
173 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc",
174 "renderer/test_runner/mock_webrtc_dtmf_sender_handler.h",
175 "renderer/test_runner/mock_webrtc_peer_connection_handler.cc",
176 "renderer/test_runner/mock_webrtc_peer_connection_handler.h",
177 "renderer/test_runner/notification_presenter.cc",
178 "renderer/test_runner/notification_presenter.h",
179 "renderer/test_runner/test_runner.cc",
180 "renderer/test_runner/test_runner.h",
181 "renderer/test_runner/text_input_controller.cc",
182 "renderer/test_runner/text_input_controller.h",
183 "renderer/test_runner/web_ax_object_proxy.cc",
184 "renderer/test_runner/web_ax_object_proxy.h",
185 "renderer/test_runner/web_frame_test_proxy.h",
186 "renderer/test_runner/web_permissions.cc",
187 "renderer/test_runner/web_permissions.h",
188 "renderer/test_runner/web_test_proxy.cc",
189 "renderer/test_runner/web_test_proxy.h",
190 "renderer/test_runner/web_test_runner.h",
191 "renderer/webkit_test_runner.cc",
192 "renderer/webkit_test_runner.h",
193 ]
194
195 defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ]
196
197 deps = [
198 ":resources",
199 "//base",
200 "//base:base_static",
201 "//base/allocator",
202 "//base/third_party/dynamic_annotations",
203 "//cc",
[email protected]adf0e222014-07-23 22:09:51204 "//components/breakpad/app",
[email protected]6b9028ab2014-07-23 17:15:38205 "//content:resources",
[email protected]0e043592014-07-28 19:47:04206 "//content/app:both",
[email protected]6b9028ab2014-07-23 17:15:38207 "//content/gpu",
208 "//content/ppapi_plugin",
209 "//content/public/browser",
210 "//content/public/common",
211 "//content/public/plugin",
212 "//content/public/renderer",
213 "//content/public/utility",
[email protected]6b9028ab2014-07-23 17:15:38214 "//content/test:layouttest_support",
215 "//gin",
216 "//gpu",
217 "//ipc",
218 "//media",
219 "//net",
220 "//net:net_resources",
221 "//skia",
222 "//third_party/icu",
223 "//third_party/WebKit/public:blink",
[email protected]0e043592014-07-28 19:47:04224 "//third_party/WebKit/public:test_support",
[email protected]6b9028ab2014-07-23 17:15:38225 "//ui/base",
226 "//ui/events:events_base",
227 "//ui/gfx",
228 "//ui/gfx/geometry",
229 "//ui/gfx/ipc",
230 "//ui/gl",
231 "//url",
232 "//v8",
233 "//webkit:resources",
234 "//webkit/browser:storage",
[email protected]6b9028ab2014-07-23 17:15:38235 #'copy_test_netscape_plugin', TODO(GYP)
[email protected]6b9028ab2014-07-23 17:15:38236 ]
237
238 if (is_win) {
[email protected]6b9028ab2014-07-23 17:15:38239 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP)
240
241 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
242 cflags = [ "/wd4267" ]
243 }
244
245 if (is_linux) {
246 configs += [ "//build/config/linux:fontconfig" ]
247 }
248
249 if (use_x11) {
[email protected]c7990dbf2014-07-23 22:35:10250 # Some tests rely on this tool at runtime. Note: it might be better if
251 # the tests that needed it had this as a dep instead of adding it here.
252 datadeps = [ "//tools/xdisplaycheck" ]
[email protected]6b9028ab2014-07-23 17:15:38253 }
254
255 if (is_android) {
256 #deps += [ 'content_shell_jni_headers' ] TODO(GYP)
257 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
258 }
259
260 if (is_posix && !is_mac && (!is_android || !is_android_webview_build)) {
[email protected]adf0e222014-07-23 22:09:51261 deps += [ "//components/breakpad/browser" ]
[email protected]6b9028ab2014-07-23 17:15:38262 }
263
264 if (use_aura) {
265 deps += [
266 "//ui/aura",
267 "//ui/aura:test_support",
268 "//ui/events",
269 "//ui/strings",
270 "//ui/wm",
271 ]
272
273 if (toolkit_views) {
274 sources += [ "browser/shell_views.cc" ]
275 deps += [
276 "//ui/resources",
277 "//ui/views/controls/webview",
278 "//ui/views",
279 "//ui/views:test_support",
280 ]
281 } else {
282 sources += [ "browser/shell_aura.cc" ]
283 }
284 }
285
286 # The test plugin relies on X11.
287 if (is_linux && !use_x11) {
288 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
289 }
290
291 if (is_chromeos) {
292 deps += [
293 "//ui/wm:test_support",
294 #'../chromeos/chromeos.gyp:chromeos', TODO(GYP)
295 ]
296 }
297
298 if (is_linux) {
299 deps += [ "//third_party/freetype2" ]
300 }
301
302 if (!enable_plugins) {
303 sources -= [
304 "browser/shell_plugin_service_filter.cc",
305 "browser/shell_plugin_service_filter.h",
306 ]
307 }
308}
309
310grit("content_shell_resources_grit") {
311 visibility = ":*"
312 source = "shell_resources.grd"
313 outputs = [
314 "grit/shell_resources.h",
315 "shell_resources.pak",
316 "shell_resources.rc",
317 ]
318}
319
320copy("copy_shell_resources") {
321 sources = [ "$target_gen_dir/shell_resources.pak" ]
322 outputs = [ "$root_out_dir/shell_resources.pak" ]
323
324 deps = [ ":content_shell_resources_grit" ]
325 forward_dependent_configs_from = [ ":content_shell_resources_grit" ]
326}
327
328# Font copies.
329if (!is_mac) {
330 copy("copy_ahem") {
331 visibility = ":*"
332 sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
333 outputs = [ "$root_out_dir/AHEM____.TTF" ]
334 }
335}
336if (use_x11) {
337 copy("copy_x11_fonts") {
338 visibility = ":*"
339 sources = [
340 "renderer/test_runner/resources/fonts/fonts.conf",
341 "//third_party/gardiner_mod/GardinerModBug.ttf",
342 "//third_party/gardiner_mod/GardinerModCat.ttf",
343 ]
344 outputs = [ "$root_out_dir/{{source_file_part}}" ]
345 }
346}
347if (is_android) {
348 copy("copy_android_fonts") {
349 visibility = ":*"
350 sources = [
351 "renderer/test_runner/resources/fonts/android_main_fonts.xml",
352 "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
353 ]
354 outputs = [ "$root_out_dir/{{source_file_part}}" ]
355 }
356}
357
358group("resources") {
359 deps = [
360 ":copy_shell_resources",
361 ]
362 forward_dependent_configs_from = [ ":copy_shell_resources" ]
363
364 if (is_mac) {
365 # TODO(GYP) Mac bundle resources.
366 #'all_dependent_settings': {
367 # 'mac_bundle_resources': [
368 # 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
369 # 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
370 # '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
371 # '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
372 # ],
373 #},
374 } else {
375 deps += [ ":copy_ahem" ]
376 }
377
378 if (use_x11) {
379 deps += [ ":copy_x11_fonts" ]
380 }
381 if (is_android) {
382 deps += [ ":copy_android_fonts" ]
383 }
384}
385
386repack("pak") {
387 sources = [
388 "$root_gen_dir/content/content_resources.pak",
389 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
390 "$root_gen_dir/content/shell/shell_resources.pak",
391 "$root_gen_dir/net/net_resources.pak",
392 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
393 "$root_gen_dir/ui/resources/webui_resources.pak",
394 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
395 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
396 "$root_gen_dir/webkit/blink_resources.pak",
397 "$root_gen_dir/webkit/webkit_resources_100_percent.pak",
398 "$root_gen_dir/webkit/webkit_strings_en-US.pak",
399 ]
400
401 deps = [
402 ":resources",
403 "//content:resources",
404 "//content/browser/tracing:resources",
405 "//net:net_resources",
406 "//ui/resources",
407 "//ui/strings",
408 "//webkit:resources",
409 "//webkit:strings",
410 ]
411
412 if (is_android) {
413 output = "$root_out_dir/content_shell/assets/content_shell.pak"
414 } else {
415 sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
416 deps += [ "//content/browser/devtools:resources" ]
417 output = "$root_out_dir/content_shell.pak"
418 }
419}
420
[email protected]6b9028ab2014-07-23 17:15:38421executable("content_shell") {
422 # TODO(GYP) mac resource bundle stuff for this target.
423 # TODO(GYP) Windows content shell settings:
424 # - Manifest.
425 # - RC file.
426 # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
427 sources = [
428 "../app/startup_helper_win.cc",
429 "app/shell_main.cc",
430 ]
431
432 deps = [
433 ":content_shell_lib",
434 ":pak",
435 "//base/allocator",
[email protected]c7990dbf2014-07-23 22:35:10436 "//third_party/mesa:osmesa",
[email protected]6b9028ab2014-07-23 17:15:38437 ]
438
439 if (is_win) {
440 deps = [ "//sandbox" ]
441 if (!is_asan) {
442 configs -= [ "//build/config/win:console" ]
443 configs += [ "//build/config/win:windowed" ]
444 }
445 }
446
447 if (is_mac) {
448 # TODO(GYP) lots of stuff from GYP file here.
449 }
450
451 if (!is_android || !is_android_webview_build) {
[email protected]938c54d2014-07-23 21:15:14452 # Some tests rely on this tool. It might be nicer if these tests relied on
453 # image diff rather than having content shell depend on it.
454 datadeps = [
455 "//tools/imagediff($host_toolchain)",
[email protected]6b9028ab2014-07-23 17:15:38456 ]
457 }
458}