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

Unified Diff: ui/aura/window_unittest.cc

Issue 8570011: Aura: windows in aura should honor Widget::InitParams::accept_events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: modified according to comments Created 9 years, 1 month 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 | « ui/aura/window.cc ('k') | views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 44852563796fb2314ddebe5d52293071a97f8acf..2c51f714436698707a28d3561c54b739a80a2b0a 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -664,6 +664,36 @@ TEST_F(WindowTest, StopsEventPropagation) {
EXPECT_EQ(w121.get(), w1->GetFocusManager()->GetFocusedWindow());
}
+TEST_F(WindowTest, IgnoreEventsTest) {
+ TestWindowDelegate d11;
+ TestWindowDelegate d12;
+ TestWindowDelegate d111;
+ TestWindowDelegate d121;
+ scoped_ptr<Window> w1(CreateTestWindowWithDelegate(NULL, 1,
+ gfx::Rect(0, 0, 500, 500), NULL));
+ scoped_ptr<Window> w11(CreateTestWindowWithDelegate(&d11, 11,
+ gfx::Rect(0, 0, 500, 500), w1.get()));
+ scoped_ptr<Window> w111(CreateTestWindowWithDelegate(&d111, 111,
+ gfx::Rect(50, 50, 450, 450), w11.get()));
+ scoped_ptr<Window> w12(CreateTestWindowWithDelegate(&d12, 12,
+ gfx::Rect(0, 0, 500, 500), w1.get()));
+ scoped_ptr<Window> w121(CreateTestWindowWithDelegate(&d121, 121,
+ gfx::Rect(150, 150, 50, 50), w12.get()));
+
+ EXPECT_EQ(w12.get(), w1->GetEventHandlerForPoint(gfx::Point(10, 10)));
+ w12->set_ignore_events(true);
+ EXPECT_EQ(w11.get(), w1->GetEventHandlerForPoint(gfx::Point(10, 10)));
+ w12->set_ignore_events(false);
+
+ EXPECT_EQ(w121.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
+ w121->set_ignore_events(true);
+ EXPECT_EQ(w12.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
+ w12->set_ignore_events(true);
+ EXPECT_EQ(w111.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
+ w111->set_ignore_events(true);
+ EXPECT_EQ(w11.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
+}
+
// Various assertions for activating/deactivating.
TEST_F(WindowTest, Deactivate) {
TestWindowDelegate d1;
« no previous file with comments | « ui/aura/window.cc ('k') | views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698