1# Copyright 2019 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//third_party/protobuf/proto_library.gni")
6
7assert(is_chromeos, "Non-Chrome-OS builds cannot depend on //chromeos")
8
9component("power") {
10  defines = [ "IS_DBUS_POWER_IMPL" ]
11
12  deps = [
13    ":power_manager_proto",
14    "//base",
15    "//chromeos/dbus:common",
16    "//components/device_event_log",
17    "//dbus",
18  ]
19
20  sources = [
21    "fake_power_manager_client.cc",
22    "fake_power_manager_client.h",
23    "native_timer.cc",
24    "native_timer.h",
25    "power_manager_client.cc",
26    "power_manager_client.h",
27    "power_policy_controller.cc",
28    "power_policy_controller.h",
29  ]
30}
31
32source_set("test_support") {
33  testonly = true
34  public_deps = [ ":power" ]
35  deps = [
36    ":power_manager_proto",
37    "//base",
38    "//base/test:test_support",
39    "//dbus:test_support",
40    "//testing/gmock",
41    "//testing/gtest",
42  ]
43
44  sources = [
45    "fake_power_manager_client_unittest.cc",
46    "power_manager_client_unittest.cc",
47    "power_policy_controller_unittest.cc",
48  ]
49}
50
51proto_library("power_manager_proto") {
52  sources = [
53    "//third_party/cros_system_api/dbus/power_manager/backlight.proto",
54    "//third_party/cros_system_api/dbus/power_manager/idle.proto",
55    "//third_party/cros_system_api/dbus/power_manager/input_event.proto",
56    "//third_party/cros_system_api/dbus/power_manager/peripheral_battery_status.proto",
57    "//third_party/cros_system_api/dbus/power_manager/policy.proto",
58    "//third_party/cros_system_api/dbus/power_manager/power_supply_properties.proto",
59    "//third_party/cros_system_api/dbus/power_manager/suspend.proto",
60    "//third_party/cros_system_api/dbus/power_manager/switch_states.proto",
61  ]
62
63  proto_out_dir = "chromeos/dbus/power_manager"
64}
65