chromium/components/visited_url_ranking/internal/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.

static_library("internal") {
  visibility = [
    ":*",
    "//chrome/browser",
    "//chrome/browser/visited_url_ranking:*",
    "//chrome/test:*",
    "//ios/chrome/browser/visited_url_ranking/model:*",
  ]

  sources = [
    "history_url_visit_data_fetcher.cc",
    "history_url_visit_data_fetcher.h",
    "session_url_visit_data_fetcher.cc",
    "session_url_visit_data_fetcher.h",
    "transformer/bookmarks_url_visit_aggregates_transformer.cc",
    "transformer/bookmarks_url_visit_aggregates_transformer.h",
    "transformer/default_app_url_visit_aggregates_transformer.cc",
    "transformer/default_app_url_visit_aggregates_transformer.h",
    "transformer/history_url_visit_aggregates_browser_type_transformer.cc",
    "transformer/history_url_visit_aggregates_browser_type_transformer.h",
    "transformer/history_url_visit_aggregates_categories_transformer.cc",
    "transformer/history_url_visit_aggregates_categories_transformer.h",
    "transformer/history_url_visit_aggregates_visibility_score_transformer.cc",
    "transformer/history_url_visit_aggregates_visibility_score_transformer.h",
    "transformer/recency_filter_transformer.cc",
    "transformer/recency_filter_transformer.h",
    "transformer/url_visit_aggregates_segmentation_metrics_transformer.cc",
    "transformer/url_visit_aggregates_segmentation_metrics_transformer.h",
    "visited_url_ranking_service_impl.cc",
    "visited_url_ranking_service_impl.h",
  ]

  #TODO(crbug.com/347191610): Refactor code to eliminate visibility
  #requirement below for `embedder/default_model`.
  deps = [
    "//base",
    "//components/bookmarks/browser",
    "//components/history/core/browser",
    "//components/segmentation_platform/embedder/default_model:default_model",
    "//components/segmentation_platform/internal:internal",
    "//components/segmentation_platform/public",
    "//components/sessions",
    "//components/strings",
    "//components/sync_sessions",
    "//components/url_deduplication",
    "//components/visited_url_ranking/public",
    "//ui/base",
    "//url",
  ]
}

source_set("test_support") {
  testonly = true

  sources = [
    "transformer/transformer_test_support.cc",
    "transformer/transformer_test_support.h",
  ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//components/history/core/browser",
    "//components/visited_url_ranking/public",
    "//testing/gmock",
    "//testing/gtest",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "history_url_visit_data_fetcher_unittest.cc",
    "session_url_visit_data_fetcher_unittest.cc",
    "transformer/bookmarks_url_visit_aggregates_transformer_unittest.cc",
    "transformer/default_app_url_visit_aggregates_transformer_unittest.cc",
    "transformer/history_url_visit_aggregates_browser_type_transformer_unittest.cc",
    "transformer/history_url_visit_aggregates_categories_transformer_unittest.cc",
    "transformer/history_url_visit_aggregates_visibility_score_transformer_unittest.cc",
    "transformer/recency_filter_transformer_unittest.cc",
    "transformer/url_visit_aggregates_segmentation_metrics_transformer_unittest.cc",
    "visited_url_ranking_service_impl_unittest.cc",
  ]

  deps = [
    ":internal",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//components/bookmarks/browser",
    "//components/bookmarks/test",
    "//components/history/core/browser",
    "//components/segmentation_platform/embedder/default_model",
    "//components/segmentation_platform/internal",
    "//components/segmentation_platform/public",
    "//components/segmentation_platform/public:test_support",
    "//components/sessions",
    "//components/sync_sessions",
    "//components/url_deduplication",
    "//components/visited_url_ranking/public",
    "//components/visited_url_ranking/public:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
}