chromium/chrome/browser/enterprise/connectors/test/BUILD.gn

# Copyright 2023 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/config/chromeos/ui_mode.gni")
import("//components/enterprise/buildflags/buildflags.gni")

source_set("test_support") {
  testonly = true
  public = [
    "deep_scanning_browsertest_base.h",
    "deep_scanning_test_utils.h",
    "fake_content_analysis_delegate.h",
    "fake_files_request_handler.h",
    "management_context_mixin.h",
    "test_constants.h",
    "uploader_test_utils.h",
  ]

  sources = [
    "deep_scanning_browsertest_base.cc",
    "deep_scanning_test_utils.cc",
    "fake_content_analysis_delegate.cc",
    "fake_files_request_handler.cc",
    "management_context_mixin.cc",
    "test_constants.cc",
    "uploader_test_utils.cc",
  ]

  public_deps = [
    "//base",
    "//chrome/browser/safe_browsing",
    "//chrome/browser/ui",
    "//chrome/test:test_support_ui",
    "//components/enterprise/common/proto:connectors_proto",
    "//components/policy/core/common:common_constants",
    "//components/policy/core/common:test_support",
    "//components/policy/proto",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//testing/gmock",
    "//third_party/abseil-cpp:absl",
  ]

  deps = [
    "//chrome/browser",
    "//chrome/browser:browser_process",
    "//chrome/browser/profiles:profile",
    "//chrome/test:test_support",
    "//components/enterprise/connectors/core",
    "//components/enterprise/data_controls/core/browser",
    "//components/policy/core/browser",
    "//components/policy/core/common",
    "//components/prefs",
  ]

  if (enterprise_local_content_analysis) {
    public += [
      "fake_content_analysis_sdk_client.h",
      "fake_content_analysis_sdk_manager.h",
    ]
    sources += [
      "fake_content_analysis_sdk_client.cc",
      "fake_content_analysis_sdk_manager.cc",
    ]

    # This data is needed so that the agent binary gets installed on test bots
    # when it is not the same as the build bot.
    data_deps = [ "//third_party/content_analysis_sdk:lca_agent" ]

    public_deps += [
      "//third_party/content_analysis_sdk:lca_agent",
      "//third_party/content_analysis_sdk:liblcasdk",
    ]
  }

  if (is_win || is_linux || is_mac || is_chromeos_lacros) {
    public += [ "browser/management_context_mixin_browser.h" ]
    sources += [ "browser/management_context_mixin_browser.cc" ]

    deps += [
      "//chrome/browser:browser_process",
      "//chrome/test:test_support",
      "//components/enterprise",
      "//components/enterprise:test_support",
    ]
  }

  if (is_chromeos_ash) {
    public += [ "ash/management_context_mixin_ash.h" ]
    sources += [ "ash/management_context_mixin_ash.cc" ]

    deps += [
      "//chrome/browser/ash/policy/core",
      "//chrome/browser/ash/policy/core:test_support",
    ]
  }
}