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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100)); | 113 views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100)); |
114 EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow()); | 114 EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow()); |
115 EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString()); | 115 EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString()); |
116 EXPECT_EQ("50,10 100x100", | 116 EXPECT_EQ("50,10 100x100", |
117 normal->GetNativeView()->GetBoundsInRootWindow().ToString()); | 117 normal->GetNativeView()->GetBoundsInRootWindow().ToString()); |
118 | 118 |
119 views::Widget* maximized = CreateTestWidget(gfx::Rect(700, 10, 100, 100)); | 119 views::Widget* maximized = CreateTestWidget(gfx::Rect(700, 10, 100, 100)); |
120 maximized->Maximize(); | 120 maximized->Maximize(); |
121 EXPECT_EQ(root_windows[1], maximized->GetNativeView()->GetRootWindow()); | 121 EXPECT_EQ(root_windows[1], maximized->GetNativeView()->GetRootWindow()); |
122 #if !defined(OS_WIN) | 122 |
123 // TODO(oshima): Window reports smaller screen size. Investigate why. | |
124 EXPECT_EQ("600,0 500x500", maximized->GetWindowBoundsInScreen().ToString()); | 123 EXPECT_EQ("600,0 500x500", maximized->GetWindowBoundsInScreen().ToString()); |
125 EXPECT_EQ("0,0 500x500", | 124 EXPECT_EQ("0,0 500x500", |
126 maximized->GetNativeView()->GetBoundsInRootWindow().ToString()); | 125 maximized->GetNativeView()->GetBoundsInRootWindow().ToString()); |
127 #endif | |
128 | 126 |
129 views::Widget* minimized = CreateTestWidget(gfx::Rect(800, 10, 100, 100)); | 127 views::Widget* minimized = CreateTestWidget(gfx::Rect(800, 10, 100, 100)); |
130 minimized->Minimize(); | 128 minimized->Minimize(); |
131 EXPECT_EQ(root_windows[1], minimized->GetNativeView()->GetRootWindow()); | 129 EXPECT_EQ(root_windows[1], minimized->GetNativeView()->GetRootWindow()); |
132 EXPECT_EQ("800,10 100x100", | 130 EXPECT_EQ("800,10 100x100", |
133 minimized->GetWindowBoundsInScreen().ToString()); | 131 minimized->GetWindowBoundsInScreen().ToString()); |
134 | 132 |
135 views::Widget* fullscreen = CreateTestWidget(gfx::Rect(900, 10, 100, 100)); | 133 views::Widget* fullscreen = CreateTestWidget(gfx::Rect(900, 10, 100, 100)); |
136 fullscreen->SetFullscreen(true); | 134 fullscreen->SetFullscreen(true); |
137 EXPECT_EQ(root_windows[1], fullscreen->GetNativeView()->GetRootWindow()); | 135 EXPECT_EQ(root_windows[1], fullscreen->GetNativeView()->GetRootWindow()); |
138 #if !defined(OS_WIN) | 136 |
139 // TODO(oshima): Window reports smaller screen size. Investigate why. | |
140 EXPECT_EQ("600,0 500x500", | 137 EXPECT_EQ("600,0 500x500", |
141 fullscreen->GetWindowBoundsInScreen().ToString()); | 138 fullscreen->GetWindowBoundsInScreen().ToString()); |
142 EXPECT_EQ("0,0 500x500", | 139 EXPECT_EQ("0,0 500x500", |
143 fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString()); | 140 fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString()); |
144 #endif | |
145 | 141 |
146 // Make sure a window that will delete itself when losing focus | 142 // Make sure a window that will delete itself when losing focus |
147 // will not crash. | 143 // will not crash. |
148 aura::WindowTracker tracker; | 144 aura::WindowTracker tracker; |
149 DeleteOnBlurDelegate delete_on_blur_delegate; | 145 DeleteOnBlurDelegate delete_on_blur_delegate; |
150 aura::Window* d2 = CreateTestWindowInShellWithDelegate( | 146 aura::Window* d2 = CreateTestWindowInShellWithDelegate( |
151 &delete_on_blur_delegate, 0, gfx::Rect(50, 50, 100, 100)); | 147 &delete_on_blur_delegate, 0, gfx::Rect(50, 50, 100, 100)); |
152 delete_on_blur_delegate.set_window(d2); | 148 delete_on_blur_delegate.set_window(d2); |
153 aura::client::GetFocusClient(root_windows[0])->FocusWindow(d2, NULL); | 149 aura::client::GetFocusClient(root_windows[0])->FocusWindow(d2, NULL); |
154 tracker.Add(d2); | 150 tracker.Add(d2); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 views::Widget* session_modal_widget = | 304 views::Widget* session_modal_widget = |
309 CreateModalWidget(gfx::Rect(300, 10, 100, 100)); | 305 CreateModalWidget(gfx::Rect(300, 10, 100, 100)); |
310 EXPECT_EQ(Shell::GetContainer(controller->root_window(), | 306 EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
311 internal::kShellWindowId_SystemModalContainer)->layout_manager(), | 307 internal::kShellWindowId_SystemModalContainer)->layout_manager(), |
312 controller->GetSystemModalLayoutManager( | 308 controller->GetSystemModalLayoutManager( |
313 session_modal_widget->GetNativeView())); | 309 session_modal_widget->GetNativeView())); |
314 } | 310 } |
315 | 311 |
316 } // namespace test | 312 } // namespace test |
317 } // namespace ash | 313 } // namespace ash |
OLD | NEW |