chromium/chrome/browser/ash/app_mode/auto_sleep/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/chromeos/ui_mode.gni")

assert(is_chromeos_ash)

static_library("auto_sleep") {
  sources = [
    "device_weekly_scheduled_suspend_controller.cc",
    "device_weekly_scheduled_suspend_controller.h",
    "device_weekly_scheduled_suspend_policy_handler.cc",
    "device_weekly_scheduled_suspend_policy_handler.h",
    "repeating_time_interval_task_executor.cc",
    "repeating_time_interval_task_executor.h",
  ]
  public_deps = [
    "//base",
    "//chrome/browser:browser_public_dependencies",
    "//chromeos/ash/components/policy",
    "//chromeos/ash/components/settings",
    "//chromeos/dbus/power",
    "//components/prefs",
  ]
  deps = [
    "//ash",
    "//chrome/browser:browser_process",
    "//chrome/browser/ash/policy/scheduled_task_handler",
    "//chrome/common:constants",
    "//components/policy:generated",
    "//components/policy:policy_code_generate",
    "//components/policy/core/browser",
  ]
}

static_library("test_support") {
  testonly = true
  sources = [
    "device_weekly_scheduled_suspend_test_policy_builder.cc",
    "device_weekly_scheduled_suspend_test_policy_builder.h",
    "fake_repeating_time_interval_task_executor.cc",
    "fake_repeating_time_interval_task_executor.h",
  ]
  public_deps = [
    "//chrome/browser/ash/app_mode/auto_sleep",
    "//chromeos/ash/components/policy",
    "//extensions:test_support",
    "//extensions/common",
    "//net:test_support",
    "//testing/gmock",
  ]
  deps = [
    "//chrome/common",
    "//chrome/common:constants",
    "//chrome/common:non_code_constants",
    "//chrome/test:test_support_ui",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "device_weekly_scheduled_suspend_controller_unittest.cc",
    "repeating_time_interval_task_executor_unittest.cc",
  ]
  deps = [
    "//base",
    "//base/test:test_support",
    "//chrome/browser/ash/app_mode/auto_sleep",
    "//chrome/browser/ash/app_mode/auto_sleep:test_support",
    "//chrome/common:constants",
    "//chrome/test:test_support",
    "//chromeos/ash/components/policy",
    "//chromeos/ash/components/settings",
    "//chromeos/dbus/power",
    "//content/test:test_support",
    "//testing/gtest",
  ]
}

source_set("browser_tests") {
  testonly = true
  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
  sources = [ "device_weekly_scheduled_suspend_controller_browsertest.cc" ]
  deps = [
    ":auto_sleep",
    ":test_support",
    "//chrome/browser:browser_process",
    "//chrome/browser/ash/app_mode",
    "//chrome/browser/ash/login/app_mode/test:test_support",
    "//chrome/browser/devtools:test_support",
    "//chrome/browser/ui/ash/system_web_apps",
    "//chrome/common:constants",
    "//chrome/test:test_support",
    "//content/test:test_support",
    "//ui/events:test_support",
  ]
}