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

Unified Diff: ui/aura/window_event_dispatcher_unittest.cc

Issue 754013007: Fix the wrong relative coordinates from EventDispatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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') | ui/aura/window_tree_host.cc » ('j') | 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 4edc84d4ab88b96ab4af56389efce3e6627dd324..c11ff7598c66fd0f84189a1c7492d477ee5c4bf4 100644
--- a/ui/aura/window_event_dispatcher_unittest.cc
+++ b/ui/aura/window_event_dispatcher_unittest.cc
@@ -815,6 +815,36 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeld) {
EXPECT_TRUE(recorder.events().empty());
}
+// Tests that mouse move event has a right location
+// when there isn't the target window
+TEST_F(WindowEventDispatcherTest, MouseEventWithoutTargetWindow) {
+ EventFilterRecorder recorder_first;
+ EventFilterRecorder recorder_second;
+
+ test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window_first(CreateTestWindowWithDelegate(
+ &delegate, 1, gfx::Rect(20, 10, 10, 20), root_window()));
+ window_first->Show();
+ window_first->AddPreTargetHandler(&recorder_first);
+
+ scoped_ptr<aura::Window> window_second(CreateTestWindowWithDelegate(
+ &delegate, 2, gfx::Rect(20, 30, 10, 20), root_window()));
+ window_second->Show();
+ window_second->AddPreTargetHandler(&recorder_second);
+
+ const gfx::Point event_location(22, 33);
+ ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, event_location, event_location, 0,
+ 0);
+ DispatchEventUsingWindowDispatcher(&mouse);
+
+ EXPECT_TRUE(recorder_first.events().empty());
+ EXPECT_EQ("MOUSE_ENTERED MOUSE_MOVED",
+ EventTypesToString(recorder_second.events()));
+ ASSERT_EQ(2u, recorder_second.mouse_locations().size());
+ EXPECT_EQ(gfx::Point(2, 3).ToString(),
+ recorder_second.mouse_locations()[0].ToString());
+}
+
// Verifies that a direct call to ProcessedTouchEvent() with a
// TOUCH_PRESSED event does not cause a crash.
TEST_F(WindowEventDispatcherTest, CallToProcessedTouchEvent) {
« no previous file with comments | « ui/aura/window_event_dispatcher.cc ('k') | ui/aura/window_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698