summaryrefslogtreecommitdiffstats
path: root/ash/shell_unittest.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-22 23:35:56 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-22 23:35:56 +0000
commit4b87bc2e3c13bd572a2b1b9a08ea2644120e6d6c (patch)
treed1dd9f473c130f4e51a9cda7e8b49cb42c8f13bf /ash/shell_unittest.cc
parent4ad932db8c764a861f9c5a578599271f179a9020 (diff)
downloadchromium_src-4b87bc2e3c13bd572a2b1b9a08ea2644120e6d6c.zip
chromium_src-4b87bc2e3c13bd572a2b1b9a08ea2644120e6d6c.tar.gz
chromium_src-4b87bc2e3c13bd572a2b1b9a08ea2644120e6d6c.tar.bz2
Revert 128328 - Remove stops_event_propagation from Window, since it's broken.
Changes it to be implemented by the Aura client, via a new interface EventClient. The client can determine whether or not a given window and its subtree can receive events. I also cleaned up the way screen locking is entered/exited via the delegate, and some stuff in ash/shell. http://crbug.com/119347 TEST=none Review URL: https://chromiumcodereview.appspot.com/9788001 TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/9808044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128338 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell_unittest.cc')
-rw-r--r--ash/shell_unittest.cc42
1 files changed, 39 insertions, 3 deletions
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index d4dd7ea..9f5ff3a 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -5,7 +5,6 @@
#include "ash/ash_switches.h"
#include "ash/launcher/launcher.h"
#include "ash/shell.h"
-#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/root_window_layout_manager.h"
@@ -245,9 +244,46 @@ TEST_F(ShellTest, CreateLockScreenModalWindow) {
}
TEST_F(ShellTest, IsScreenLocked) {
- ash::Shell::GetInstance()->delegate()->LockScreen();
+ views::Widget::InitParams widget_params(
+ views::Widget::InitParams::TYPE_WINDOW);
+
+ // A normal window does not lock the screen.
+ views::Widget* widget = CreateTestWindow(widget_params);
+ widget->Show();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+ widget->Hide();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+
+ // A modal window with a normal window as parent does not locks the screen.
+ views::Widget* modal_widget = views::Widget::CreateWindowWithParent(
+ new ModalWindow(), widget->GetNativeView());
+ modal_widget->Show();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+ modal_widget->Close();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+ widget->Close();
+
+ // A lock screen window locks the screen.
+ views::Widget* lock_widget = CreateTestWindow(widget_params);
+ ash::Shell::GetInstance()->GetContainer(
+ ash::internal::kShellWindowId_LockScreenContainer)->
+ AddChild(lock_widget->GetNativeView());
+ lock_widget->Show();
+ EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
+ lock_widget->Hide();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+
+ // A modal window with a lock window as parent does not lock the screen. The
+ // screen is locked only when a lock window is visible.
+ views::Widget* lock_modal_widget = views::Widget::CreateWindowWithParent(
+ new ModalWindow(), lock_widget->GetNativeView());
+ lock_modal_widget->Show();
+ EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
+ lock_widget->Show();
+ EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
+ lock_modal_widget->Close();
EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
- ash::Shell::GetInstance()->delegate()->UnlockScreen();
+ lock_widget->Close();
EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
}