chromium/chrome/test/data/webui/cr_components/chromeos/BUILD.gn

# Copyright 2020 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//third_party/closure_compiler/compile_js.gni")
import("//tools/typescript/webui_ts_library.gni")
import("//ui/webui/resources/tools/generate_grd.gni")

assert(is_chromeos, "CrComponents Chromeos tests are Chrome OS only.")

webui_ts_library("build_ts") {
  root_dir = "."
  out_dir = "$target_gen_dir/tsc"
  composite = true
  tsconfig_base = "tsconfig_base.json"

  in_files = [
    "bluetooth/bluetooth_base_page_test.ts",
    "bluetooth/bluetooth_battery_icon_percentage_test.ts",
    "bluetooth/bluetooth_device_battery_info_test.ts",
    "bluetooth/bluetooth_icon_test.ts",
    "bluetooth/bluetooth_pairing_confirm_code_page_test.ts",
    "bluetooth/bluetooth_pairing_device_item_test.ts",
    "bluetooth/bluetooth_pairing_device_selection_page_test.ts",
    "bluetooth/bluetooth_pairing_enter_code_page_test.ts",
    "bluetooth/bluetooth_pairing_request_code_page_test.ts",
    "bluetooth/bluetooth_pairing_ui_test.ts",
    "bluetooth/bluetooth_spinner_page_test.ts",
    "bluetooth/fake_bluetooth_config.ts",
    "bluetooth/fake_bluetooth_discovery_delegate.ts",
    "bluetooth/fake_device_pairing_handler.ts",
    "bluetooth/fake_hid_preserving_bluetooth_state_controller.ts",
    "cellular_setup/activation_code_page_test.ts",
    "cellular_setup/base_page_test.ts",
    "cellular_setup/button_bar_test.ts",
    "cellular_setup/cellular_setup_test.ts",
    "cellular_setup/confirmation_code_page_test.ts",
    "cellular_setup/profile_discovery_list_page_test.ts",
    "cellular_setup/esim_flow_ui_test.ts",
    "cellular_setup/fake_barcode_detector.ts",
    "cellular_setup/fake_cellular_setup_delegate.ts",
    "cellular_setup/fake_cellular_setup_remote.ts",
    "cellular_setup/fake_esim_manager_remote.ts",
    "cellular_setup/fake_media_devices.ts",
    "cellular_setup/final_page_test.ts",
    "cellular_setup/mock_metrics_private.ts",
    "cellular_setup/provisioning_page_test.ts",
    "cellular_setup/psim_flow_ui_test.ts",
    "cellular_setup/setup_loading_page_test.ts",
    "network/apn_list_item_test.js",
    "network/apn_list_test.js",
    "network/apn_selection_dialog_test.js",
    "network/apn_selection_dialog_list_item_test.js",
    "network/cr_policy_network_behavior_mojo_tests.js",
    "network/cr_policy_network_indicator_mojo_tests.js",
    "network/cr_policy_strings.js",
    "network/network_apnlist_test.js",
    "network/network_choose_mobile_test.js",
    "network/network_config_element_behavior_test.js",
    "network/network_config_input_test.js",
    "network/network_config_select_test.js",
    "network/network_config_test.js",
    "network/network_config_toggle_test.js",
    "network/network_config_vpn_test.js",
    "network/network_config_wifi_test.js",
    "network/network_icon_test.js",
    "network/network_ip_config_test.js",
    "network/network_list_item_test.js",
    "network/network_list_test.js",
    "network/network_nameservers_test.js",
    "network/network_password_input_test.js",
    "network/network_property_list_mojo_test.js",
    "network/network_proxy_exclusions_test.js",
    "network/network_proxy_input_test.js",
    "network/network_proxy_test.js",
    "network/network_select_test.js",
    "network/network_siminfo_test.js",
    "network/sim_lock_dialogs_test.js",
    "network_health/fake_network_diagnostics_routines.ts",
    "network_health/network_diagnostics_test.ts",
    "network_health/network_health_test_utils.ts",
    "network_health/routine_group_test.ts",
    "traffic_counters/traffic_counters_test.ts",
  ]

  path_mappings = [
    "chrome://webui-test/*|" +
        rebase_path("$root_gen_dir/chrome/test/data/webui/tsc/*",
                    target_gen_dir),
    "chrome://webui-test/chromeos/*|" +
        rebase_path("$root_gen_dir/chrome/test/data/webui/chromeos/tsc/*",
                    target_gen_dir),
  ]

  deps = [
    "//ash/webui/common/resources:build_ts",
    "//ash/webui/common/resources/cellular_setup:build_ts",
    "//ash/webui/common/resources/cr_elements:build_ts",
    "//chrome/test/data/webui:build_ts",
    "//chrome/test/data/webui/chromeos:build_ts",
    "//third_party/polymer/v3_0:library",
    "//ui/webui/resources/js:build_ts",
    "//ui/webui/resources/mojo:build_ts",
  ]
  definitions = [
    "//tools/typescript/definitions/pending.d.ts",
    "//tools/typescript/definitions/chrome_send.d.ts",
    "//tools/typescript/definitions/metrics_private.d.ts",
  ]
  extra_deps = [ "//ash/webui/common/resources:generate_definitions" ]
}

generate_grd("build_grdp") {
  testonly = true
  grd_prefix = "cr_components_chromeos"
  out_grd = "$target_gen_dir/resources.grdp"
  resource_path_prefix = "cr_components/chromeos"

  deps = [ ":build_ts" ]

  # Add local test files.
  input_files_base_dir = rebase_path(".", "//")
  input_files = [
    "multidevice_setup/integration_test.js",
    "multidevice_setup/setup_succeeded_page_test.js",
    "multidevice_setup/start_setup_page_test.js",
  ]

  manifest_files =
      filter_include(get_target_outputs(":build_ts"), [ "*_manifest.json" ])
}