| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/macros.h" |
| 5 #include "base/power_monitor/power_monitor.h" | 6 #include "base/power_monitor/power_monitor.h" |
| 6 #include "base/test/power_monitor_test_base.h" | 7 #include "base/test/power_monitor_test_base.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 9 |
| 9 namespace base { | 10 namespace base { |
| 10 | 11 |
| 11 class PowerMonitorTest : public testing::Test { | 12 class PowerMonitorTest : public testing::Test { |
| 12 protected: | 13 protected: |
| 13 PowerMonitorTest() { | 14 PowerMonitorTest() { |
| 14 power_monitor_source_ = new PowerMonitorTestSource(); | 15 power_monitor_source_ = new PowerMonitorTestSource(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 source()->GeneratePowerStateEvent(false); | 72 source()->GeneratePowerStateEvent(false); |
| 72 EXPECT_EQ(observers[0].power_state_changes(), 2); | 73 EXPECT_EQ(observers[0].power_state_changes(), 2); |
| 73 EXPECT_EQ(observers[0].last_power_state(), false); | 74 EXPECT_EQ(observers[0].last_power_state(), false); |
| 74 | 75 |
| 75 // Repeated indications the device is off battery power should be suppressed. | 76 // Repeated indications the device is off battery power should be suppressed. |
| 76 source()->GeneratePowerStateEvent(false); | 77 source()->GeneratePowerStateEvent(false); |
| 77 EXPECT_EQ(observers[0].power_state_changes(), 2); | 78 EXPECT_EQ(observers[0].power_state_changes(), 2); |
| 78 } | 79 } |
| 79 | 80 |
| 80 } // namespace base | 81 } // namespace base |
| OLD | NEW |