# Copyright 2019 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")
assert(is_chromeos, "Non-Chrome-OS builds cannot depend on //chromeos")
component("power") {
defines = [ "IS_DBUS_POWER_IMPL" ]
deps = [
":power_manager_proto",
"//base",
"//chromeos/dbus/common",
"//components/device_event_log",
"//dbus",
]
sources = [
"fake_power_manager_client.cc",
"fake_power_manager_client.h",
"native_timer.cc",
"native_timer.h",
"power_manager_client.cc",
"power_manager_client.h",
"power_policy_controller.cc",
"power_policy_controller.h",
]
}
source_set("unit_tests") {
testonly = true
public_deps = [ ":power" ]
deps = [
":power_manager_proto",
"//base",
"//base/test:test_support",
"//dbus:test_support",
"//testing/gmock",
"//testing/gtest",
]
sources = [
"fake_power_manager_client_unittest.cc",
"native_timer_unittest.cc",
"power_manager_client_unittest.cc",
"power_policy_controller_unittest.cc",
]
}
proto_library("power_manager_proto") {
sources = [
"//third_party/cros_system_api/dbus/power_manager/backlight.proto",
"//third_party/cros_system_api/dbus/power_manager/battery_saver.proto",
"//third_party/cros_system_api/dbus/power_manager/charge_history_state.proto",
"//third_party/cros_system_api/dbus/power_manager/idle.proto",
"//third_party/cros_system_api/dbus/power_manager/input_event.proto",
"//third_party/cros_system_api/dbus/power_manager/peripheral_battery_status.proto",
"//third_party/cros_system_api/dbus/power_manager/policy.proto",
"//third_party/cros_system_api/dbus/power_manager/power_supply_properties.proto",
"//third_party/cros_system_api/dbus/power_manager/suspend.proto",
"//third_party/cros_system_api/dbus/power_manager/switch_states.proto",
"//third_party/cros_system_api/dbus/power_manager/thermal.proto",
"//third_party/cros_system_api/dbus/power_manager/user_charging_event.proto",
]
proto_out_dir = "chromeos/dbus/power_manager"
}