Index: content/browser/power_monitor_message_broadcaster_unittest.cc |
diff --git a/content/browser/power_monitor_message_broadcaster_unittest.cc b/content/browser/power_monitor_message_broadcaster_unittest.cc |
index 515508266cf812cf6ca10152d64f46a72fe4593f..c277e83177d9872bd47d0141007af0fbb84626d6 100644 |
--- a/content/browser/power_monitor_message_broadcaster_unittest.cc |
+++ b/content/browser/power_monitor_message_broadcaster_unittest.cc |
@@ -69,6 +69,10 @@ TEST_F(PowerMonitorMessageBroadcasterTest, PowerMessageBroadcast) { |
PowerMonitorMessageSender sender; |
PowerMonitorMessageBroadcaster broadcaster(&sender); |
+ // Calling Init should invoke a power state change. |
+ broadcaster.Init(); |
+ EXPECT_EQ(sender.power_state_changes(), 1); |
+ |
// Sending resume when not suspended should have no effect. |
source()->GenerateResumeEvent(); |
EXPECT_EQ(sender.resumes(), 0); |
@@ -91,19 +95,19 @@ TEST_F(PowerMonitorMessageBroadcasterTest, PowerMessageBroadcast) { |
// Pretend the device has gone on battery power |
source()->GeneratePowerStateEvent(true); |
- EXPECT_EQ(sender.power_state_changes(), 1); |
+ EXPECT_EQ(sender.power_state_changes(), 2); |
// Repeated indications the device is on battery power should be suppressed. |
source()->GeneratePowerStateEvent(true); |
- EXPECT_EQ(sender.power_state_changes(), 1); |
+ EXPECT_EQ(sender.power_state_changes(), 2); |
// Pretend the device has gone off battery power |
source()->GeneratePowerStateEvent(false); |
- EXPECT_EQ(sender.power_state_changes(), 2); |
+ EXPECT_EQ(sender.power_state_changes(), 3); |
// Repeated indications the device is off battery power should be suppressed. |
source()->GeneratePowerStateEvent(false); |
- EXPECT_EQ(sender.power_state_changes(), 2); |
+ EXPECT_EQ(sender.power_state_changes(), 3); |
} |
} // namespace base |