Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: ash/root_window_controller_unittest.cc

Issue 11117012: ash: Fix event processing in modal windows in login/lock screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« ash/root_window_controller.cc ('K') | « ash/root_window_controller.cc ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698