| # Copyright 2021 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/chromeos/ui_mode.gni") |
| import("//chrome/test/base/js2gtest.gni") |
| import("//third_party/closure_compiler/compile_js.gni") |
| import("//tools/grit/preprocess_if_expr.gni") |
| import("//ui/webui/resources/tools/generate_grd.gni") |
| import("//ui/webui/resources/tools/js_modulizer.gni") |
| |
| assert(is_chromeos, "Eche App is Chrome OS only") |
| |
| preprocess_mojo_manifest = "preprocessed_mojo_manifest.json" |
| preprocess_folder = "preprocessed" |
| |
| static_library("eche_app_ui") { |
| sources = [ |
| "apps_access_setup_operation.cc", |
| "apps_access_setup_operation.h", |
| "eche_app_manager.cc", |
| "eche_app_manager.h", |
| "eche_app_ui.cc", |
| "eche_app_ui.h", |
| "eche_connector.cc", |
| "eche_connector.h", |
| "eche_feature_status_provider.cc", |
| "eche_feature_status_provider.h", |
| "eche_message_receiver.cc", |
| "eche_message_receiver.h", |
| "eche_notification_click_handler.cc", |
| "eche_notification_click_handler.h", |
| "eche_notification_generator.cc", |
| "eche_notification_generator.h", |
| "eche_presence_manager.cc", |
| "eche_presence_manager.h", |
| "eche_recent_app_click_handler.cc", |
| "eche_recent_app_click_handler.h", |
| "eche_signaler.cc", |
| "eche_signaler.h", |
| "eche_uid_provider.cc", |
| "eche_uid_provider.h", |
| "feature_status.cc", |
| "feature_status.h", |
| "feature_status_provider.cc", |
| "feature_status_provider.h", |
| "launch_app_helper.cc", |
| "launch_app_helper.h", |
| "system_info.cc", |
| "system_info.h", |
| "system_info_provider.cc", |
| "system_info_provider.h", |
| "untrusted_eche_app_ui.cc", |
| "untrusted_eche_app_ui.h", |
| "url_constants.cc", |
| "url_constants.h", |
| ] |
| |
| deps = [ |
| "//ash", |
| "//ash/constants", |
| "//ash/public/cpp", |
| "//chromeos/components/eche_app_ui/mojom", |
| "//chromeos/components/eche_app_ui/proto", |
| "//chromeos/components/multidevice:multidevice", |
| "//chromeos/components/multidevice/logging", |
| "//chromeos/components/phonehub:phonehub", |
| "//chromeos/resources:eche_app_resources", |
| "//chromeos/resources:eche_bundle_resources", |
| "//chromeos/services/device_sync/public/cpp:cpp", |
| "//chromeos/services/multidevice_setup/public/cpp:cpp", |
| "//chromeos/services/secure_channel/public/cpp/client", |
| "//chromeos/services/secure_channel/public/cpp/shared", |
| "//components/prefs", |
| "//content/public/browser", |
| "//mojo/public/js:resources", |
| "//ui/webui", |
| ] |
| } |
| |
| static_library("test_support") { |
| testonly = true |
| |
| sources = [ |
| "fake_feature_status_provider.cc", |
| "fake_feature_status_provider.h", |
| ] |
| |
| public_deps = [ ":eche_app_ui" ] |
| |
| deps = [ "//base" ] |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| sources = [ |
| "apps_access_setup_operation_unittest.cc", |
| "eche_feature_status_provider_unittest.cc", |
| "eche_message_receiver_unittest.cc", |
| "eche_notification_click_handler_unittest.cc", |
| "eche_notification_generator_unittest.cc", |
| "eche_recent_app_click_handler_unittest.cc", |
| "eche_uid_provider_unittest.cc", |
| "system_info_provider_unittest.cc", |
| ] |
| deps = [ |
| ":eche_app_ui", |
| ":test_support", |
| "//ash/public/cpp", |
| "//base", |
| "//base/test:test_support", |
| "//chromeos/components/eche_app_ui/proto", |
| "//chromeos/components/multidevice", |
| "//chromeos/components/multidevice:test_support", |
| "//chromeos/components/phonehub", |
| "//chromeos/components/phonehub:debug", |
| "//chromeos/services/device_sync/public/cpp", |
| "//chromeos/services/device_sync/public/cpp:test_support", |
| "//chromeos/services/multidevice_setup/public/cpp", |
| "//chromeos/services/multidevice_setup/public/cpp:test_support", |
| "//chromeos/services/secure_channel/public/cpp/client:test_support", |
| "//components/prefs:test_support", |
| "//testing/gtest", |
| ] |
| } |
| |
| js_type_check("closure_compile") { |
| deps = [ ":app" ] |
| } |
| |
| js_library("app") { |
| deps = [ |
| "//chromeos/components/eche_app_ui/mojom:mojom_js_library_for_compile", |
| "//chromeos/components/system_apps/public/js:message_pipe", |
| "//ui/webui/resources/js:cr.m", |
| ] |
| externs_list = [ "$externs_path/metrics_private.js" ] |
| sources = [ |
| "resources/browser_proxy.js", |
| "resources/message_types.js", |
| "resources/mock/js/app_bundle.js", |
| "resources/receiver.js", |
| ] |
| } |
| |
| js2gtest("browser_tests_js") { |
| test_type = "mojo_lite_webui" |
| sources = [ "test/eche_app_ui_browsertest.js" ] |
| defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] |
| } |
| |
| generate_grd("build_grd") { |
| input_files_base_dir = rebase_path("resources", "//") |
| input_files = [ |
| "../../system_apps/public/js/message_pipe.js", |
| "browser_proxy.js", |
| "message_types.js", |
| "receiver.js", |
| ] |
| manifest_files = [] |
| grd_prefix = "chromeos_eche_app" |
| out_grd = "$target_gen_dir/${grd_prefix}_resources.grd" |
| deps = [ ":build_mojo_grdp" ] |
| grdp_files = [ "$target_gen_dir/chromeos_eche_app_mojo_resources.grdp" ] |
| resource_path_rewrites = [ "chromeos/components/eche_app_ui/mojom/eche_app.mojom-lite.js|mojo/eche_app.mojom-lite.js" ] |
| } |
| |
| generate_grd("build_mojo_grdp") { |
| grd_prefix = "chromeos_eche_app" |
| out_grd = "$target_gen_dir/${grd_prefix}_mojo_resources.grdp" |
| deps = [ ":preprocess_mojo" ] |
| manifest_files = [ "$target_gen_dir/$preprocess_mojo_manifest" ] |
| resource_path_rewrites = [ "chromeos/components/eche_app_ui/mojom/eche_app.mojom-lite.js|mojo/eche_app.mojom-lite.js" ] |
| } |
| |
| # Mojo files, for generating grdp |
| preprocess_if_expr("preprocess_mojo") { |
| deps = |
| [ "//chromeos/components/eche_app_ui/mojom:mojom_js_library_for_compile" ] |
| in_folder = "$root_gen_dir" |
| out_folder = "$target_gen_dir/$preprocess_folder" |
| out_manifest = "$target_gen_dir/$preprocess_mojo_manifest" |
| in_files = [ "chromeos/components/eche_app_ui/mojom/eche_app.mojom-lite.js" ] |
| } |