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

Unified Diff: ash/shell_unittest.cc

Issue 9788001: Remove stops_event_propagation from Window, since it's broken. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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/shell_delegate.h ('k') | ash/test/test_shell_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell_unittest.cc
===================================================================
--- ash/shell_unittest.cc (revision 128508)
+++ ash/shell_unittest.cc (working copy)
@@ -5,6 +5,7 @@
#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"
@@ -244,47 +245,10 @@
}
TEST_F(ShellTest, IsScreenLocked) {
- 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();
+ ash::Shell::GetInstance()->delegate()->LockScreen();
EXPECT_TRUE(Shell::GetInstance()->IsScreenLocked());
- lock_widget->Hide();
+ ash::Shell::GetInstance()->delegate()->UnlockScreen();
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());
- lock_widget->Close();
- EXPECT_FALSE(Shell::GetInstance()->IsScreenLocked());
}
// Fails on Mac, see http://crbug.com/115662
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/test/test_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698