Chromium Code Reviews| 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 |