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

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

Issue 2864503002: [merge to m58] cros: Update touchscreen status with backlights forced off state during start (Closed)
Patch Set: Created 3 years, 7 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/chromeos/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/chromeos/power/tablet_power_button_controller_unittest.cc
diff --git a/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc b/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
index 8a2df301343d4768b12ed7e479d5dbeee0cf6829..b71742403e5a4e3482e8c33c807ad89f4a6d2386 100644
--- a/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
+++ b/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
@@ -477,5 +477,25 @@ TEST_F(TabletPowerButtonControllerTest, IgnoreRepeatedPowerButtonReleases) {
EXPECT_TRUE(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::GetInstance()
+ ->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/chromeos/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