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

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

Issue 2649553004: Do not enter Maximize Mode while docked (Closed)
Patch Set: . Created 3 years, 11 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') | no next file » | 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 616917d182bca0d30fabbe4e172d9974d0e98273..f627dff5bb7490f4e87537b4b63a7b0fa07a41c5 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
@@ -506,6 +506,45 @@ TEST_F(MaximizeModeControllerTest, NoMaximizeModeWithDisabledInternalDisplay) {
OpenLidToAngle(270.0f);
EXPECT_FALSE(IsMaximizeModeStarted());
EXPECT_FALSE(AreEventsBlocked());
+
+ // Tablet mode signal should also be ignored.
+ SetTabletMode(true);
+ EXPECT_FALSE(IsMaximizeModeStarted());
+ EXPECT_FALSE(AreEventsBlocked());
+}
+
+// Tests that is a tablet mode signal is received while docked, that maximize
+// mode is enabled upon exiting docked mode.
+TEST_F(MaximizeModeControllerTest, MaximizeModeAfterExitingDockedMode) {
+ UpdateDisplay("200x200, 200x200");
+ const int64_t internal_display_id =
+ display::test::DisplayManagerTestApi(display_manager())
+ .SetFirstDisplayAsInternalDisplay();
+ ASSERT_FALSE(IsMaximizeModeStarted());
+
+ // Deactivate internal display to simulate Docked Mode.
+ std::vector<display::ManagedDisplayInfo> all_displays;
+ all_displays.push_back(display_manager()->GetDisplayInfo(
+ display_manager()->GetDisplayAt(0).id()));
+ std::vector<display::ManagedDisplayInfo> secondary_only;
+ display::ManagedDisplayInfo secondary_display =
+ display_manager()->GetDisplayInfo(
+ display_manager()->GetDisplayAt(1).id());
+ all_displays.push_back(secondary_display);
+ secondary_only.push_back(secondary_display);
+ display_manager()->OnNativeDisplaysChanged(secondary_only);
+ ASSERT_FALSE(display_manager()->IsActiveDisplayId(internal_display_id));
+
+ // Tablet mode signal should also be ignored.
+ SetTabletMode(true);
+ EXPECT_FALSE(IsMaximizeModeStarted());
+ EXPECT_FALSE(AreEventsBlocked());
+
+ // Exiting docked state
+ display_manager()->OnNativeDisplaysChanged(all_displays);
+ display::test::DisplayManagerTestApi(display_manager())
+ .SetFirstDisplayAsInternalDisplay();
+ EXPECT_TRUE(IsMaximizeModeStarted());
}
// Verify that the device won't exit touchview / maximize mode for unstable
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698