# 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("//third_party/protobuf/proto_library.gni")

source_set("test_support") {
  testonly = true
  sources = [
    "family_link_settings_state_management.cc",
    "family_link_settings_state_management.h",
    "features.h",
    "kids_chrome_management_test_utils.cc",
    "kids_chrome_management_test_utils.h",
    "kids_management_api_server_mock.cc",
    "kids_management_api_server_mock.h",
    "parent_access_test_utils.cc",
    "parent_access_test_utils.h",
    "supervised_user_signin_test_utils.cc",
    "supervised_user_signin_test_utils.h",
    "supervised_user_url_filter_test_utils.cc",
    "supervised_user_url_filter_test_utils.h",
    "testutil_proto_fetcher.cc",
    "testutil_proto_fetcher.h",
  ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//components/content_settings/core/browser",
    "//components/prefs",
    "//components/safe_search_api",
    "//components/safe_search_api:test_support",
    "//components/signin/public/identity_manager",
    "//components/signin/public/identity_manager:test_support",
    "//components/supervised_user/core/browser",
    "//components/supervised_user/core/browser:fetcher",
    "//components/supervised_user/core/browser:fetcher_config",
    "//components/supervised_user/core/browser/proto",
    "//components/supervised_user/core/common",
    "//net:test_support",
    "//net/traffic_annotation",
    "//services/network/public/cpp",
    "//url",
  ]

  # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and
  # enable the diagnostic by removing this line.
  configs += [ "//build/config/compiler:no_exit_time_destructors" ]
}

# Repository of test accounts is only supported for platforms that utilize
# end-to-end tests
source_set("account_repository") {
  testonly = true
  sources = [
    "account_repository.cc",
    "account_repository.h",
  ]
  if (is_chrome_branded) {
    data = [
      "//chrome/browser/internal/resources/supervised_user/ios_test_accounts.json",
      "//chrome/browser/internal/resources/supervised_user/linux_test_accounts.json",
      "//chrome/browser/internal/resources/supervised_user/win_test_accounts.json",
    ]
  }
  deps = [
    "//base",
    "//components/supervised_user/core/browser/proto",
  ]

  # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and
  # enable the diagnostic by removing this line.
  configs += [ "//build/config/compiler:no_exit_time_destructors" ]
}
source_set("account_repository_unit_tests") {
  testonly = true
  sources = [ "account_repository_unittest.cc" ]

  deps = [
    ":account_repository",
    "//base",
    "//testing/gmock",
    "//testing/gtest",
  ]
}
