blob: f379f86eb4b04e6f2727e1de05622cdaab236e3e [file] [log] [blame]
# Copyright 2019 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.
assert(is_fuchsia)
import("//build/config/fuchsia/rules.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//testing/test.gni")
import("//tools/grit/repack.gni")
config("web_engine_implementation") {
defines = [ "WEB_ENGINE_IMPLEMENTATION" ]
}
source_set("test_support") {
testonly = true
sources = [
"test/fake_context.cc",
"test/fake_context.h",
"test/test_common.cc",
"test/test_common.h",
]
deps = [
"//base",
"//base/test:test_config",
"//content/test:test_support",
"//fuchsia/base",
]
public_deps = [
"//fuchsia:web_fidl",
"//skia/public/interfaces",
]
}
mojom("mojom") {
sources = [
"on_load_script_injector.mojom",
]
public_deps = [
"//mojo/public/mojom/base",
]
visibility = [ ":*" ]
}
repack("web_engine_pak") {
sources = [
"$root_gen_dir/components/components_resources.pak",
"$root_gen_dir/components/strings/components_strings_en-US.pak",
"$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
"$root_gen_dir/content/app/strings/content_strings_en-US.pak",
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
"$root_gen_dir/net/net_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
"$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
"$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
"$root_gen_dir/ui/strings/ui_strings_en-US.pak",
]
deps = [
"//components/resources:components_resources",
"//components/strings",
"//content:resources",
"//content/app/resources",
"//content/app/strings",
"//content/browser/tracing:resources",
"//mojo/public/js:resources",
"//net:net_resources",
"//third_party/blink/public:resources",
"//third_party/blink/public:scaled_resources_100_percent",
"//ui/resources",
"//ui/strings",
]
output = "$root_out_dir/webrunner.pak"
visibility = [ ":*" ]
}
component("web_engine_core") {
deps = [
":mojom",
":web_engine_pak",
"//base",
"//components/version_info",
"//content/public/app:both",
"//content/public/browser",
"//content/public/child",
"//content/public/common",
"//content/public/renderer",
"//fuchsia/base",
"//mojo/public/cpp/bindings",
"//services/network/public/cpp",
"//services/service_manager/sandbox",
"//skia/public/interfaces",
"//third_party/blink/public/common",
"//ui/aura",
"//ui/base/ime",
"//ui/display",
"//ui/ozone",
"//ui/platform_window",
"//ui/wm",
"//ui/wm/public",
]
data_deps = [
":web_engine_pak",
]
data = [
"$root_out_dir/webrunner.pak",
]
public_deps = [
"//fuchsia:web_fidl",
]
configs += [ ":web_engine_implementation" ]
sources = [
"browser/context_impl.cc",
"browser/context_impl.h",
"browser/frame_impl.cc",
"browser/frame_impl.h",
"browser/message_port_impl.cc",
"browser/message_port_impl.h",
"browser/webrunner_browser_context.cc",
"browser/webrunner_browser_context.h",
"browser/webrunner_browser_main.cc",
"browser/webrunner_browser_main.h",
"browser/webrunner_browser_main_parts.cc",
"browser/webrunner_browser_main_parts.h",
"browser/webrunner_content_browser_client.cc",
"browser/webrunner_content_browser_client.h",
"browser/webrunner_net_log.cc",
"browser/webrunner_net_log.h",
"browser/webrunner_screen.cc",
"browser/webrunner_screen.h",
"browser/webrunner_url_request_context_getter.cc",
"browser/webrunner_url_request_context_getter.h",
"common.cc",
"common.h",
"context_provider_impl.cc",
"context_provider_impl.h",
"context_provider_main.cc",
"context_provider_main.h",
"renderer/on_load_script_injector.cc",
"renderer/on_load_script_injector.h",
"renderer/webrunner_content_renderer_client.cc",
"renderer/webrunner_content_renderer_client.h",
"web_engine_export.h",
"webrunner_content_client.cc",
"webrunner_content_client.h",
"webrunner_main_delegate.cc",
"webrunner_main_delegate.h",
]
visibility = [ ":*" ]
}
executable("web_engine_exe") {
deps = [
":web_engine_core",
"//base",
"//content/public/app:both",
"//services/service_manager/embedder:embedder_switches",
]
sources = [
"webrunner_main.cc",
]
visibility = [ ":*" ]
}
fuchsia_package("web_engine") {
binary = ":web_engine_exe"
package_name_override = "chromium"
sandbox_policy = "sandbox_policy"
excluded_files = [
"lib/libswiftshader_libEGL.so",
"lib/libswiftshader_libGLESv2.so",
]
}
fuchsia_package_runner("web_engine_runner") {
package = ":web_engine"
package_name_override = "chromium"
install_only = true
}
source_set("browsertest_core") {
testonly = true
sources = [
"test/webrunner_browser_test.cc",
"test/webrunner_browser_test.h",
"test/webrunner_test_launcher.cc",
]
deps = [
":web_engine_core",
"//content/public/browser",
"//content/test:test_support",
"//fuchsia:web_fidl",
"//net:test_support",
"//testing/gtest",
"//ui/ozone",
]
}
test("web_engine_browsertests") {
sources = [
"browser/context_impl_browsertest.cc",
"browser/frame_impl_browsertest.cc",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
data = [
"test/data",
]
deps = [
":browsertest_core",
":test_support",
":web_engine_core",
"//base/test:test_support",
"//content/public/browser",
"//fuchsia/base",
"//fuchsia/base:test_support",
"//net:test_support",
"//testing/gmock",
"//testing/gtest",
"//ui/ozone",
]
}
test("web_engine_unittests") {
sources = [
"context_provider_impl_unittest.cc",
]
deps = [
":test_support",
":web_engine_core",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}