# Copyright 2024 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")

build_webui_tests("build") {
  cc_test_files = [
    "lens_overlay_webui_browsertest.cc",
    "lens_side_panel_pixel_interactive_ui_test.cc",
    "lens_side_panel_webui_browsertest.cc",
  ]

  is_chrome_untrusted = true
  files = [
    "ghost_loader/ghost_loader_state_test.ts",
    "ghost_loader/test_ghost_loader_browser_proxy.ts",
    "overlay/cubic_bezier_test.ts",
    "overlay/find_words_in_region_test.ts",
    "overlay/object_selection_test.ts",
    "overlay/overlay_background_scrim_test.ts",
    "overlay/overlay_close_button_test.ts",
    "overlay/overlay_cursor_test.ts",
    "overlay/overlay_more_options_button_test.ts",
    "overlay/overlay_screenshot_test.ts",
    "overlay/overlay_show_translate_promo_test.ts",
    "overlay/multi_region_selection_test.ts",
    "overlay/line_selection_test.ts",
    "overlay/performance_tracker_test.ts",
    "overlay/post_selection_renderer_test.ts",
    "overlay/region_selection_test.ts",
    "overlay/reshow_overlay_test.ts",
    "overlay/searchbox_test.ts",
    "overlay/selection_overlay_test.ts",
    "overlay/simplified_selection_test.ts",
    "overlay/test_language_browser_proxy.ts",
    "overlay/test_searchbox_browser_proxy.ts",
    "overlay/test_overlay_browser_proxy.ts",
    "overlay/translate_button_test.ts",
    "side_panel/composebox_test.ts",
    "side_panel/error_page_test.ts",
    "side_panel/feedback_toast_test.ts",
    "side_panel/ghost_loader_state_test.ts",
    "side_panel/message_toast_test.ts",
    "side_panel/post_message_communication_test.ts",
    "side_panel/results_frame_test.ts",
    "side_panel/searchbox_back_button_test.ts",
    "side_panel/test_side_panel_browser_proxy.ts",
    "utils/image_utils.ts",
    "utils/object_utils.ts",
    "utils/selection_utils.ts",
    "utils/text_utils.ts",
  ]

  ts_path_mappings = [
    "chrome-untrusted://lens-overlay/*|" +
        rebase_path("$root_gen_dir/chrome/browser/resources/lens/overlay/tsc/*",
                    target_gen_dir),
    "chrome-untrusted://lens/*|" +
        rebase_path("$root_gen_dir/chrome/browser/resources/lens/overlay/tsc/*",
                    target_gen_dir),
    "chrome-untrusted://lens/lens/shared/*|" +
        rebase_path("$root_gen_dir/chrome/browser/resources/lens/shared/tsc/*",
                    target_gen_dir),
    "chrome-untrusted://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/chrome_event.d.ts",
    "//tools/typescript/definitions/language_settings_private.d.ts",
  ]

  ts_deps = [
    "//chrome/browser/resources/lens/overlay:build_ts",
    "//chrome/test/data/webui/cr_components/searchbox:build_ts",
    "//ui/webui/resources/cr_components/composebox: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",
  ]
}
