Chromium Code Reviews| Index: ash/system/power/tablet_power_button_controller_unittest.cc |
| diff --git a/ash/system/power/tablet_power_button_controller_unittest.cc b/ash/system/power/tablet_power_button_controller_unittest.cc |
| index 3a5139d8205d784a9c97c758d2bb2f46d56294f3..aca381303ebd3225421d28b918429f819dccd341 100644 |
| --- a/ash/system/power/tablet_power_button_controller_unittest.cc |
| +++ b/ash/system/power/tablet_power_button_controller_unittest.cc |
| @@ -568,5 +568,21 @@ TEST_F(TabletPowerButtonControllerTest, SuspendMediaSessions) { |
| EXPECT_TRUE(shell_delegate_->media_sessions_suspended()); |
| } |
| +// Tests that system is suspended with backlights forced off, and then system |
|
Daniel Erat
2017/06/22 18:08:40
nit: s/Tests that system/Tests that when system/
Qiang(Joe) Xu
2017/06/22 18:36:35
Done.
|
| +// resumes due to power button pressed without power button event fired |
| +// (crbug.com/735291), that we shall still stop forcing off backlights. |
|
Daniel Erat
2017/06/22 18:08:40
nit: remove "shall still"
Qiang(Joe) Xu
2017/06/22 18:36:36
Done.
|
| +TEST_F(TabletPowerButtonControllerTest, SuspendDoneStopsForcingOff) { |
| + PressPowerButton(); |
| + ReleasePowerButton(); |
| + power_manager_client_->SendBrightnessChanged(0, false); |
| + ASSERT_TRUE(GetBacklightsForcedOff()); |
| + |
| + // Simulate an edge case that system resumes because of tablet power button |
| + // pressed, but power button event is not delivered. |
| + power_manager_client_->SendSuspendDone(); |
| + |
| + EXPECT_FALSE(GetBacklightsForcedOff()); |
| +} |
| + |
| } // namespace test |
| } // namespace ash |