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

Unified Diff: ui/aura/window_event_dispatcher_unittest.cc

Issue 450413002: Do not dispatch gestures to a NULL aura::Window target (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test added Created 6 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
« no previous file with comments | « ui/aura/window_event_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_event_dispatcher_unittest.cc
diff --git a/ui/aura/window_event_dispatcher_unittest.cc b/ui/aura/window_event_dispatcher_unittest.cc
index f6647d4df781dba13bb011e5bcf8287034bf8e06..291e430ea6d8756bd346ca76e6a5f72f394f0213 100644
--- a/ui/aura/window_event_dispatcher_unittest.cc
+++ b/ui/aura/window_event_dispatcher_unittest.cc
@@ -785,6 +785,19 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeld) {
EXPECT_TRUE(recorder.events().empty());
}
+// Verifies that a direct call to ProcessedTouchEvent() with a
+// TOUCH_PRESSED event does not cause a crash.
+TEST_F(WindowEventDispatcherTest, CallToProcessedTouchEvent) {
+ test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
+ &delegate, 1, gfx::Rect(50, 50, 100, 100), root_window()));
+
+ ui::TouchEvent touch(
+ ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 1, ui::EventTimeForNow());
+ host()->dispatcher()->ProcessedTouchEvent(
+ &touch, window.get(), ui::ER_UNHANDLED);
+}
+
// This event handler requests the dispatcher to start holding pointer-move
// events when it receives the first scroll-update gesture.
class HoldPointerOnScrollHandler : public ui::test::TestEventHandler {
« no previous file with comments | « ui/aura/window_event_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698