# Copyright 2025 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/chrome_build.gni")

if (is_win) {
  source_set("delegated_tasks") {
    public = [
      "delegated_tasks/delegated_task.h",
      "delegated_tasks/delegated_task_runner.h",
      "delegated_tasks/peh_launcher.h",
      "delegated_tasks/peh_switches.h",
    ]

    sources = [
      "delegated_tasks/delegated_task.cc",
      "delegated_tasks/delegated_task_runner.cc",
      "delegated_tasks/peh_launcher.cc",
    ]

    deps = [
      "//base",
      "//chrome/common:constants",
      "//chrome/install_static:install_static_util",
    ]
  }

  source_set("test_support") {
    testonly = true
    public = [
      "delegated_tasks/test_support/mock_delegated_task_runner.h",
      "delegated_tasks/test_support/mock_peh_launcher.h",
    ]
    sources = [
      "delegated_tasks/test_support/mock_delegated_task_runner.cc",
      "delegated_tasks/test_support/mock_peh_launcher.cc",
    ]
    public_deps = [
      ":delegated_tasks",
      "//testing/gmock",
    ]
    deps = [ "//base" ]
  }
}

source_set("features") {
  public = [ "features.h" ]
  sources = [ "features.cc" ]
  public_deps = [ "//base" ]
  deps = [ "//chrome/common:constants" ]
}

source_set("prefs") {
  public = [ "prefs.h" ]
  sources = [ "prefs.cc" ]
  public_deps = [
    ":features",
    "//base",
    "//components/prefs",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "features_unittest.cc",
    "prefs_unittest.cc",
  ]
  deps = [
    ":features",
    ":prefs",
    "//base/test:test_support",
    "//chrome/test:test_support",
    "//components/prefs",
    "//components/prefs:test_support",
    "//testing/gtest",
  ]
  if (is_win) {
    sources += [
      "delegated_tasks/delegated_task_runner_unittest.cc",
      "delegated_tasks/peh_launcher_unittest.cc",
    ]
    deps += [
      ":delegated_tasks",
      ":test_support",
      "//chrome/install_static:install_static_util",
      "//chrome/install_static/test:test_support",
      "//testing/gmock",
    ]
  }
}
