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" |
| 6 |
5 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
6 #include "ash/display/multi_display_manager.h" | 8 #include "ash/display/multi_display_manager.h" |
7 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" |
8 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 12 #include "ash/system/tray/system_tray_delegate.h" |
9 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
| 14 #include "ash/wm/system_modal_container_layout_manager.h" |
10 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
11 #include "ui/aura/env.h" | 16 #include "ui/aura/env.h" |
12 #include "ui/aura/focus_manager.h" | 17 #include "ui/aura/focus_manager.h" |
13 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
14 #include "ui/aura/test/event_generator.h" | 19 #include "ui/aura/test/event_generator.h" |
15 #include "ui/aura/test/test_window_delegate.h" | 20 #include "ui/aura/test/test_window_delegate.h" |
16 #include "ui/aura/test/test_windows.h" | 21 #include "ui/aura/test/test_windows.h" |
17 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
18 #include "ui/aura/window_tracker.h" | 23 #include "ui/aura/window_tracker.h" |
19 #include "ui/views/controls/menu/menu_controller.h" | 24 #include "ui/views/controls/menu/menu_controller.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 generator_1st.ClickLeftButton(); | 208 generator_1st.ClickLeftButton(); |
204 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); | 209 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
205 | 210 |
206 UpdateDisplay("500x500"); | 211 UpdateDisplay("500x500"); |
207 EXPECT_EQ(root_windows[0], modal->GetNativeView()->GetRootWindow()); | 212 EXPECT_EQ(root_windows[0], modal->GetNativeView()->GetRootWindow()); |
208 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); | 213 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
209 generator_1st.ClickLeftButton(); | 214 generator_1st.ClickLeftButton(); |
210 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); | 215 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
211 } | 216 } |
212 | 217 |
| 218 TEST_F(RootWindowControllerTest, ModalContainer) { |
| 219 UpdateDisplay("600x600"); |
| 220 Shell* shell = Shell::GetInstance(); |
| 221 internal::RootWindowController* controller = |
| 222 shell->GetPrimaryRootWindowController(); |
| 223 EXPECT_EQ(user::LOGGED_IN_USER, |
| 224 shell->tray_delegate()->GetUserLoginStatus()); |
| 225 EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 226 internal::kShellWindowId_SystemModalContainer)->layout_manager(), |
| 227 controller->GetSystemModalLayoutManager(NULL)); |
| 228 |
| 229 shell->delegate()->LockScreen(); |
| 230 EXPECT_EQ(user::LOGGED_IN_LOCKED, |
| 231 shell->tray_delegate()->GetUserLoginStatus()); |
| 232 EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 233 internal::kShellWindowId_LockSystemModalContainer)->layout_manager(), |
| 234 controller->GetSystemModalLayoutManager(NULL)); |
| 235 shell->delegate()->UnlockScreen(); |
| 236 } |
| 237 |
213 } // namespace test | 238 } // namespace test |
214 } // namespace ash | 239 } // namespace ash |
OLD | NEW |