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/power_monitor/power_monitor.h" | 5 #include "base/power_monitor/power_monitor.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 | 11 |
12 class PowerTest : public PowerObserver { | 12 class PowerTest : public PowerObserver { |
13 public: | 13 public: |
14 PowerTest() | 14 PowerTest() |
15 : power_state_changes_(0), | 15 : power_state_changes_(0), |
16 suspends_(0), | 16 suspends_(0), |
17 resumes_(0) { | 17 resumes_(0) { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 message_loop_.RunUntilIdle(); | 97 message_loop_.RunUntilIdle(); |
98 EXPECT_EQ(test[0].resumes(), 1); | 98 EXPECT_EQ(test[0].resumes(), 1); |
99 | 99 |
100 // Send a duplicate resume notification. This should be suppressed. | 100 // Send a duplicate resume notification. This should be suppressed. |
101 ProcessPowerEvent(PowerMonitor::RESUME_EVENT); | 101 ProcessPowerEvent(PowerMonitor::RESUME_EVENT); |
102 message_loop_.RunUntilIdle(); | 102 message_loop_.RunUntilIdle(); |
103 EXPECT_EQ(test[0].resumes(), 1); | 103 EXPECT_EQ(test[0].resumes(), 1); |
104 } | 104 } |
105 | 105 |
106 } // namespace base | 106 } // namespace base |
OLD | NEW |