[email protected] | 6b9028ab | 2014-07-23 17:15:38 | [diff] [blame] | 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. |
| 4 | |
| 5 | import("//build/config/features.gni") |
| 6 | import("//build/config/ui.gni") |
| 7 | import("//tools/grit/grit_rule.gni") |
| 8 | import("//tools/grit/repack.gni") |
| 9 | if (is_android) { |
| 10 | import("//build/config/android/config.gni") |
| 11 | } |
| 12 | |
| 13 | declare_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 | |
| 22 | static_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", |
| 126 | "renderer/test_runner/MockSpellCheck.cpp", |
| 127 | "renderer/test_runner/MockSpellCheck.h", |
| 128 | "renderer/test_runner/MockWebMIDIAccessor.cpp", |
| 129 | "renderer/test_runner/MockWebMIDIAccessor.h", |
| 130 | "renderer/test_runner/MockWebMediaStreamCenter.cpp", |
| 131 | "renderer/test_runner/MockWebMediaStreamCenter.h", |
| 132 | "renderer/test_runner/MockWebSpeechRecognizer.cpp", |
| 133 | "renderer/test_runner/MockWebSpeechRecognizer.h", |
| 134 | "renderer/test_runner/SpellCheckClient.cpp", |
| 135 | "renderer/test_runner/SpellCheckClient.h", |
| 136 | "renderer/test_runner/TestCommon.cpp", |
| 137 | "renderer/test_runner/TestCommon.h", |
| 138 | "renderer/test_runner/TestInterfaces.cpp", |
| 139 | "renderer/test_runner/TestInterfaces.h", |
| 140 | "renderer/test_runner/TestPlugin.cpp", |
| 141 | "renderer/test_runner/TestPlugin.h", |
| 142 | "renderer/test_runner/WebTask.cpp", |
| 143 | "renderer/test_runner/WebTask.h", |
| 144 | "renderer/test_runner/WebTestDelegate.h", |
| 145 | "renderer/test_runner/WebTestInterfaces.cpp", |
| 146 | "renderer/test_runner/WebTestInterfaces.h", |
| 147 | "renderer/test_runner/WebTestThemeEngineMac.h", |
| 148 | "renderer/test_runner/WebTestThemeEngineMac.mm", |
| 149 | "renderer/test_runner/accessibility_controller.cc", |
| 150 | "renderer/test_runner/accessibility_controller.h", |
| 151 | "renderer/test_runner/event_sender.cc", |
| 152 | "renderer/test_runner/event_sender.h", |
| 153 | "renderer/test_runner/gamepad_controller.cc", |
| 154 | "renderer/test_runner/gamepad_controller.h", |
| 155 | "renderer/test_runner/mock_constraints.cc", |
| 156 | "renderer/test_runner/mock_constraints.h", |
| 157 | "renderer/test_runner/mock_grammar_check.cc", |
| 158 | "renderer/test_runner/mock_grammar_check.h", |
| 159 | "renderer/test_runner/mock_screen_orientation_client.cc", |
| 160 | "renderer/test_runner/mock_screen_orientation_client.h", |
| 161 | "renderer/test_runner/mock_web_audio_device.cc", |
| 162 | "renderer/test_runner/mock_web_audio_device.h", |
| 163 | "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", |
| 167 | "renderer/test_runner/mock_web_user_media_client.cc", |
| 168 | "renderer/test_runner/mock_web_user_media_client.h", |
| 169 | "renderer/test_runner/mock_webrtc_data_channel_handler.cc", |
| 170 | "renderer/test_runner/mock_webrtc_data_channel_handler.h", |
| 171 | "renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc", |
| 172 | "renderer/test_runner/mock_webrtc_dtmf_sender_handler.h", |
| 173 | "renderer/test_runner/mock_webrtc_peer_connection_handler.cc", |
| 174 | "renderer/test_runner/mock_webrtc_peer_connection_handler.h", |
| 175 | "renderer/test_runner/notification_presenter.cc", |
| 176 | "renderer/test_runner/notification_presenter.h", |
| 177 | "renderer/test_runner/test_runner.cc", |
| 178 | "renderer/test_runner/test_runner.h", |
| 179 | "renderer/test_runner/text_input_controller.cc", |
| 180 | "renderer/test_runner/text_input_controller.h", |
| 181 | "renderer/test_runner/web_ax_object_proxy.cc", |
| 182 | "renderer/test_runner/web_ax_object_proxy.h", |
| 183 | "renderer/test_runner/web_frame_test_proxy.h", |
| 184 | "renderer/test_runner/web_permissions.cc", |
| 185 | "renderer/test_runner/web_permissions.h", |
| 186 | "renderer/test_runner/web_test_proxy.cc", |
| 187 | "renderer/test_runner/web_test_proxy.h", |
| 188 | "renderer/test_runner/web_test_runner.h", |
| 189 | "renderer/webkit_test_runner.cc", |
| 190 | "renderer/webkit_test_runner.h", |
| 191 | ] |
| 192 | |
| 193 | defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ] |
| 194 | |
| 195 | deps = [ |
| 196 | ":resources", |
| 197 | "//base", |
| 198 | "//base:base_static", |
| 199 | "//base/allocator", |
| 200 | "//base/third_party/dynamic_annotations", |
| 201 | "//cc", |
[email protected] | adf0e22 | 2014-07-23 22:09:51 | [diff] [blame^] | 202 | "//components/breakpad/app", |
[email protected] | 6b9028ab | 2014-07-23 17:15:38 | [diff] [blame] | 203 | "//content:resources", |
| 204 | "//content/gpu", |
| 205 | "//content/ppapi_plugin", |
| 206 | "//content/public/browser", |
| 207 | "//content/public/common", |
| 208 | "//content/public/plugin", |
| 209 | "//content/public/renderer", |
| 210 | "//content/public/utility", |
| 211 | "//content/worker", |
| 212 | "//content/test:layouttest_support", |
| 213 | "//gin", |
| 214 | "//gpu", |
| 215 | "//ipc", |
| 216 | "//media", |
| 217 | "//net", |
| 218 | "//net:net_resources", |
| 219 | "//skia", |
| 220 | "//third_party/icu", |
| 221 | "//third_party/WebKit/public:blink", |
| 222 | "//ui/base", |
| 223 | "//ui/events:events_base", |
| 224 | "//ui/gfx", |
| 225 | "//ui/gfx/geometry", |
| 226 | "//ui/gfx/ipc", |
| 227 | "//ui/gl", |
| 228 | "//url", |
| 229 | "//v8", |
| 230 | "//webkit:resources", |
| 231 | "//webkit/browser:storage", |
| 232 | #'content.gyp:content_app_both', TODO(GYP) |
| 233 | #'copy_test_netscape_plugin', TODO(GYP) |
[email protected] | 6b9028ab | 2014-07-23 17:15:38 | [diff] [blame] | 234 | #'../third_party/WebKit/public/blink.gyp:blink_test_support', TODO(GYP) |
| 235 | ] |
| 236 | |
| 237 | if (is_win) { |
| 238 | configs -= [ "//build/config/win:console" ] |
| 239 | configs += [ "//build/config/win:windowed" ] |
| 240 | deps += [ "//webkit/resources" ] |
| 241 | #'LinkIncremental': '<(msvs_large_module_debug_link_mode)', TODO(GYP) |
| 242 | |
| 243 | # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 244 | cflags = [ "/wd4267" ] |
| 245 | } |
| 246 | |
| 247 | if (is_linux) { |
| 248 | configs += [ "//build/config/linux:fontconfig" ] |
| 249 | } |
| 250 | |
| 251 | if (use_x11) { |
| 252 | # TODO(GYP) The GYP build includes a dep on the xdisplaycheck executable. |
| 253 | # Track down who added this and ask them if it's necessary, since this |
| 254 | # seems suspicious. |
| 255 | } |
| 256 | |
| 257 | if (is_android) { |
| 258 | #deps += [ 'content_shell_jni_headers' ] TODO(GYP) |
| 259 | #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP) |
| 260 | } |
| 261 | |
| 262 | if (is_posix && !is_mac && (!is_android || !is_android_webview_build)) { |
[email protected] | adf0e22 | 2014-07-23 22:09:51 | [diff] [blame^] | 263 | deps += [ "//components/breakpad/browser" ] |
[email protected] | 6b9028ab | 2014-07-23 17:15:38 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | if (use_aura) { |
| 267 | deps += [ |
| 268 | "//ui/aura", |
| 269 | "//ui/aura:test_support", |
| 270 | "//ui/events", |
| 271 | "//ui/strings", |
| 272 | "//ui/wm", |
| 273 | ] |
| 274 | |
| 275 | if (toolkit_views) { |
| 276 | sources += [ "browser/shell_views.cc" ] |
| 277 | deps += [ |
| 278 | "//ui/resources", |
| 279 | "//ui/views/controls/webview", |
| 280 | "//ui/views", |
| 281 | "//ui/views:test_support", |
| 282 | ] |
| 283 | } else { |
| 284 | sources += [ "browser/shell_aura.cc" ] |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | # The test plugin relies on X11. |
| 289 | if (is_linux && !use_x11) { |
| 290 | #deps -= [ 'copy_test_netscape_plugin' ] TODO(GYP) |
| 291 | } |
| 292 | |
| 293 | if (is_chromeos) { |
| 294 | deps += [ |
| 295 | "//ui/wm:test_support", |
| 296 | #'../chromeos/chromeos.gyp:chromeos', TODO(GYP) |
| 297 | ] |
| 298 | } |
| 299 | |
| 300 | if (is_linux) { |
| 301 | deps += [ "//third_party/freetype2" ] |
| 302 | } |
| 303 | |
| 304 | if (!enable_plugins) { |
| 305 | sources -= [ |
| 306 | "browser/shell_plugin_service_filter.cc", |
| 307 | "browser/shell_plugin_service_filter.h", |
| 308 | ] |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | grit("content_shell_resources_grit") { |
| 313 | visibility = ":*" |
| 314 | source = "shell_resources.grd" |
| 315 | outputs = [ |
| 316 | "grit/shell_resources.h", |
| 317 | "shell_resources.pak", |
| 318 | "shell_resources.rc", |
| 319 | ] |
| 320 | } |
| 321 | |
| 322 | copy("copy_shell_resources") { |
| 323 | sources = [ "$target_gen_dir/shell_resources.pak" ] |
| 324 | outputs = [ "$root_out_dir/shell_resources.pak" ] |
| 325 | |
| 326 | deps = [ ":content_shell_resources_grit" ] |
| 327 | forward_dependent_configs_from = [ ":content_shell_resources_grit" ] |
| 328 | } |
| 329 | |
| 330 | # Font copies. |
| 331 | if (!is_mac) { |
| 332 | copy("copy_ahem") { |
| 333 | visibility = ":*" |
| 334 | sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ] |
| 335 | outputs = [ "$root_out_dir/AHEM____.TTF" ] |
| 336 | } |
| 337 | } |
| 338 | if (use_x11) { |
| 339 | copy("copy_x11_fonts") { |
| 340 | visibility = ":*" |
| 341 | sources = [ |
| 342 | "renderer/test_runner/resources/fonts/fonts.conf", |
| 343 | "//third_party/gardiner_mod/GardinerModBug.ttf", |
| 344 | "//third_party/gardiner_mod/GardinerModCat.ttf", |
| 345 | ] |
| 346 | outputs = [ "$root_out_dir/{{source_file_part}}" ] |
| 347 | } |
| 348 | } |
| 349 | if (is_android) { |
| 350 | copy("copy_android_fonts") { |
| 351 | visibility = ":*" |
| 352 | sources = [ |
| 353 | "renderer/test_runner/resources/fonts/android_main_fonts.xml", |
| 354 | "renderer/test_runner/resources/fonts/android_fallback_fonts.xml", |
| 355 | ] |
| 356 | outputs = [ "$root_out_dir/{{source_file_part}}" ] |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | group("resources") { |
| 361 | deps = [ |
| 362 | ":copy_shell_resources", |
| 363 | ] |
| 364 | forward_dependent_configs_from = [ ":copy_shell_resources" ] |
| 365 | |
| 366 | if (is_mac) { |
| 367 | # TODO(GYP) Mac bundle resources. |
| 368 | #'all_dependent_settings': { |
| 369 | # 'mac_bundle_resources': [ |
| 370 | # 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF', |
| 371 | # 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf', |
| 372 | # '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png', |
| 373 | # '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png', |
| 374 | # ], |
| 375 | #}, |
| 376 | } else { |
| 377 | deps += [ ":copy_ahem" ] |
| 378 | } |
| 379 | |
| 380 | if (use_x11) { |
| 381 | deps += [ ":copy_x11_fonts" ] |
| 382 | } |
| 383 | if (is_android) { |
| 384 | deps += [ ":copy_android_fonts" ] |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | repack("pak") { |
| 389 | sources = [ |
| 390 | "$root_gen_dir/content/content_resources.pak", |
| 391 | "$root_gen_dir/content/browser/tracing/tracing_resources.pak", |
| 392 | "$root_gen_dir/content/shell/shell_resources.pak", |
| 393 | "$root_gen_dir/net/net_resources.pak", |
| 394 | "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", |
| 395 | "$root_gen_dir/ui/resources/webui_resources.pak", |
| 396 | "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", |
| 397 | "$root_gen_dir/ui/strings/ui_strings_en-US.pak", |
| 398 | "$root_gen_dir/webkit/blink_resources.pak", |
| 399 | "$root_gen_dir/webkit/webkit_resources_100_percent.pak", |
| 400 | "$root_gen_dir/webkit/webkit_strings_en-US.pak", |
| 401 | ] |
| 402 | |
| 403 | deps = [ |
| 404 | ":resources", |
| 405 | "//content:resources", |
| 406 | "//content/browser/tracing:resources", |
| 407 | "//net:net_resources", |
| 408 | "//ui/resources", |
| 409 | "//ui/strings", |
| 410 | "//webkit:resources", |
| 411 | "//webkit:strings", |
| 412 | ] |
| 413 | |
| 414 | if (is_android) { |
| 415 | output = "$root_out_dir/content_shell/assets/content_shell.pak" |
| 416 | } else { |
| 417 | sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ] |
| 418 | deps += [ "//content/browser/devtools:resources" ] |
| 419 | output = "$root_out_dir/content_shell.pak" |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | if (false) { # TODO(GYP) enable once this links. |
| 424 | |
| 425 | executable("content_shell") { |
| 426 | # TODO(GYP) mac resource bundle stuff for this target. |
| 427 | # TODO(GYP) Windows content shell settings: |
| 428 | # - Manifest. |
| 429 | # - RC file. |
| 430 | # - 'LinkIncremental': '<(msvs_large_module_debug_link_mode)', |
| 431 | sources = [ |
| 432 | "../app/startup_helper_win.cc", |
| 433 | "app/shell_main.cc", |
| 434 | ] |
| 435 | |
| 436 | deps = [ |
| 437 | ":content_shell_lib", |
| 438 | ":pak", |
| 439 | "//base/allocator", |
| 440 | #'../third_party/mesa/mesa.gyp:osmesa', TODO(GYP) |
| 441 | ] |
| 442 | |
| 443 | if (is_win) { |
| 444 | deps = [ "//sandbox" ] |
| 445 | if (!is_asan) { |
| 446 | configs -= [ "//build/config/win:console" ] |
| 447 | configs += [ "//build/config/win:windowed" ] |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | if (is_mac) { |
| 452 | # TODO(GYP) lots of stuff from GYP file here. |
| 453 | } |
| 454 | |
| 455 | if (!is_android || !is_android_webview_build) { |
[email protected] | 938c54d | 2014-07-23 21:15:14 | [diff] [blame] | 456 | # Some tests rely on this tool. It might be nicer if these tests relied on |
| 457 | # image diff rather than having content shell depend on it. |
| 458 | datadeps = [ |
| 459 | "//tools/imagediff($host_toolchain)", |
[email protected] | 6b9028ab | 2014-07-23 17:15:38 | [diff] [blame] | 460 | ] |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | } else { |
| 465 | # Content shell not ready, make a dummpy to make dependency management easier. |
| 466 | group("content_shell") { |
| 467 | } |
| 468 | } |