OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include "ash/display/display_layout.h" | 7 #include "ash/display/display_layout.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // 2nd display is disconnected. | 85 // 2nd display is disconnected. |
86 window_state->Minimize(); | 86 window_state->Minimize(); |
87 UpdateDisplay("400x300"); | 87 UpdateDisplay("400x300"); |
88 window_state->Restore(); | 88 window_state->Restore(); |
89 EXPECT_EQ(Shell::GetPrimaryRootWindow(), window->GetRootWindow()); | 89 EXPECT_EQ(Shell::GetPrimaryRootWindow(), window->GetRootWindow()); |
90 EXPECT_TRUE( | 90 EXPECT_TRUE( |
91 Shell::GetPrimaryRootWindow()->bounds().Intersects(window->bounds())); | 91 Shell::GetPrimaryRootWindow()->bounds().Intersects(window->bounds())); |
92 } | 92 } |
93 | 93 |
94 TEST_F(WorkspaceLayoutManagerTest, KeepMinimumVisibilityInDisplays) { | 94 TEST_F(WorkspaceLayoutManagerTest, KeepMinimumVisibilityInDisplays) { |
| 95 if (!SupportsMultipleDisplays()) |
| 96 return; |
| 97 |
95 UpdateDisplay("300x400,400x500"); | 98 UpdateDisplay("300x400,400x500"); |
96 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 99 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
97 | 100 |
98 DisplayLayout layout(DisplayLayout::TOP, 0); | 101 DisplayLayout layout(DisplayLayout::TOP, 0); |
99 Shell::GetInstance()->display_manager()-> | 102 Shell::GetInstance()->display_manager()-> |
100 SetLayoutForCurrentDisplays(layout); | 103 SetLayoutForCurrentDisplays(layout); |
101 EXPECT_EQ("0,-500 400x500", root_windows[1]->GetBoundsInScreen().ToString()); | 104 EXPECT_EQ("0,-500 400x500", root_windows[1]->GetBoundsInScreen().ToString()); |
102 | 105 |
103 scoped_ptr<aura::Window> window1( | 106 scoped_ptr<aura::Window> window1( |
104 CreateTestWindowInShellWithBounds(gfx::Rect(10, -400, 200, 200))); | 107 CreateTestWindowInShellWithBounds(gfx::Rect(10, -400, 200, 200))); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 window->bounds().ToString()); | 400 window->bounds().ToString()); |
398 | 401 |
399 // Directly setting the bounds triggers a slightly different code path. Verify | 402 // Directly setting the bounds triggers a slightly different code path. Verify |
400 // that too. | 403 // that too. |
401 window->SetBounds(window_bounds); | 404 window->SetBounds(window_bounds); |
402 EXPECT_EQ(gfx::Rect(gfx::Point(100, 101), work_area).ToString(), | 405 EXPECT_EQ(gfx::Rect(gfx::Point(100, 101), work_area).ToString(), |
403 window->bounds().ToString()); | 406 window->bounds().ToString()); |
404 } | 407 } |
405 | 408 |
406 } // namespace ash | 409 } // namespace ash |
OLD | NEW |