| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |