OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/battery/battery_status_manager_win.h" | 5 #include "services/device/battery/battery_status_manager_win.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace device { | 9 namespace device { |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 TEST(BatteryStatusManagerWinTest, ACLineStatusOffline) { | 13 TEST(BatteryStatusManagerWinTest, ACLineStatusOffline) { |
14 SYSTEM_POWER_STATUS win_status; | 14 SYSTEM_POWER_STATUS win_status; |
15 win_status.ACLineStatus = WIN_AC_LINE_STATUS_OFFLINE; | 15 win_status.ACLineStatus = WIN_AC_LINE_STATUS_OFFLINE; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 mojom::BatteryStatus status = ComputeWebBatteryStatus(win_status); | 71 mojom::BatteryStatus status = ComputeWebBatteryStatus(win_status); |
72 EXPECT_TRUE(status.charging); | 72 EXPECT_TRUE(status.charging); |
73 EXPECT_EQ(std::numeric_limits<double>::infinity(), status.charging_time); | 73 EXPECT_EQ(std::numeric_limits<double>::infinity(), status.charging_time); |
74 EXPECT_EQ(std::numeric_limits<double>::infinity(), status.discharging_time); | 74 EXPECT_EQ(std::numeric_limits<double>::infinity(), status.discharging_time); |
75 EXPECT_EQ(.5, status.level); | 75 EXPECT_EQ(.5, status.level); |
76 } | 76 } |
77 | 77 |
78 } // namespace | 78 } // namespace |
79 | 79 |
80 } // namespace device | 80 } // namespace device |
OLD | NEW |