chromium/components/subresource_filter/content/shared/browser/BUILD.gn

# 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/config/features.gni")

static_library("browser") {
  sources = [
    "activation_state_computing_navigation_throttle.cc",
    "activation_state_computing_navigation_throttle.h",
    "child_frame_navigation_filtering_throttle.cc",
    "child_frame_navigation_filtering_throttle.h",
    "page_load_statistics.cc",
    "page_load_statistics.h",
    "ruleset_publisher.cc",
    "ruleset_publisher.h",
    "ruleset_service.cc",
    "ruleset_service.h",
    "unindexed_ruleset_stream_generator.cc",
    "unindexed_ruleset_stream_generator.h",
  ]
  configs += [ "//build/config/compiler:wexit_time_destructors" ]
  public_deps = [
    "//base",
    "//components/prefs",
    "//components/subresource_filter/core/browser",
    "//components/subresource_filter/core/common",
    "//components/subresource_filter/core/mojom",
    "//content/public/browser",
    "//ipc",
    "//services/network/public/cpp",
    "//url",
  ]
  deps = [
    "//components/subresource_filter/content/shared/common",
    "//third_party/protobuf:protobuf_lite",
    "//ui/base",
  ]
}

static_library("test_support") {
  testonly = true
  sources = [
    "child_frame_navigation_test_utils.cc",
    "child_frame_navigation_test_utils.h",
  ]
  public_deps = [
    ":browser",
    "//components/subresource_filter/core/browser:test_support",
    "//components/subresource_filter/core/common:test_support",
    "//components/subresource_filter/core/mojom",
    "//content/public/browser",
    "//content/test:test_support",
    "//net",
    "//url",
  ]
  deps = [
    "//base",
    "//testing/gtest",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "activation_state_computing_navigation_throttle_unittest.cc",
    "child_frame_navigation_filtering_throttle_unittest.cc",
    "ruleset_publisher_unittest.cc",
    "ruleset_service_unittest.cc",
  ]
  deps = [
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//components/prefs:test_support",
    "//components/subresource_filter/content/shared/common",
    "//components/subresource_filter/core/browser:test_support",
    "//components/subresource_filter/core/common:test_support",
    "//components/subresource_filter/core/mojom",
    "//components/url_pattern_index/proto:url_pattern_index",
    "//content/public/browser",
    "//content/test:test_support",
    "//ipc:test_support",
    "//testing/gtest",
    "//ui/base:test_support",
    "//url",
  ]
}