blob: 41b3eb504c1813bb25fe013ce2c278b7815eae34 [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/util/process_version.gni")
import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
assert(enable_extensions)
grit("resources") {
source = "app_shell_resources.grd"
outputs = [
"grit/app_shell_resources.h",
"app_shell_resources.pak",
]
}
source_set("app_shell_lib") {
# TODO(jamescook): investigate and get rid of test dependencies. This library
# is testonly because it depends on testonly libraries, namely
# //content/shell:content_shell_lib. See http://crbug.com/438283
testonly = true
deps = [
":resources",
":version_header",
"//base",
"//components/guest_view/browser",
"//components/guest_view/common",
"//components/guest_view/renderer",
"//components/pref_registry",
"//components/prefs",
"//components/update_client",
"//components/user_prefs",
"//components/web_cache/renderer",
"//content",
"//content/shell:content_shell_lib",
"//device/base",
"//device/hid",
"//extensions:extensions_resources",
"//extensions:shell_and_test_pak",
"//extensions/browser",
"//extensions/browser/api:api_registration",
"//extensions/browser/kiosk",
"//extensions/common",
"//extensions/common/api",
"//extensions/renderer",
"//extensions/shell/common/api",
"//extensions/shell/common/api:api_registration",
"//extensions/shell/common/api:extensions_features",
"//extensions/utility",
"//skia",
"//third_party/WebKit/public:blink",
"//third_party/cld",
"//ui/base",
"//ui/base/ime",
"//v8",
]
sources = [
"app/paths_mac.h",
"app/paths_mac.mm",
"app/shell_main_delegate.cc",
"app/shell_main_delegate.h",
"browser/api/identity/identity_api.cc",
"browser/api/identity/identity_api.h",
"browser/default_shell_browser_main_delegate.cc",
"browser/default_shell_browser_main_delegate.h",
"browser/delegates/shell_kiosk_delegate.cc",
"browser/delegates/shell_kiosk_delegate.h",
"browser/desktop_controller.cc",
"browser/desktop_controller.h",
"browser/media_capture_util.cc",
"browser/media_capture_util.h",
"browser/shell_app_delegate.cc",
"browser/shell_app_delegate.h",
"browser/shell_app_view_guest_delegate.cc",
"browser/shell_app_view_guest_delegate.h",
"browser/shell_app_window_client.cc",
"browser/shell_app_window_client.h",
"browser/shell_app_window_client_mac.mm",
"browser/shell_audio_controller_chromeos.cc",
"browser/shell_audio_controller_chromeos.h",
"browser/shell_browser_context.cc",
"browser/shell_browser_context.h",
"browser/shell_browser_context_keyed_service_factories.cc",
"browser/shell_browser_context_keyed_service_factories.h",
"browser/shell_browser_main_delegate.h",
"browser/shell_browser_main_parts.cc",
"browser/shell_browser_main_parts.h",
"browser/shell_browser_main_parts_mac.h",
"browser/shell_browser_main_parts_mac.mm",
"browser/shell_content_browser_client.cc",
"browser/shell_content_browser_client.h",
"browser/shell_desktop_controller_mac.h",
"browser/shell_desktop_controller_mac.mm",
"browser/shell_device_client.cc",
"browser/shell_device_client.h",
"browser/shell_display_info_provider.cc",
"browser/shell_display_info_provider.h",
"browser/shell_extension_host_delegate.cc",
"browser/shell_extension_host_delegate.h",
"browser/shell_extension_system.cc",
"browser/shell_extension_system.h",
"browser/shell_extension_system_factory.cc",
"browser/shell_extension_system_factory.h",
"browser/shell_extension_web_contents_observer.cc",
"browser/shell_extension_web_contents_observer.h",
"browser/shell_extensions_api_client.cc",
"browser/shell_extensions_api_client.h",
"browser/shell_extensions_browser_client.cc",
"browser/shell_extensions_browser_client.h",
"browser/shell_native_app_window.cc",
"browser/shell_native_app_window.h",
"browser/shell_native_app_window_mac.h",
"browser/shell_native_app_window_mac.mm",
"browser/shell_navigation_ui_data.cc",
"browser/shell_navigation_ui_data.h",
"browser/shell_network_controller_chromeos.cc",
"browser/shell_network_controller_chromeos.h",
"browser/shell_network_delegate.cc",
"browser/shell_network_delegate.h",
"browser/shell_oauth2_token_service.cc",
"browser/shell_oauth2_token_service.h",
"browser/shell_oauth2_token_service_delegate.cc",
"browser/shell_oauth2_token_service_delegate.h",
"browser/shell_prefs.cc",
"browser/shell_prefs.h",
"browser/shell_runtime_api_delegate.cc",
"browser/shell_runtime_api_delegate.h",
"browser/shell_special_storage_policy.cc",
"browser/shell_special_storage_policy.h",
"browser/shell_speech_recognition_manager_delegate.cc",
"browser/shell_speech_recognition_manager_delegate.h",
"browser/shell_update_query_params_delegate.cc",
"browser/shell_update_query_params_delegate.h",
"browser/shell_url_request_context_getter.cc",
"browser/shell_url_request_context_getter.h",
"common/shell_content_client.cc",
"common/shell_content_client.h",
"common/shell_extensions_client.cc",
"common/shell_extensions_client.h",
"common/switches.cc",
"common/switches.h",
"renderer/shell_content_renderer_client.cc",
"renderer/shell_content_renderer_client.h",
"renderer/shell_extensions_renderer_client.cc",
"renderer/shell_extensions_renderer_client.h",
"utility/shell_content_utility_client.cc",
"utility/shell_content_utility_client.h",
]
if (use_aura) {
sources += [
"browser/shell_app_window_client_aura.cc",
"browser/shell_desktop_controller_aura.cc",
"browser/shell_desktop_controller_aura.h",
"browser/shell_native_app_window_aura.cc",
"browser/shell_native_app_window_aura.h",
"browser/shell_screen.cc",
"browser/shell_screen.h",
]
deps += [ "//ui/wm" ]
}
if (is_chromeos) {
sources += [ "browser/api/vpn_provider/vpn_service_factory.cc" ]
deps += [
"//chromeos",
"//ui/chromeos",
"//ui/display",
]
}
if (enable_nacl) {
sources += [
"browser/shell_nacl_browser_delegate.cc",
"browser/shell_nacl_browser_delegate.h",
]
deps += [
"//components/nacl/browser",
"//components/nacl/common",
"//components/nacl/loader",
"//components/nacl/renderer",
"//components/nacl/renderer/plugin:nacl_trusted_plugin",
]
if (is_linux) {
deps += [ "//components/nacl/loader:nacl_helper" ]
if (enable_nacl_nonsfi) {
deps += [ "//components/nacl/loader:helper_nonsfi" ]
}
}
}
}
executable("app_shell") {
# testonly because :app_shell_lib is testonly. See :app_shell_lib comment.
testonly = true
sources = [
"app/shell_main.cc",
]
deps = [
":app_shell_lib",
"//build/config/sanitizers:deps",
"//build/win:default_exe_manifest",
"//extensions:shell_and_test_pak",
]
if (is_win) {
configs += [ "//build/config/win:windowed" ]
configs -= [ "//build/config/win:console" ]
}
if (is_mac) {
output_name = "App Shell"
# TODO(GYP): Mac bundling. See also content_shell which this is basically
# a copy-paste of.
deps += [ ":app_shell_framework" ]
# TODO(GYP): Mac app_shell_helper stuff.
}
}
test("app_shell_unittests") {
sources = [
"../test/extensions_unittests_main.cc",
"browser/api/identity/identity_api_unittest.cc",
"browser/shell_oauth2_token_service_unittest.cc",
"browser/shell_prefs_unittest.cc",
"common/shell_content_client_unittest.cc",
]
data = [
"//extensions/test/data/",
"$root_out_dir/extensions_shell_and_test.pak",
#"$root_out_dir/natives_blob.bin", # move to gin
#"$root_out_dir/snapshot_blob.bin",
]
deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//content/test:test_support",
"//extensions:shell_and_test_pak",
"//extensions:test_support",
"//testing/gtest",
]
data_deps = [
# "//gin", # TODO(dpranke): Either gin or v8 data is needed ...
"//third_party/mesa:osmesa",
]
if (use_aura) {
sources += [
"browser/shell_desktop_controller_aura_unittest.cc",
"browser/shell_native_app_window_aura_unittest.cc",
"browser/shell_screen_unittest.cc",
]
deps += [ "//ui/aura:test_support" ]
}
if (is_chromeos) {
sources += [ "browser/shell_audio_controller_chromeos_unittest.cc" ]
deps += [ "//chromeos:test_support_without_gmock" ]
}
if (enable_nacl) {
sources += [ "browser/shell_nacl_browser_delegate_unittest.cc" ]
}
}
process_version("version_header") {
template_file = "common/version.h.in"
sources = [
"//build/util/LASTCHANGE",
"//chrome/VERSION",
]
output = "$target_gen_dir/common/version.h"
}
if (is_mac) {
# TODO(GYP) this should be a bundle. Lots of other stuff in this target.
# Should be able to copy content shell framework (this is basically a
# copy-paste of that target).
shared_library("app_shell_framework") {
testonly = true
sources = [
"app/shell_main_mac.cc",
"app/shell_main_mac.h",
]
deps = [
":app_shell_lib",
]
}
}
source_set("browser_tests") {
testonly = true
sources = [
"browser/geolocation/geolocation_apitest.cc",
"browser/shell_browsertest.cc",
"test/shell_apitest.cc",
"test/shell_apitest.h",
"test/shell_test.cc",
"test/shell_test.h",
"test/shell_test_launcher_delegate.cc",
"test/shell_test_launcher_delegate.h",
"test/shell_tests_main.cc",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//components/version_info",
"//content/shell:content_shell_lib",
"//content/test:test_support",
"//extensions:test_support",
"//extensions/browser",
"//extensions/common",
]
if (use_aura) {
deps += [ "//ui/aura" ]
}
}
source_set("unit_tests") {
testonly = true
sources = []
deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//extensions/browser",
]
if (is_chromeos) {
deps += [
"//chromeos:test_support",
"//components/keyed_service/content",
]
}
}