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

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

Issue 2855033004: cros: Update touchscreen status with backlights forced off state during start (Closed)
Patch Set: nits Created 3 years, 8 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') | ash/wm/power_button_controller.h » ('j') | 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 df64ebabf3993c2405a5c162978eb3e0ed4da327..c11d449314fa87fc4fbd3da4444108530645e6fe 100644
--- a/ash/system/power/tablet_power_button_controller_unittest.cc
+++ b/ash/system/power/tablet_power_button_controller_unittest.cc
@@ -507,5 +507,25 @@ TEST_F(TabletPowerButtonControllerTest, LidEventsStopForcingOff) {
EXPECT_FALSE(GetBacklightsForcedOff());
}
+// Tests that with system reboot, the local state of touchscreen enabled state
+// should be synced with new backlights forced off state from powerd.
+TEST_F(TabletPowerButtonControllerTest, SyncTouchscreenStatus) {
+ shell_delegate_->SetTouchscreenEnabledInPrefs(false,
+ true /* use_local_state */);
+ ASSERT_FALSE(shell_delegate_->IsTouchscreenEnabledInPrefs(true));
+
+ // Simulate system reboot by resetting backlights forced off state in powerd
+ // and TabletPowerButtonController.
+ power_manager_client_->SetBacklightsForcedOff(false);
+ Shell::Get()
+ ->power_button_controller()
+ ->ResetTabletPowerButtonControllerForTest();
+
+ // Check that the local state of touchscreen enabled state is in line with
+ // backlights forced off state.
+ EXPECT_FALSE(GetBacklightsForcedOff());
+ EXPECT_TRUE(shell_delegate_->IsTouchscreenEnabledInPrefs(true));
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « ash/system/power/tablet_power_button_controller.cc ('k') | ash/wm/power_button_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698