# 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/module_args/v8.gni") import("//mojo/mojo_application_package.gni") import("//testing/test.gni") import("//third_party/mojo/src/mojo/public/mojo.gni") import("//third_party/mojo/src/mojo/public/mojo_application.gni") import("//tools/grit/grit_rule.gni") import("//tools/grit/repack.gni") # Repack this here. repack("unified_blink_resources") { sources = [ "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak", "$root_gen_dir/blink/public/resources/blink_resources.pak", ] output = "$target_gen_dir/unified_blink_resources.pak" deps = [ "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", ] } action("generate_blink_resource_map") { script = "//components/html_viewer/generate_blink_resource_map.py" args = [ "--pak-file", rebase_path("$target_gen_dir/unified_blink_resources.pak"), "--header", rebase_path("$target_gen_dir/blink_resource_map.h"), "--cpp", rebase_path("$target_gen_dir/blink_resource_map.cc"), ] outputs = [ "$target_gen_dir/blink_resource_map.cc", "$target_gen_dir/blink_resource_map.h", ] deps = [ ":unified_blink_resources", ] public_deps = [ "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", ] } grit("html_viewer_resources_grit") { source = "html_viewer_resources.grd" outputs = [ "grit/html_viewer_resources.h", "html_viewer_resources.pak", "html_viewer_resources.rc", ] } source_set("lib") { sources = [ "$target_gen_dir/blink_resource_map.cc", "$target_gen_dir/blink_resource_map.h", "ax_provider_impl.cc", "ax_provider_impl.h", "blink_basic_type_converters.cc", "blink_basic_type_converters.h", "blink_input_events_type_converters.cc", "blink_input_events_type_converters.h", "blink_platform_impl.cc", "blink_platform_impl.h", "blink_resource_constants.h", "blink_url_request_type_converters.cc", "blink_url_request_type_converters.h", "discardable_memory_allocator.cc", "discardable_memory_allocator.h", "html_document.cc", "html_document.h", "mock_web_blob_registry_impl.cc", "mock_web_blob_registry_impl.h", "setup.cc", "setup.h", "touch_handler.cc", "touch_handler.h", "web_clipboard_impl.cc", "web_clipboard_impl.h", "web_cookie_jar_impl.cc", "web_cookie_jar_impl.h", "web_layer_tree_view_impl.cc", "web_layer_tree_view_impl.h", "web_media_player_factory.cc", "web_media_player_factory.h", "web_media_player_factory.h", "web_message_port_channel_impl.cc", "web_message_port_channel_impl.h", "web_mime_registry_impl.cc", "web_mime_registry_impl.h", "web_notification_manager_impl.cc", "web_notification_manager_impl.h", "web_socket_handle_impl.cc", "web_socket_handle_impl.h", "web_storage_namespace_impl.cc", "web_storage_namespace_impl.h", "web_theme_engine_impl.cc", "web_theme_engine_impl.h", "web_url_loader_impl.cc", "web_url_loader_impl.h", ] include_dirs = [ "third_party/WebKit" ] deps = [ "//base", "//base/third_party/dynamic_annotations", "//cc", "//cc/blink", "//cc/surfaces", "//components/clipboard/public/interfaces", "//components/mime_util", "//components/resource_provider/public/cpp", "//components/resource_provider/public/interfaces", "//components/scheduler:scheduler", "//components/view_manager/public/interfaces", "//components/webcrypto", "//gin", "//mandoline/services/navigation/public/interfaces", "//media", "//media/blink", "//media/mojo", "//mojo/application/public/cpp", "//mojo/cc", "//mojo/converters/surfaces", "//mojo/services/network/public/cpp", "//mojo/services/network/public/interfaces", "//net", "//skia", "//third_party/mojo/src/mojo/public/c/system:for_shared_library", "//third_party/mojo_services/src/accessibility/public/interfaces", "//ui/mojo/events:interfaces", "//ui/events", "//ui/events:gesture_detection", "//ui/events/blink", "//ui/events/gestures/blink", "//ui/gfx", "//ui/gfx/geometry", "//ui/native_theme", # TODO(sky): we shouldn't be using ui_test_pak. "//ui/resources:ui_test_pak", "//url", ] public_deps = [ "//components/view_manager/public/cpp", "//third_party/WebKit/public:blink", "//third_party/mojo/src/mojo/public/cpp/bindings", ":generate_blink_resource_map", ] if (is_win) { sources += [ "html_viewer_version.rc" ] } data_deps = [ "//components/clipboard", "//components/view_manager", ] } mojo_application_package("html_viewer") { sources = [ "html_viewer.cc", "ui_setup.h", "ui_setup_android.cc", "ui_setup_android.h", ] deps = [ ":html_viewer_resources_grit", ":lib", "//mojo/common", "//mojo/platform_handle", "//third_party/icu:icudata", "//ui/resources:ui_test_pak", ] data_deps = [ "//mojo/services/network:network" ] resources = [ "$root_out_dir/icudtl.dat", "$root_out_dir/ui_test.pak", "$target_gen_dir/html_viewer_resources.pak", ] if (v8_use_external_startup_data) { resources += [ "$root_build_dir/natives_blob.bin", "$root_build_dir/snapshot_blob.bin", ] } } test("tests") { output_name = "html_viewer_unittests" sources = [ "ax_provider_impl_unittest.cc", "discardable_memory_allocator_unittest.cc", ] deps = [ ":lib", "//base/test:run_all_unittests", ] } mojo_native_application("apptests") { output_name = "html_viewer_apptests" testonly = true sources = [ "ax_provider_apptest.cc", ] deps = [ "//base", "//mojo/application/public/cpp:test_support", "//net:test_support", "//testing/gtest", "//third_party/mojo_services/src/accessibility/public/interfaces", ] data_deps = [ ":html_viewer" ] }