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

Side by Side Diff: ash/root_window_controller_unittest.cc

Issue 18850003: Focus kept on login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fixed. Created 7 years, 5 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
« no previous file with comments | « no previous file | ash/wm/event_client_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" 5 #include "ash/root_window_controller.h"
6 6
7 #include "ash/session_state_delegate.h" 7 #include "ash/session_state_delegate.h"
8 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 // Activate the maximized window's workspace. GetFullscreenWindow() should 380 // Activate the maximized window's workspace. GetFullscreenWindow() should
381 // fail because the fullscreen window's workspace is no longer active. 381 // fail because the fullscreen window's workspace is no longer active.
382 w1->Activate(); 382 w1->Activate();
383 EXPECT_FALSE(controller->GetFullscreenWindow()); 383 EXPECT_FALSE(controller->GetFullscreenWindow());
384 384
385 // If the fullscreen window is active, GetFullscreenWindow() should find it. 385 // If the fullscreen window is active, GetFullscreenWindow() should find it.
386 w2->Activate(); 386 w2->Activate();
387 EXPECT_EQ(w2->GetNativeWindow(), controller->GetFullscreenWindow()); 387 EXPECT_EQ(w2->GetNativeWindow(), controller->GetFullscreenWindow());
388 } 388 }
389 389
390 // Test that user session window can't be focused if user session blocked by
391 // some overlapping UI.
392 TEST_F(RootWindowControllerTest, FocusBlockedWindow) {
393 UpdateDisplay("600x600");
394 internal::RootWindowController* controller =
395 Shell::GetInstance()->GetPrimaryRootWindowController();
396 aura::Window* lock_container =
397 Shell::GetContainer(controller->root_window(),
398 internal::kShellWindowId_LockScreenContainer);
399 aura::Window* lock_window = Widget::CreateWindowWithParentAndBounds(NULL,
400 lock_container, gfx::Rect(0, 0, 100, 100))->GetNativeView();
401 lock_window->Show();
402 aura::Window* session_window =
403 CreateTestWidget(gfx::Rect(0, 0, 100, 100))->GetNativeView();
404 session_window->Show();
405
406 // Lock screen.
407 Shell::GetInstance()->session_state_delegate()->LockScreen();
408 lock_window->Focus();
409 EXPECT_TRUE(lock_window->HasFocus());
410 session_window->Focus();
411 EXPECT_FALSE(session_window->HasFocus());
412 Shell::GetInstance()->session_state_delegate()->UnlockScreen();
413
414 // Session not started yet.
415 SetSessionStarted(false);
416 lock_window->Focus();
417 EXPECT_TRUE(lock_window->HasFocus());
418 session_window->Focus();
419 EXPECT_FALSE(session_window->HasFocus());
420 SetSessionStarted(true);
421 }
422
390 } // namespace test 423 } // namespace test
391 } // namespace ash 424 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/event_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698