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

Unified Diff: ui/aura/window_unittest.cc

Issue 9181012: Don't activate a window if screen is locked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index ccd9fe8f39674cf2a57f227fc1b244cacf141abb..4ca1fee82105262abfec6bae3961a254d919ec22 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -233,10 +233,10 @@ TEST_F(WindowTest, GetTopWindowContainingPoint) {
CreateTestWindow(SK_ColorCYAN, 31, gfx::Rect(0, 0, 50, 50), w3.get()));
scoped_ptr<Window> w311(
CreateTestWindow(SK_ColorBLUE, 311, gfx::Rect(0, 0, 10, 10), w31.get()));
-
// The stop-event-propagation flag shouldn't have any effect on the behavior
// of this method.
w3->set_stops_event_propagation(true);
+ w31->set_stops_event_propagation(true);
EXPECT_EQ(NULL, root->GetTopWindowContainingPoint(gfx::Point(0, 0)));
EXPECT_EQ(w2.get(), root->GetTopWindowContainingPoint(gfx::Point(5, 5)));
@@ -657,9 +657,12 @@ TEST_F(WindowTest, StopsEventPropagation) {
gfx::Rect(150, 150, 50, 50), NULL));
w12->set_stops_event_propagation(true);
+ w121->set_stops_event_propagation(true);
+
EXPECT_EQ(w11.get(), w1->GetEventHandlerForPoint(gfx::Point(10, 10)));
EXPECT_TRUE(w111->CanFocus());
+ EXPECT_TRUE(w111->CanReceiveEvents());
w111->Focus();
EXPECT_EQ(w111.get(), w1->GetFocusManager()->GetFocusedWindow());
@@ -671,14 +674,23 @@ TEST_F(WindowTest, StopsEventPropagation) {
// It should be possible to focus w121 since it is at or above the
// consumes_events_ window.
EXPECT_TRUE(w121->CanFocus());
+ EXPECT_TRUE(w121->CanReceiveEvents());
w121->Focus();
EXPECT_EQ(w121.get(), w1->GetFocusManager()->GetFocusedWindow());
// An attempt to focus 111 should be ignored and w121 should retain focus,
// since a consumes_events_ window with a child is in the z-index above w111.
- EXPECT_FALSE(w111->CanFocus());
+ EXPECT_FALSE(w111->CanReceiveEvents());
w111->Focus();
EXPECT_EQ(w121.get(), w1->GetFocusManager()->GetFocusedWindow());
+
+ // Set the stop-event-propagation flag to false so that 111 can be
+ // focused.
+ w121->set_stops_event_propagation(false);
+ EXPECT_TRUE(w111->CanFocus());
+ EXPECT_TRUE(w111->CanReceiveEvents());
+ w111->Focus();
+ EXPECT_EQ(w111.get(), w1->GetFocusManager()->GetFocusedWindow());
}
TEST_F(WindowTest, IgnoreEventsTest) {
« chrome/browser/chromeos/login/base_login_display_host.cc ('K') | « ui/aura/window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698