chromium/chrome/test/data/pdf/BUILD.gn

# 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("//chrome/test/data/webui/build_webui_tests.gni")
import("//pdf/features.gni")

assert(enable_pdf, "enable_pdf check failed")

build_webui_tests("build") {
  resource_path_prefix = "pdf"

  ts_tsconfig_base = "../../../../tools/typescript/tsconfig_base_polymer.json"
  ts_path_mappings =
      [ "chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/*|" +
        rebase_path("$root_gen_dir/chrome/browser/resources/pdf/tsc/*",
                    target_gen_dir) ]
  files = [
    "basic_plugin_test.ts",
    "basic_test.ts",
    "beep_test.ts",
    "bookmarks_test.ts",
    "download_controls_test.ts",
    "fullscreen_test.ts",
    "gesture_detector_test.ts",
    "layout_test.ts",
    "material_elements_test.ts",
    "metrics_test.ts",
    "navigator_test.ts",
    "nobeep_test.ts",
    "page_change_test.ts",
    "page_selector_test.ts",
    "params_parser_test.ts",
    "plugin_controller_test.ts",
    "post_message_proxy_test.ts",
    "scroll_with_form_field_focused_test.ts",
    "swipe_detector_test.ts",
    "test_util.ts",
    "title_test.ts",
    "touch_handling_test.ts",
    "viewer_attachment_bar_test.ts",
    "viewer_attachment_test.ts",
    "viewer_password_dialog_test.ts",
    "viewer_pdf_sidenav_test.ts",
    "viewer_properties_dialog_test.ts",
    "viewer_thumbnail_bar_test.ts",
    "viewer_thumbnail_test.ts",
    "viewer_toolbar_test.ts",
    "viewport_test.ts",
    "whitespace_title_test.ts",
    "zoom_manager_test.ts",
  ]

  if (enable_ink) {
    files += [
      "annotations_feature_enabled_test.ts",
      "annotations_toolbar_test.ts",
      "viewer_toolbar_dropdown_test.ts",
    ]
  }

  if (enable_pdf_ink2) {
    files += [
      "ink2_before_unload_stroke_test.ts",
      "ink2_before_unload_undo_test.ts",
      "ink2_save_test.ts",
      "ink2_side_panel_test.ts",
      "ink2_test.ts",
      "ink2_viewer_toolbar_test.ts",
    ]

    if (!is_chromeos_ash) {
      files += [ "ink2_disabled_test.ts" ]
    }
  }

  if (is_chromeos_ash) {
    files += [ "printing_icon_test.ts" ]
  }

  ts_definitions = [
    "//tools/typescript/definitions/chrome_event.d.ts",
    "//tools/typescript/definitions/chrome_test.d.ts",
    "//tools/typescript/definitions/metrics_private.d.ts",
    "//tools/typescript/definitions/mime_handler_private.d.ts",
    "//tools/typescript/definitions/pending.d.ts",
  ]
  if (enable_ink) {
    ts_definitions +=
        [ "//chrome/browser/resources/pdf/ink/drawing_canvas.d.ts" ]
  }

  ts_deps = [
    "../webui:build_ts",
    "//chrome/browser/resources/pdf:build_ts",
    "//third_party/lit/v3_0:build_ts",
    "//ui/webui/resources/js:build_ts",
  ]
}