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

Unified Diff: ui/aura/root_window_unittest.cc

Issue 22865036: Add support for reposting the ET_GESTURE_TAP_DOWN gesture event to the RootWindow and in the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 4 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/root_window_unittest.cc
===================================================================
--- ui/aura/root_window_unittest.cc (revision 218517)
+++ ui/aura/root_window_unittest.cc (working copy)
@@ -882,4 +882,30 @@
EXPECT_EQ(1, d2.gesture_end_count());
}
+// Tests whether we can repost the Tap down gesture event.
+TEST_F(RootWindowTest, RepostTapdownGestureTest) {
+ EventFilterRecorder* filter = new EventFilterRecorder;
+ root_window()->SetEventFilter(filter); // passes ownership
+
+ test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
+ &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window()));
+
+ ui::GestureEventDetails details(ui::ET_GESTURE_TAP_DOWN, 0.0f, 0.0f);
+ gfx::Point point(10, 10);
+ ui::GestureEvent event(
+ ui::ET_GESTURE_TAP_DOWN,
+ point.x(),
+ point.y(),
+ 0,
+ ui::EventTimeForNow(),
+ details,
+ 0);
+ root_window()->RepostEvent(event);
+ RunAllPendingInMessageLoop();
+ EXPECT_TRUE(EventTypesToString(filter->events()).find("GESTURE_TAP_DOWN") !=
+ std::string::npos);
+ filter->events().clear();
sadrul 2013/08/23 03:16:03 An interesting test would be to generate a Tap, or
+}
+
} // namespace aura
« ui/aura/root_window.cc ('K') | « ui/aura/root_window.cc ('k') | ui/base/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698