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

Unified Diff: ui/aura/root_window_unittest.cc

Issue 160563002: Aura: don't synthesize mouse moves while holding pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added check for synthetic event Created 6 years, 10 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/root_window.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window_unittest.cc
diff --git a/ui/aura/root_window_unittest.cc b/ui/aura/root_window_unittest.cc
index 168344f5d37ae5be3f68bcbff6036e0272df7688..2b28144affcb224a78b104396d31459b5a731449 100644
--- a/ui/aura/root_window_unittest.cc
+++ b/ui/aura/root_window_unittest.cc
@@ -631,8 +631,8 @@ TEST_F(RootWindowTest, MouseMovesHeld) {
filter->Reset();
// Check that we coalesce held MOUSE_DRAGGED events.
- ui::MouseEvent mouse_dragged_event2(ui::ET_MOUSE_DRAGGED, gfx::Point(1, 1),
- gfx::Point(1, 1), 0, 0);
+ ui::MouseEvent mouse_dragged_event2(ui::ET_MOUSE_DRAGGED, gfx::Point(10, 10),
+ gfx::Point(10, 10), 0, 0);
DispatchEventUsingWindowDispatcher(&mouse_dragged_event);
DispatchEventUsingWindowDispatcher(&mouse_dragged_event2);
EXPECT_TRUE(filter->events().empty());
@@ -672,6 +672,23 @@ TEST_F(RootWindowTest, MouseMovesHeld) {
filter->Reset();
RunAllPendingInMessageLoop();
EXPECT_TRUE(filter->events().empty());
+
+ // Check that synthetic mouse move event has a right location when issued
+ // while holding pointer moves.
+ ui::MouseEvent mouse_dragged_event3(ui::ET_MOUSE_DRAGGED, gfx::Point(28, 28),
+ gfx::Point(28, 28), 0, 0);
+ dispatcher()->HoldPointerMoves();
+ DispatchEventUsingWindowDispatcher(&mouse_dragged_event);
+ DispatchEventUsingWindowDispatcher(&mouse_dragged_event2);
+ window->SetBounds(gfx::Rect(15, 15, 80, 80));
+ DispatchEventUsingWindowDispatcher(&mouse_dragged_event3);
+ RunAllPendingInMessageLoop();
+ EXPECT_TRUE(filter->events().empty());
+ dispatcher()->ReleasePointerMoves();
+ RunAllPendingInMessageLoop();
+ EXPECT_EQ("MOUSE_MOVED", EventTypesToString(filter->events()));
+ EXPECT_EQ(gfx::Point(13, 13), filter->mouse_location(0));
+ filter->Reset();
}
TEST_F(RootWindowTest, TouchMovesHeld) {
« no previous file with comments | « ui/aura/root_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698