# 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/public/mojo_application.gni") import("//testing/test.gni") import("//tools/grit/grit_rule.gni") import("//tools/grit/repack.gni") if (is_android) { import("//build/config/android/internal_rules.gni") import("//mojo/generate_mojo_shell_assets_list.gni") } grit("html_viewer_resources_grit") { source = "html_viewer_resources.grd" outputs = [ "grit/html_viewer_resources.h", "html_viewer_resources.pak", ] } copy("copy_html_viewer_resources") { sources = [ "$target_gen_dir/html_viewer_resources.pak", ] outputs = [ "$root_out_dir/html_viewer_resources.pak", ] public_deps = [ ":html_viewer_resources_grit", ] } repack("pak") { sources = [ "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak", "$root_gen_dir/blink/public/resources/blink_resources.pak", "$root_gen_dir/components/html_viewer/html_viewer_resources.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", ] output = "$root_out_dir/html_viewer.pak" deps = [ ":copy_html_viewer_resources", "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", "//ui/resources", "//ui/strings", ] } source_set("lib") { sources = [ "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_text_input_type_converters.cc", "blink_text_input_type_converters.h", "blink_url_request_type_converters.cc", "blink_url_request_type_converters.h", "content_handler_impl.cc", "content_handler_impl.h", "devtools_agent_impl.cc", "devtools_agent_impl.h", "discardable_memory_allocator.cc", "discardable_memory_allocator.h", "document_resource_waiter.cc", "document_resource_waiter.h", "geolocation_client_impl.cc", "geolocation_client_impl.h", "global_state.cc", "global_state.h", "html_document.cc", "html_document.h", "html_document_application_delegate.cc", "html_document_application_delegate.h", "html_document_oopif.cc", "html_document_oopif.h", "html_frame.cc", "html_frame.h", "html_frame_delegate.h", "html_frame_properties.cc", "html_frame_properties.h", "html_frame_tree_manager.cc", "html_frame_tree_manager.h", "html_viewer.cc", "html_viewer.h", "html_viewer_switches.cc", "html_viewer_switches.h", "media_factory.cc", "media_factory.h", "mock_web_blob_registry_impl.cc", "mock_web_blob_registry_impl.h", "replicated_frame_state.cc", "replicated_frame_state.h", "stats_collection_controller.cc", "stats_collection_controller.h", "test_html_viewer_impl.cc", "test_html_viewer_impl.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_impl.cc", "web_layer_impl.h", "web_layer_tree_view_impl.cc", "web_layer_tree_view_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:i18n", "//base/third_party/dynamic_annotations", "//cc", "//cc/blink", "//cc/surfaces", "//components/clipboard/public/interfaces", "//components/devtools_service/public/cpp", "//components/devtools_service/public/interfaces", "//components/html_viewer/public/interfaces", "//components/message_port", "//components/mime_util", "//components/resource_provider/public/cpp", "//components/resource_provider/public/interfaces", "//components/scheduler:scheduler", "//components/startup_metric_utils", "//components/view_manager/gles2:lib", "//components/view_manager/public/interfaces", "//components/webcrypto", "//gin", "//mandoline/services/navigation/public/interfaces", "//mandoline/tab/public/interfaces", "//media", "//media/blink", "//media/mojo", "//mojo/application/public/cpp", "//mojo/application/public/interfaces", "//mojo/cc", "//mojo/common", "//mojo/converters/surfaces", "//mojo/message_pump", "//mojo/platform_handle", "//mojo/services/network/public/cpp", "//mojo/services/network/public/interfaces", "//mojo/services/tracing/public/cpp", "//mojo/services/tracing/public/interfaces", "//net", "//skia", "//third_party/mojo_services/src/accessibility/public/interfaces", "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", "//ui/base:base", "//ui/mojo/events:interfaces", "//ui/events", "//ui/events:gesture_detection", "//ui/events/blink", "//ui/events/gestures/blink", "//ui/gfx", "//ui/gfx/geometry", "//ui/mojo/geometry:interfaces_cpp_sources", "//ui/mojo/ime:interfaces_cpp_sources", "//ui/mojo/init", "//ui/native_theme", "//url", ] public_deps = [ "//components/view_manager/public/cpp", "//third_party/WebKit/public:blink", "//third_party/mojo/src/mojo/public/cpp/bindings", ] if (is_win) { sources += [ "html_viewer_version.rc" ] } if (is_linux && !is_android) { deps += [ "//components/font_service/public/cpp" ] } data_deps = [ "//components/clipboard", "//components/view_manager", "//mojo/services/network:network", "//mojo/services/tracing", ] } mojo_native_application("html_viewer") { sources = [ "html_viewer_main.cc", ] deps = [ ":lib", ":pak", "//mojo/application/public/cpp:sources", "//third_party/mojo/src/mojo/public/c/system:for_shared_library", ] resources = [ "$root_out_dir/html_viewer.pak" ] if (v8_use_external_startup_data) { resources += [ "$root_build_dir/natives_blob.bin", "$root_build_dir/snapshot_blob.bin", ] deps += [ "//gin" ] } } mojo_native_application("layout_test_html_viewer") { testonly = true sources = [ "layout_test_content_handler_impl.cc", "layout_test_content_handler_impl.h", "layout_test_html_viewer.cc", "layout_test_html_viewer.h", "layout_test_html_viewer_main.cc", "web_test_delegate_impl.cc", "web_test_delegate_impl.h", ] deps = [ ":lib", ":pak", "//cc", "//components/test_runner", "//mojo/application/public/cpp:sources", "//third_party/WebKit/public:blink", "//third_party/WebKit/public:test_support", "//third_party/mojo/src/mojo/public/c/system:for_shared_library", "//ui/base", "//url", ] resources = [ "$root_out_dir/html_viewer.pak" ] if (v8_use_external_startup_data) { resources += [ "$root_build_dir/natives_blob.bin", "$root_build_dir/snapshot_blob.bin", ] deps += [ "//gin" ] } } if (is_android) { html_viewer_unittests_assets = "$root_build_dir/html_viewer_unittests_assets" copy_ex("copy_unittest_assets") { clear_dir = true deps = [ ":pak", "//gin", "//third_party/icu:icudata", ] dest = html_viewer_unittests_assets sources = [ "$root_build_dir/html_viewer.pak", "$root_build_dir/icudtl.dat", "$root_build_dir/natives_blob.bin", "$root_build_dir/snapshot_blob.bin", ] } generate_mojo_shell_assets_list("build_unittest_assets") { deps = [ ":copy_unittest_assets", ] dir = html_viewer_unittests_assets } } test("html_viewer_unittests") { sources = [ "ax_provider_impl_unittest.cc", "discardable_memory_allocator_unittest.cc", "run_all_unittests.cc", ] deps = [ ":lib", ":pak", "//base/test:test_support", "//components/scheduler", "//gin", "//testing/gtest:gtest", "//third_party/mojo/src/mojo/edk/system", "//ui/base", "//ui/mojo/init", ] if (is_android) { deps += [ ":build_unittest_assets" ] apk_asset_location = html_viewer_unittests_assets } } mojo_native_application("apptests") { output_name = "html_viewer_apptests" testonly = true sources = [ "ax_provider_apptest.cc", "html_frame_apptest.cc", ] deps = [ "//base", "//components/html_viewer/public/interfaces", "//components/scheduler", "//components/view_manager/public/cpp", "//components/view_manager/public/cpp/tests:test_support", "//mandoline/tab:lib", "//mandoline/tab:test_support", "//mandoline/tab/public/interfaces", "//mojo/application/public/cpp:sources", "//mojo/application/public/cpp:test_support", "//net:test_support", "//testing/gtest", "//third_party/mojo_services/src/accessibility/public/interfaces", "//third_party/mojo/src/mojo/public/c/system:for_shared_library", ] data_deps = [ ":html_viewer", "//components/view_manager", ] if (is_linux && !is_android) { data_deps += [ "//components/font_service" ] } }