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

Unified Diff: ash/wm/maximize_mode/maximize_mode_controller_unittest.cc

Issue 2775683002: CrOS: Apply flag which enables us to force maximize mode. (Closed)
Patch Set: Rebased. Created 3 years, 9 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/common/wm/maximize_mode/maximize_mode_controller.cc ('k') | chrome/browser/about_flags.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 64c0357824182e698e34df9c5aaa0d9cd2049587..153f758a9aae64ef84a2249074fc70e44c0ecd69 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
@@ -179,6 +179,10 @@ class MaximizeModeControllerTest : public test::AshTestBase {
return !!maximize_mode_controller()->event_blocker_.get();
}
+ MaximizeModeController::ForceTabletMode forced_tablet_mode() {
+ return maximize_mode_controller()->force_tablet_mode_;
+ }
+
base::UserActionTester* user_action_tester() { return &user_action_tester_; }
private:
@@ -602,4 +606,44 @@ TEST_F(MaximizeModeControllerTest, InitializedWhileTabletModeSwitchOn) {
EXPECT_TRUE(controller.IsMaximizeModeWindowManagerEnabled());
}
+// Verify when the force clamshell mode flag is turned on, opening the lid past
+// 180 degrees or setting tablet mode to true will no turn on maximize mode.
+TEST_F(MaximizeModeControllerTest, ForceClamshellModeTest) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kAshForceTabletMode, switches::kAshForceTabletModeClamshell);
+ maximize_mode_controller()->OnShellInitialized();
+ EXPECT_EQ(MaximizeModeController::ForceTabletMode::CLAMSHELL,
+ forced_tablet_mode());
+ EXPECT_FALSE(IsMaximizeModeStarted());
+
+ OpenLidToAngle(300.0f);
+ EXPECT_FALSE(IsMaximizeModeStarted());
+ EXPECT_FALSE(AreEventsBlocked());
+
+ SetTabletMode(true);
+ EXPECT_FALSE(IsMaximizeModeStarted());
+ EXPECT_FALSE(AreEventsBlocked());
+}
+
+// Verify when the force touch view mode flag is turned on, maximize mode is on
+// intially, and opening the lid to less than 180 degress or setting tablet mode
+// to off will not turn off maximize mode.
+TEST_F(MaximizeModeControllerTest, ForceTouchViewModeTest) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kAshForceTabletMode, switches::kAshForceTabletModeTouchView);
+ maximize_mode_controller()->OnShellInitialized();
+ EXPECT_EQ(MaximizeModeController::ForceTabletMode::TOUCHVIEW,
+ forced_tablet_mode());
+ EXPECT_TRUE(IsMaximizeModeStarted());
+ EXPECT_TRUE(AreEventsBlocked());
+
+ OpenLidToAngle(30.0f);
+ EXPECT_TRUE(IsMaximizeModeStarted());
+ EXPECT_TRUE(AreEventsBlocked());
+
+ SetTabletMode(false);
+ EXPECT_TRUE(IsMaximizeModeStarted());
+ EXPECT_TRUE(AreEventsBlocked());
+}
+
} // namespace ash
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_controller.cc ('k') | chrome/browser/about_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698