| 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/test/power_monitor_test_base.h" | 6 #include "base/test/power_monitor_test_base.h" |
| 6 #include "content/browser/power_monitor_message_broadcaster.h" | 7 #include "content/browser/power_monitor_message_broadcaster.h" |
| 7 #include "content/common/power_monitor_messages.h" | 8 #include "content/common/power_monitor_messages.h" |
| 8 #include "ipc/ipc_sender.h" | 9 #include "ipc/ipc_sender.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 11 namespace content { | 12 namespace content { |
| 12 | 13 |
| 13 class PowerMonitorMessageSender : public IPC::Sender { | 14 class PowerMonitorMessageSender : public IPC::Sender { |
| 14 public: | 15 public: |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // Pretend the device has gone off battery power | 105 // Pretend the device has gone off battery power |
| 105 source()->GeneratePowerStateEvent(false); | 106 source()->GeneratePowerStateEvent(false); |
| 106 EXPECT_EQ(sender.power_state_changes(), 3); | 107 EXPECT_EQ(sender.power_state_changes(), 3); |
| 107 | 108 |
| 108 // Repeated indications the device is off battery power should be suppressed. | 109 // Repeated indications the device is off battery power should be suppressed. |
| 109 source()->GeneratePowerStateEvent(false); | 110 source()->GeneratePowerStateEvent(false); |
| 110 EXPECT_EQ(sender.power_state_changes(), 3); | 111 EXPECT_EQ(sender.power_state_changes(), 3); |
| 111 } | 112 } |
| 112 | 113 |
| 113 } // namespace base | 114 } // namespace base |
| OLD | NEW |