| Index: ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| diff --git a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| index 251885b7212fc2907158ccc625f6a02efdc56235..41b6bf9743bfd524214e6e1ff99272659f22887a 100644
|
| --- a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| +++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| @@ -155,6 +155,15 @@ class MaximizeModeControllerTest : public test::AshTestBase {
|
| return maximize_mode_controller()->WasLidOpenedRecently();
|
| }
|
|
|
| + void ToggleTabletMode(const bool on) {
|
| + maximize_mode_controller()->TabletModeEventReceived(
|
| + on, maximize_mode_controller()->tick_clock_->NowTicks());
|
| + }
|
| +
|
| + bool WasTabletModeOn() {
|
| + return maximize_mode_controller()->tablet_mode_switch_was_on_;
|
| + }
|
| +
|
| bool AreEventsBlocked() {
|
| return !!maximize_mode_controller()->event_blocker_.get();
|
| }
|
| @@ -266,6 +275,32 @@ TEST_F(MaximizeModeControllerTest, WasLidOpenedRecentlyOverTime) {
|
| EXPECT_FALSE(WasLidOpenedRecently());
|
| }
|
|
|
| +TEST_F(MaximizeModeControllerTest, TabletModeTransition) {
|
| + ASSERT_FALSE(WasTabletModeOn());
|
| +
|
| + OpenLidToAngle(90.0f);
|
| + EXPECT_FALSE(IsMaximizeModeStarted());
|
| +
|
| + OpenLidToAngle(355.0f);
|
| + EXPECT_FALSE(IsMaximizeModeStarted());
|
| +
|
| + ToggleTabletMode(true);
|
| + EXPECT_FALSE(WasTabletModeOn());
|
| + EXPECT_TRUE(IsMaximizeModeStarted());
|
| +
|
| + ToggleTabletMode(false);
|
| + EXPECT_TRUE(WasTabletModeOn());
|
| + EXPECT_TRUE(IsMaximizeModeStarted());
|
| +
|
| + OpenLidToAngle(300.0f);
|
| + EXPECT_TRUE(WasTabletModeOn());
|
| + EXPECT_TRUE(IsMaximizeModeStarted());
|
| +
|
| + OpenLidToAngle(90.0f);
|
| + EXPECT_FALSE(WasTabletModeOn());
|
| + EXPECT_FALSE(IsMaximizeModeStarted());
|
| +}
|
| +
|
| // Verify the maximize mode enter/exit thresholds for stable angles.
|
| TEST_F(MaximizeModeControllerTest, StableHingeAnglesWithLidOpened) {
|
| ASSERT_FALSE(IsMaximizeModeStarted());
|
|
|