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_util.h" |
11 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
12 #include "ash/shelf/shelf_widget.h" | 12 #include "ash/shelf/shelf_widget.h" |
13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
14 #include "ash/shell_observer.h" | 14 #include "ash/shell_observer.h" |
15 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
16 #include "ash/wm/window_state.h" | 16 #include "ash/wm/window_state.h" |
17 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
18 #include "ui/aura/client/aura_constants.h" | 18 #include "ui/aura/client/aura_constants.h" |
19 #include "ui/aura/root_window.h" | 19 #include "ui/aura/root_window.h" |
20 #include "ui/aura/test/test_windows.h" | 20 #include "ui/aura/test/test_windows.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 window_state->Minimize(); | 101 window_state->Minimize(); |
102 window_state->Restore(); | 102 window_state->Restore(); |
103 EXPECT_EQ("0,0 100x100", window_state->GetRestoreBoundsInScreen().ToString()); | 103 EXPECT_EQ("0,0 100x100", window_state->GetRestoreBoundsInScreen().ToString()); |
104 EXPECT_EQ("10,15 25x35", window.get()->bounds().ToString()); | 104 EXPECT_EQ("10,15 25x35", window.get()->bounds().ToString()); |
105 | 105 |
106 if (!SupportsMultipleDisplays()) | 106 if (!SupportsMultipleDisplays()) |
107 return; | 107 return; |
108 | 108 |
109 UpdateDisplay("400x300,500x400"); | 109 UpdateDisplay("400x300,500x400"); |
110 window->SetBoundsInScreen(gfx::Rect(600, 0, 100, 100), | 110 window->SetBoundsInScreen(gfx::Rect(600, 0, 100, 100), |
111 ScreenAsh::GetSecondaryDisplay()); | 111 ScreenUtil::GetSecondaryDisplay()); |
112 EXPECT_EQ(Shell::GetAllRootWindows()[1], window->GetRootWindow()); | 112 EXPECT_EQ(Shell::GetAllRootWindows()[1], window->GetRootWindow()); |
113 window_state->Minimize(); | 113 window_state->Minimize(); |
114 // This will not be used for un-minimizing window. | 114 // This will not be used for un-minimizing window. |
115 window_state->SetRestoreBoundsInScreen(gfx::Rect(0, 0, 100, 100)); | 115 window_state->SetRestoreBoundsInScreen(gfx::Rect(0, 0, 100, 100)); |
116 window_state->Restore(); | 116 window_state->Restore(); |
117 EXPECT_EQ("600,0 100x100", window->GetBoundsInScreen().ToString()); | 117 EXPECT_EQ("600,0 100x100", window->GetBoundsInScreen().ToString()); |
118 | 118 |
119 // Make sure the unminimized window moves inside the display when | 119 // Make sure the unminimized window moves inside the display when |
120 // 2nd display is disconnected. | 120 // 2nd display is disconnected. |
121 window_state->Minimize(); | 121 window_state->Minimize(); |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 EXPECT_EQ(5, observer.call_count()); | 473 EXPECT_EQ(5, observer.call_count()); |
474 EXPECT_TRUE(observer.is_fullscreen()); | 474 EXPECT_TRUE(observer.is_fullscreen()); |
475 | 475 |
476 // Closing the window should change the fullscreen state. | 476 // Closing the window should change the fullscreen state. |
477 window2.reset(); | 477 window2.reset(); |
478 EXPECT_EQ(6, observer.call_count()); | 478 EXPECT_EQ(6, observer.call_count()); |
479 EXPECT_FALSE(observer.is_fullscreen()); | 479 EXPECT_FALSE(observer.is_fullscreen()); |
480 } | 480 } |
481 | 481 |
482 } // namespace ash | 482 } // namespace ash |
OLD | NEW |