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

Unified Diff: ui/events/event_processor_unittest.cc

Issue 542323002: Convert ui::GestureEvent coordinates during targeting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 3 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/events/event_processor.cc ('k') | ui/events/event_targeter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event_processor_unittest.cc
diff --git a/ui/events/event_processor_unittest.cc b/ui/events/event_processor_unittest.cc
index 21b3601c5731e4d0aed7b3c9a9c1acd17263d1ac..8ccbd779af0a4126533b52ae28e228b1a8637143 100644
--- a/ui/events/event_processor_unittest.cc
+++ b/ui/events/event_processor_unittest.cc
@@ -170,7 +170,9 @@ TEST_F(EventProcessorTest, Bounds) {
// ReDispatchEventHandler is used to receive mouse events and forward them
// to a specified EventProcessor. Verifies that the event has the correct
-// target and phase both before and after the nested event processing.
+// target and phase both before and after the nested event processing. Also
+// verifies that the location of the event remains the same after it has
+// been processed by the second EventProcessor.
class ReDispatchEventHandler : public TestEventHandler {
public:
ReDispatchEventHandler(EventProcessor* processor, EventTarget* target)
@@ -184,14 +186,16 @@ class ReDispatchEventHandler : public TestEventHandler {
EXPECT_EQ(expected_target_, event->target());
EXPECT_EQ(EP_TARGET, event->phase());
+ gfx::Point location(event->location());
EventDispatchDetails details = processor_->OnEventFromSource(event);
EXPECT_FALSE(details.dispatcher_destroyed);
EXPECT_FALSE(details.target_destroyed);
- // The nested event-processing should not have mutated the target or
- // phase of |event|.
+ // The nested event-processing should not have mutated the target,
+ // phase, or location of |event|.
EXPECT_EQ(expected_target_, event->target());
EXPECT_EQ(EP_TARGET, event->phase());
+ EXPECT_EQ(location, event->location());
}
private:
« no previous file with comments | « ui/events/event_processor.cc ('k') | ui/events/event_targeter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698