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

Unified Diff: ash/wm/system_modal_container_layout_manager_unittest.cc

Issue 2801333002: mash: Run pre-unlock animation via SessionController (Closed)
Patch Set: rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/lock_state_controller.cc ('k') | chrome/browser/chromeos/login/lock/screen_locker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/system_modal_container_layout_manager_unittest.cc
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index 822e53797561560b3ca2509d43c6984dbfff0aef..010bf94791ee8126131338905978ab4853b6e68c 100644
--- a/ash/wm/system_modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -358,10 +358,14 @@ TEST_F(SystemModalContainerLayoutManagerTest, EventFocusContainers) {
// Create a window in the lock screen container and ensure that it receives
// the mouse event instead of the modal window (crbug.com/110920).
BlockUserSession(static_cast<UserSessionBlockReason>(block_reason));
+
EventTestWindow* lock_delegate = new EventTestWindow(false);
std::unique_ptr<aura::Window> lock(lock_delegate->OpenTestWindowWithParent(
Shell::GetPrimaryRootWindowController()->GetContainer(
ash::kShellWindowId_LockScreenContainer)));
+ // BlockUserSession could change the workspace size. Make sure |lock| has
+ // the same bounds as |main| so that |lock| gets the generated mouse events.
+ lock->SetBounds(main->bounds());
EXPECT_TRUE(wm::IsActiveWindow(lock.get()));
e1.ClickLeftButton();
EXPECT_EQ(1, lock_delegate->mouse_presses());
@@ -378,6 +382,11 @@ TEST_F(SystemModalContainerLayoutManagerTest, EventFocusContainers) {
EXPECT_EQ(1, lock_delegate->mouse_presses());
EXPECT_EQ(1, main_delegate->mouse_presses());
EXPECT_EQ(1, transient_delegate->mouse_presses());
+
+ // Close |lock| before unlocking so that Shell::OnLockStateChanged does
+ // not DCHECK on finding a system modal in Lock layer when unlocked.
+ lock.reset();
+
UnblockUserSession();
}
}
@@ -581,6 +590,11 @@ TEST_F(SystemModalContainerLayoutManagerTest, ShowNormalBackgroundOrLocked) {
EXPECT_TRUE(AllRootWindowsHaveModalBackgrounds());
EXPECT_FALSE(AllRootWindowsHaveLockedModalBackgrounds());
TestWindow::CloseTestWindow(modal_window.release());
+
+ // Close |lock_parent| before unlocking so that Shell::OnLockStateChanged
+ // does not DCHECK on finding a system modal in Lock layer when unlocked.
+ lock_parent.reset();
+
UnblockUserSession();
// Here we should check the behavior of the locked system modal dialog when
// unlocked, but such case isn't handled very well right now.
« no previous file with comments | « ash/wm/lock_state_controller.cc ('k') | chrome/browser/chromeos/login/lock/screen_locker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698