1 # 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.
5 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//tools/grit/repack.gni")
8 import("//tools/grit/grit_rule.gni")
10 import("//build/config/android/config.gni")
14 content_shell_product_name = "Content Shell"
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
19 content_shell_version = "19.77.34.5"
22 static_library("content_shell_lib") {
25 "android/shell_jni_registrar.cc",
26 "android/shell_jni_registrar.h",
27 "android/shell_manager.cc",
28 "android/shell_manager.h",
29 "app/blink_test_platform_support.h",
30 "app/blink_test_platform_support_android.cc",
31 "app/blink_test_platform_support_linux.cc",
32 "app/blink_test_platform_support_mac.mm",
33 "app/blink_test_platform_support_win.cc",
36 "app/shell_crash_reporter_client.cc",
37 "app/shell_crash_reporter_client.h",
38 "app/shell_main_delegate.cc",
39 "app/shell_main_delegate.h",
40 "app/shell_main_delegate_mac.h",
41 "app/shell_main_delegate_mac.mm",
42 "browser/blink_test_controller.cc",
43 "browser/blink_test_controller.h",
44 "browser/ipc_echo_message_filter.cc",
45 "browser/ipc_echo_message_filter.h",
46 "browser/layout_test/layout_test_android.cc",
47 "browser/layout_test/layout_test_android.h",
48 "browser/layout_test/layout_test_bluetooth_adapter_provider.cc",
49 "browser/layout_test/layout_test_bluetooth_adapter_provider.h",
50 "browser/layout_test/layout_test_browser_context.cc",
51 "browser/layout_test/layout_test_browser_context.h",
52 "browser/layout_test/layout_test_browser_main.cc",
53 "browser/layout_test/layout_test_browser_main.h",
54 "browser/layout_test/layout_test_browser_main_parts.cc",
55 "browser/layout_test/layout_test_browser_main_parts.h",
56 "browser/layout_test/layout_test_content_browser_client.cc",
57 "browser/layout_test/layout_test_content_browser_client.h",
58 "browser/layout_test/layout_test_devtools_frontend.cc",
59 "browser/layout_test/layout_test_devtools_frontend.h",
60 "browser/layout_test/layout_test_download_manager_delegate.cc",
61 "browser/layout_test/layout_test_download_manager_delegate.h",
62 "browser/layout_test/layout_test_javascript_dialog_manager.cc",
63 "browser/layout_test/layout_test_javascript_dialog_manager.h",
64 "browser/layout_test/layout_test_message_filter.cc",
65 "browser/layout_test/layout_test_message_filter.h",
66 "browser/layout_test/layout_test_navigator_connect_service_factory.cc",
67 "browser/layout_test/layout_test_navigator_connect_service_factory.h",
68 "browser/layout_test/layout_test_notification_manager.cc",
69 "browser/layout_test/layout_test_notification_manager.h",
70 "browser/layout_test/layout_test_permission_manager.cc",
71 "browser/layout_test/layout_test_permission_manager.h",
72 "browser/layout_test/layout_test_push_messaging_service.cc",
73 "browser/layout_test/layout_test_push_messaging_service.h",
74 "browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc",
75 "browser/layout_test/layout_test_resource_dispatcher_host_delegate.h",
76 "browser/layout_test/layout_test_url_request_context_getter.cc",
77 "browser/layout_test/layout_test_url_request_context_getter.h",
78 "browser/notify_done_forwarder.cc",
79 "browser/notify_done_forwarder.h",
82 "browser/shell_access_token_store.cc",
83 "browser/shell_access_token_store.h",
84 "browser/shell_android.cc",
85 "browser/shell_application_mac.h",
86 "browser/shell_application_mac.mm",
87 "browser/shell_browser_context.cc",
88 "browser/shell_browser_context.h",
89 "browser/shell_browser_main.cc",
90 "browser/shell_browser_main.h",
91 "browser/shell_browser_main_parts.cc",
92 "browser/shell_browser_main_parts.h",
93 "browser/shell_browser_main_parts_mac.mm",
94 "browser/shell_content_browser_client.cc",
95 "browser/shell_content_browser_client.h",
96 "browser/shell_devtools_frontend.cc",
97 "browser/shell_devtools_frontend.h",
98 "browser/shell_devtools_manager_delegate.cc",
99 "browser/shell_devtools_manager_delegate.h",
100 "browser/shell_download_manager_delegate.cc",
101 "browser/shell_download_manager_delegate.h",
102 "browser/shell_javascript_dialog.h",
103 "browser/shell_javascript_dialog_mac.mm",
104 "browser/shell_javascript_dialog_manager.cc",
105 "browser/shell_javascript_dialog_manager.h",
106 "browser/shell_javascript_dialog_win.cc",
107 "browser/shell_login_dialog.cc",
108 "browser/shell_login_dialog.h",
109 "browser/shell_login_dialog_mac.mm",
110 "browser/shell_mac.mm",
111 "browser/shell_mojo_test_utils_android.cc",
112 "browser/shell_mojo_test_utils_android.h",
113 "browser/shell_net_log.cc",
114 "browser/shell_net_log.h",
115 "browser/shell_network_delegate.cc",
116 "browser/shell_network_delegate.h",
117 "browser/shell_permission_manager.cc",
118 "browser/shell_permission_manager.h",
119 "browser/shell_platform_data_aura.cc",
120 "browser/shell_platform_data_aura.h",
121 "browser/shell_plugin_service_filter.cc",
122 "browser/shell_plugin_service_filter.h",
123 "browser/shell_quota_permission_context.cc",
124 "browser/shell_quota_permission_context.h",
125 "browser/shell_resource_dispatcher_host_delegate.cc",
126 "browser/shell_resource_dispatcher_host_delegate.h",
127 "browser/shell_speech_recognition_manager_delegate.cc",
128 "browser/shell_speech_recognition_manager_delegate.h",
129 "browser/shell_url_request_context_getter.cc",
130 "browser/shell_url_request_context_getter.h",
131 "browser/shell_web_contents_view_delegate.h",
132 "browser/shell_web_contents_view_delegate_android.cc",
133 "browser/shell_web_contents_view_delegate_creator.h",
134 "browser/shell_web_contents_view_delegate_mac.mm",
135 "browser/shell_web_contents_view_delegate_win.cc",
136 "common/layout_test/layout_test_messages.cc",
137 "common/layout_test/layout_test_messages.h",
138 "common/leak_detection_result.h",
139 "common/shell_content_client.cc",
140 "common/shell_content_client.h",
141 "common/shell_messages.cc",
142 "common/shell_messages.h",
143 "common/shell_switches.cc",
144 "common/shell_switches.h",
145 "common/shell_test_configuration.cc",
146 "common/shell_test_configuration.h",
147 "renderer/ipc_echo.cc",
148 "renderer/ipc_echo.h",
149 "renderer/layout_test/blink_test_helpers.cc",
150 "renderer/layout_test/blink_test_helpers.h",
151 "renderer/layout_test/blink_test_runner.cc",
152 "renderer/layout_test/blink_test_runner.h",
153 "renderer/layout_test/gc_controller.cc",
154 "renderer/layout_test/gc_controller.h",
155 "renderer/layout_test/layout_test_content_renderer_client.cc",
156 "renderer/layout_test/layout_test_content_renderer_client.h",
157 "renderer/layout_test/layout_test_render_frame_observer.cc",
158 "renderer/layout_test/layout_test_render_frame_observer.h",
159 "renderer/layout_test/layout_test_render_process_observer.cc",
160 "renderer/layout_test/layout_test_render_process_observer.h",
161 "renderer/layout_test/leak_detector.cc",
162 "renderer/layout_test/leak_detector.h",
163 "renderer/layout_test/test_media_stream_renderer_factory.cc",
164 "renderer/layout_test/test_media_stream_renderer_factory.h",
165 "renderer/layout_test/test_video_frame_provider.cc",
166 "renderer/layout_test/test_video_frame_provider.h",
167 "renderer/shell_content_renderer_client.cc",
168 "renderer/shell_content_renderer_client.h",
169 "renderer/shell_render_view_observer.cc",
170 "renderer/shell_render_view_observer.h",
171 "utility/shell_content_utility_client.cc",
172 "utility/shell_content_utility_client.h",
175 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
176 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
178 defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ]
181 # This exposes all public content APIs.
182 "//content/public/app:both",
183 "//content/public/browser",
184 "//content/public/common",
185 "//content/public/plugin",
186 "//content/public/renderer",
187 "//content/public/utility",
192 "//base:base_static",
194 "//base/third_party/dynamic_annotations",
196 "//components/crash/app",
197 "//components/devtools_discovery",
198 "//components/devtools_http_handler",
199 "//components/plugins/renderer",
200 "//components/test_runner:test_runner",
201 "//components/web_cache/renderer",
202 "//content:resources",
203 "//content/app/resources",
204 "//content/app/strings",
206 "//content/test:layouttest_support",
207 "//device/bluetooth",
208 "//device/bluetooth:mocks",
214 "//net:net_resources",
219 "//third_party/WebKit/public:blink",
220 "//third_party/WebKit/public:image_resources",
221 "//third_party/WebKit/public:resources",
222 "//third_party/WebKit/public:test_support",
226 "//ui/events:events_base",
234 #'copy_test_netscape_plugin', TODO(GYP)
236 if (enable_plugins) {
237 deps += [ "//content/ppapi_plugin" ]
241 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP)
243 "common/v8_breakpad_support_win.cc",
244 "common/v8_breakpad_support_win.h",
249 configs += [ "//build/config/linux:fontconfig" ]
253 # 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.
256 "//tools/xdisplaycheck",
259 deps += [ "//ui/events/devices" ]
263 deps += [ "//content/shell/android:content_shell_jni_headers" ]
264 #deps -= [ "copy_test_netscape_plugin" ] TODO(GYP)
267 if (is_posix && !is_mac) {
268 deps += [ "//components/crash/browser" ]
274 "//ui/aura:test_support",
281 sources += [ "browser/shell_views.cc" ]
284 "//ui/views/controls/webview",
286 "//ui/views:test_support",
289 sources += [ "browser/shell_aura.cc" ]
293 "browser/shell_platform_data_aura.cc",
294 "browser/shell_platform_data_aura.h",
298 # The test plugin relies on X11.
299 if (is_linux && !use_x11) {
300 #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP)
306 "//ui/wm:test_support",
311 deps += [ "//third_party/freetype2" ]
314 if (!enable_plugins) {
316 "browser/shell_plugin_service_filter.cc",
317 "browser/shell_plugin_service_filter.h",
322 grit("content_shell_resources_grit") {
323 visibility = [ ":*" ]
324 source = "shell_resources.grd"
326 "grit/shell_resources.h",
327 "shell_resources.pak",
328 "shell_resources.rc",
332 copy("copy_shell_resources") {
334 "$target_gen_dir/shell_resources.pak",
337 "$root_out_dir/shell_resources.pak",
341 ":content_shell_resources_grit",
347 ":copy_shell_resources",
350 "//components/test_runner:resources",
356 "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
357 "$root_gen_dir/blink/public/resources/blink_resources.pak",
358 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
359 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
360 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
361 "$root_gen_dir/content/content_resources.pak",
362 "$root_gen_dir/content/shell/shell_resources.pak",
363 "$root_gen_dir/net/net_resources.pak",
364 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
365 "$root_gen_dir/ui/resources/webui_resources.pak",
366 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
367 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
372 "//content:resources",
373 "//content/app/resources",
374 "//content/app/strings",
375 "//content/browser/tracing:resources",
376 "//net:net_resources",
377 "//third_party/WebKit/public:image_resources",
378 "//third_party/WebKit/public:resources",
384 deps += [ "//ui/views/resources" ]
386 [ "$root_gen_dir/ui/views/resources/views_resources_100_percent.pak" ]
389 sources += [ "$root_gen_dir/blink/devtools_resources.pak" ]
390 deps += [ "//content/browser/devtools:resources" ]
391 output = "$root_out_dir/content_shell.pak"
394 # TODO(GYP): Figure out what this should be on android
395 # and make linking this work on the Mac.
396 if (!is_android && !is_mac) {
397 executable("content_shell") {
400 # TODO(GYP) mac resource bundle stuff for this target.
401 # TODO(GYP) Windows content shell settings:
404 # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
410 ":content_shell_lib",
416 deps += [ "//sandbox" ]
418 configs -= [ "//build/config/win:console" ]
419 configs += [ "//build/config/win:windowed" ]
424 # TODO(GYP) lots of stuff from GYP file here.
428 # Some tests rely on this tool. It might be nicer if these tests relied on
429 # image diff rather than having content shell depend on it.
431 "//tools/imagediff($host_toolchain)",
436 group("content_shell") {
439 ":content_shell_lib",
445 # GYP version: content/content_shell_and_tests.gyp:content_shell_crash_service
446 executable("crash_service") {
448 "tools/content_shell_crash_service.cc",
453 "//components/crash/tools:crash_service",
456 configs -= [ "//build/config/win:console" ]
457 configs += [ "//build/config/win:windowed" ]