summaryrefslogtreecommitdiffstats
path: root/ash/root_window_controller_unittest.cc
diff options
context:
space:
mode:
authornkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-09 11:52:35 +0000
committernkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-09 11:52:35 +0000
commit3b162e1b37adc8a84617671d94d562b3f3d433eb (patch)
tree336461ab9bac66a4f081a0dc243c20f5a30068ae /ash/root_window_controller_unittest.cc
parenta978921b65ea85602254880f33b59175a5543fae (diff)
downloadchromium_src-3b162e1b37adc8a84617671d94d562b3f3d433eb.zip
chromium_src-3b162e1b37adc8a84617671d94d562b3f3d433eb.tar.gz
chromium_src-3b162e1b37adc8a84617671d94d562b3f3d433eb.tar.bz2
Various modal dialog handling fixes when lock layer window is active (i.e. login / lock).
* Makes it possible to operate menus at login screen modal windows (login > Connect to other WiFi network). * Makes sure that screen lock layer windows recieve events even if there's another modal window at system modal window layer but none on the lock modal window layer. * Fixes dcheck in SystemModalContainerLayoutManager See also http://crbug.com/156941 BUG=157469 Review URL: https://chromiumcodereview.appspot.com/11275187 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166897 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/root_window_controller_unittest.cc')
-rw-r--r--ash/root_window_controller_unittest.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index e7ff230..1a802c8 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -82,6 +82,16 @@ views::Widget* CreateModalWidget(const gfx::Rect& bounds) {
return widget;
}
+views::Widget* CreateModalWidgetWithParent(const gfx::Rect& bounds,
+ gfx::NativeWindow parent) {
+ views::Widget* widget =
+ views::Widget::CreateWindowWithParentAndBounds(new TestDelegate(true),
+ parent,
+ bounds);
+ widget->Show();
+ return widget;
+}
+
aura::Window* GetModalContainer(aura::RootWindow* root_window) {
return Shell::GetContainer(
root_window,
@@ -227,12 +237,34 @@ TEST_F(RootWindowControllerTest, ModalContainer) {
internal::kShellWindowId_SystemModalContainer)->layout_manager(),
controller->GetSystemModalLayoutManager(NULL));
+ views::Widget* session_modal_widget =
+ CreateModalWidget(gfx::Rect(300, 10, 100, 100));
+ EXPECT_EQ(Shell::GetContainer(controller->root_window(),
+ internal::kShellWindowId_SystemModalContainer)->layout_manager(),
+ controller->GetSystemModalLayoutManager(
+ session_modal_widget->GetNativeView()));
+
shell->delegate()->LockScreen();
EXPECT_EQ(user::LOGGED_IN_LOCKED,
shell->tray_delegate()->GetUserLoginStatus());
EXPECT_EQ(Shell::GetContainer(controller->root_window(),
internal::kShellWindowId_LockSystemModalContainer)->layout_manager(),
controller->GetSystemModalLayoutManager(NULL));
+
+ aura::Window* lock_container =
+ Shell::GetContainer(controller->root_window(),
+ internal::kShellWindowId_LockScreenContainer);
+ views::Widget* lock_modal_widget =
+ CreateModalWidgetWithParent(gfx::Rect(300, 10, 100, 100), lock_container);
+ EXPECT_EQ(Shell::GetContainer(controller->root_window(),
+ internal::kShellWindowId_LockSystemModalContainer)->layout_manager(),
+ controller->GetSystemModalLayoutManager(
+ lock_modal_widget->GetNativeView()));
+ EXPECT_EQ(Shell::GetContainer(controller->root_window(),
+ internal::kShellWindowId_SystemModalContainer)->layout_manager(),
+ controller->GetSystemModalLayoutManager(
+ session_modal_widget->GetNativeView()));
+
shell->delegate()->UnlockScreen();
}