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

Unified Diff: ash/wm/overview/window_selector_unittest.cc

Issue 256413004: Relayout windows in overview when display size changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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
« no previous file with comments | « ash/wm/overview/window_selector_item.cc ('k') | ash/wm/overview/window_selector_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/window_selector_unittest.cc
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index ce93b6976dd66daa284dfbd72fca57a57164039a..458772c5622a01f4d4e49340c2faad44c1db4076 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -1144,4 +1144,38 @@ TEST_F(WindowSelectorTest, CreateLabelUnderPanel) {
EXPECT_EQ(label->text(), panel1_title);
}
+// Tests that overview updates the window postions if the display orientation
+// changes.
+TEST_F(WindowSelectorTest, DisplayOrientationChanged) {
+ if (!SupportsHostWindowResize())
+ return;
+
+ aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
+ UpdateDisplay("600x200");
+ EXPECT_EQ("0,0 600x200", root_window->bounds().ToString());
+ gfx::Rect window_bounds(0, 0, 150, 150);
+ ScopedVector<aura::Window> windows;
+ for (int i = 0; i < 3; i++) {
+ windows.push_back(CreateWindow(window_bounds));
+ }
+
+ ToggleOverview();
+ for (ScopedVector<aura::Window>::iterator iter = windows.begin();
+ iter != windows.end(); ++iter) {
+ EXPECT_TRUE(root_window->bounds().Contains(
+ ToEnclosingRect(GetTransformedTargetBounds(*iter))));
+ }
+
+ // Rotate the display, windows should be repositioned to be within the screen
+ // bounds.
+ UpdateDisplay("600x200/r");
+ EXPECT_EQ("0,0 200x600", root_window->bounds().ToString());
+ for (ScopedVector<aura::Window>::iterator iter = windows.begin();
+ iter != windows.end(); ++iter) {
+ EXPECT_TRUE(root_window->bounds().Contains(
+ ToEnclosingRect(GetTransformedTargetBounds(*iter))));
+ }
+
oshima 2014/04/25 16:13:39 nuke extra line
flackr 2014/04/25 16:15:54 Done.
+}
+
} // namespace ash
« no previous file with comments | « ash/wm/overview/window_selector_item.cc ('k') | ash/wm/overview/window_selector_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698