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

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: minor changes 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
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 44852563796fb2314ddebe5d52293071a97f8acf..f386aeb1e965f223d18c0c69cc5ff82b14691f3f 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)));
+ d12.set_accept_events(false);
+ EXPECT_EQ(w11.get(), w1->GetEventHandlerForPoint(gfx::Point(10, 10)));
+ d12.set_accept_events(true);
+
+ EXPECT_EQ(w121.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
+ d121.set_accept_events(false);
+ EXPECT_EQ(w12.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
+ d12.set_accept_events(false);
+ EXPECT_EQ(w111.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
+ d111.set_accept_events(false);
+ EXPECT_EQ(w11.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
+}
+
// Various assertions for activating/deactivating.
TEST_F(WindowTest, Deactivate) {
TestWindowDelegate d1;

Powered by Google App Engine
This is Rietveld 408576698