# Copyright 2022 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("../build_webui_tests.gni")
import("./action_chips/action_chips.gni")
import("./composebox/composebox.gni")
import("./modules/modules.gni")
import("./ntp_promo/ntp_promo.gni")

build_webui_tests("build") {
  cc_test_files = [
    "new_tab_page_a11y_browsertest.cc",
    "new_tab_page_browsertest.cc",
    "new_tab_page_focus_interactive_uitest.cc",
  ]

  files = [
            "app_focus_test.ts",
            "app_test.ts",
            "background_image_test.ts",
            "background_manager_test.ts",
            "doodle_share_dialog_focus_test.ts",
            "doodle_share_dialog_test.ts",
            "image_processor_test.ts",
            "image_processor_test_support.ts",
            "lens_form_test.ts",
            "lens_upload_dialog_test.ts",
            "logo_test.ts",
            "metrics_utils_test.ts",
            "middle_slot_promo_test.ts",
            "test_support.ts",
            "transparency_test.ts",
            "transparency_test_support.ts",
            "voice_search_overlay_test.ts",
            "realbox_test.ts",
            "searchbox_focus_test.ts",
            "searchbox_lens_button_test.ts",
            "searchbox_ntp_test.ts",
          ] + modules_test_files + composebox_test_files +
          ntp_promo_test_files + action_chips_test_files

  ts_tsconfig_base = "tsconfig_base.json"

  ts_path_mappings = [
    "chrome://new-tab-page/new_tab_page.js|" + rebase_path(
            "$root_gen_dir/chrome/browser/resources/new_tab_page/tsc/new_tab_page.d.ts",
            target_gen_dir),
    "chrome://new-tab-page/lazy_load.js|" + rebase_path(
            "$root_gen_dir/chrome/browser/resources/new_tab_page/tsc/lazy_load.d.ts",
            target_gen_dir),
    "chrome://webui-test/cr_components/searchbox/*|" + rebase_path(
            "$root_gen_dir/chrome/test/data/webui/cr_components/searchbox/tsc/*",
            target_gen_dir),
  ]

  ts_definitions = [
    "//tools/typescript/definitions/metrics_private.d.ts",
    "//tools/typescript/definitions/pending.d.ts",
  ]

  ts_deps = [
    "//chrome/browser/resources/new_tab_page:build_ts",
    "//chrome/test/data/webui/cr_components/searchbox:build_ts",
    "//ui/webui/resources/cr_components/composebox:build_ts",
    "//ui/webui/resources/cr_components/help_bubble:build_ts",
    "//ui/webui/resources/cr_components/history_clusters:build_ts",
    "//ui/webui/resources/cr_components/most_visited:build_ts",
    "//ui/webui/resources/cr_components/page_image_service:build_ts",
    "//ui/webui/resources/cr_components/search:build_ts",
    "//ui/webui/resources/cr_components/searchbox:build_ts",
    "//ui/webui/resources/cr_elements:build_ts",
    "//ui/webui/resources/js:build_ts",
    "//ui/webui/resources/mojo:build_ts",
  ]
}
