Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4312)

Unified Diff: ash/system/power/tablet_power_button_controller_unittest.cc

Issue 2946233003: cros: stop forcing off display when powerd reports SuspendDone (Closed)
Patch Set: nits Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/power/tablet_power_button_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f5c1bc86ac1eac9c4c7942c34834c7582d02778f 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 when system is suspended with backlights forced off, and then
+// system resumes due to power button pressed without power button event fired
+// (crbug.com/735291), that we stop forcing off backlights.
+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
« no previous file with comments | « ash/system/power/tablet_power_button_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698