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

Side by Side Diff: ui/aura/window_event_dispatcher_unittest.cc

Issue 1645613007: Redefined the bit WebTouchEvent.causesScrollingIfUncanceled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed an aura unittest. Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/public/web/WebInputEvent.h ('k') | ui/events/blink/blink_event_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/window_event_dispatcher.h" 5 #include "ui/aura/window_event_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after
2626 EXPECT_TRUE(recorder.LastTouchMayCauseScrolling()); 2626 EXPECT_TRUE(recorder.LastTouchMayCauseScrolling());
2627 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_TOUCH_MOVED)); 2627 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_TOUCH_MOVED));
2628 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_GESTURE_SCROLL_UPDATE)); 2628 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_GESTURE_SCROLL_UPDATE));
2629 recorder.Reset(); 2629 recorder.Reset();
2630 2630
2631 // Delay the release to avoid fling generation. 2631 // Delay the release to avoid fling generation.
2632 ui::TouchEvent release( 2632 ui::TouchEvent release(
2633 ui::ET_TOUCH_RELEASED, location + gfx::Vector2d(200, 200), 0, 2633 ui::ET_TOUCH_RELEASED, location + gfx::Vector2d(200, 200), 0,
2634 ui::EventTimeForNow() + base::TimeDelta::FromSeconds(1)); 2634 ui::EventTimeForNow() + base::TimeDelta::FromSeconds(1));
2635 DispatchEventUsingWindowDispatcher(&release); 2635 DispatchEventUsingWindowDispatcher(&release);
2636 EXPECT_FALSE(recorder.LastTouchMayCauseScrolling()); 2636 EXPECT_TRUE(recorder.LastTouchMayCauseScrolling());
2637 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_TOUCH_RELEASED)); 2637 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_TOUCH_RELEASED));
2638 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_GESTURE_SCROLL_END)); 2638 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_GESTURE_SCROLL_END));
2639 2639
2640 root_window()->RemovePreTargetHandler(&recorder); 2640 root_window()->RemovePreTargetHandler(&recorder);
2641 } 2641 }
2642 2642
2643 // OnCursorMovedToRootLocation() is sometimes called instead of 2643 // OnCursorMovedToRootLocation() is sometimes called instead of
2644 // WindowTreeHost::MoveCursorTo() when the cursor did not move but the 2644 // WindowTreeHost::MoveCursorTo() when the cursor did not move but the
2645 // cursor's position in root coordinates has changed (e.g. when the displays's 2645 // cursor's position in root coordinates has changed (e.g. when the displays's
2646 // scale factor changed). Test that hover effects are properly updated. 2646 // scale factor changed). Test that hover effects are properly updated.
(...skipping 18 matching lines...) Expand all
2665 // 2x. A ET_MOUSE_EXITED event should have been sent to |w|. 2665 // 2x. A ET_MOUSE_EXITED event should have been sent to |w|.
2666 test_screen()->SetDeviceScaleFactor(2.f); 2666 test_screen()->SetDeviceScaleFactor(2.f);
2667 dispatcher->OnCursorMovedToRootLocation(gfx::Point(11, 11)); 2667 dispatcher->OnCursorMovedToRootLocation(gfx::Point(11, 11));
2668 RunAllPendingInMessageLoop(); 2668 RunAllPendingInMessageLoop();
2669 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_MOUSE_EXITED)); 2669 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_MOUSE_EXITED));
2670 2670
2671 w->RemovePreTargetHandler(&recorder); 2671 w->RemovePreTargetHandler(&recorder);
2672 } 2672 }
2673 2673
2674 } // namespace aura 2674 } // namespace aura
OLDNEW
« no previous file with comments | « third_party/WebKit/public/web/WebInputEvent.h ('k') | ui/events/blink/blink_event_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698