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

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

Issue 2811153002: Restore bounds after the screen is restored in clamshell (Closed)
Patch Set: Restore bounds after completely transitioned to clamshell. 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
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 c39caa27c04fcef9f9195b6d883b3300b0c4c577..cf6bb66e3fb045e9b2b0105506574dd5b3937240 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
@@ -9,6 +9,7 @@
#include <vector>
#include "ash/ash_switches.h"
+#include "ash/display/screen_orientation_controller_chromeos.h"
#include "ash/shell.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/test/ash_test_base.h"
@@ -23,6 +24,7 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/fake_power_manager_client.h"
#include "ui/display/manager/display_manager.h"
+#include "ui/display/screen.h"
#include "ui/display/test/display_manager_test_api.h"
#include "ui/events/event_handler.h"
#include "ui/events/test/event_generator.h"
@@ -645,4 +647,25 @@ TEST_F(MaximizeModeControllerTest, ForceTouchViewModeTest) {
EXPECT_TRUE(AreEventsBlocked());
}
+TEST_F(MaximizeModeControllerTest, RestoreAfterExit) {
+ UpdateDisplay("1000x600");
+ std::unique_ptr<aura::Window> w1(
+ CreateTestWindowInShellWithBounds(gfx::Rect(10, 10, 900, 300)));
+ maximize_mode_controller()->EnableMaximizeModeWindowManager(true);
+ Shell::Get()->screen_orientation_controller()->SetLockToRotation(
+ display::Display::ROTATE_90);
+ display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
+ EXPECT_EQ(display::Display::ROTATE_90, display.rotation());
+ EXPECT_LT(display.size().width(), display.size().height());
+ maximize_mode_controller()->EnableMaximizeModeWindowManager(false);
+ display = display::Screen::GetScreen()->GetPrimaryDisplay();
+ // Sanity checks.
+ EXPECT_EQ(display::Display::ROTATE_0, display.rotation());
+ EXPECT_GT(display.size().width(), display.size().height());
+
+ // The bounds should be restored to the original bounds, and
+ // should not be clamped by the portrait display in touch view.
+ EXPECT_EQ(gfx::Rect(10, 10, 900, 300), w1->bounds());
+}
+
} // namespace ash
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_controller.cc ('k') | ash/wm/maximize_mode/maximize_mode_window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698