| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // Mouse event was received by target window. | 135 // Mouse event was received by target window. |
| 136 EXPECT_EQ(1, delegate1->mouse_event_count()); | 136 EXPECT_EQ(1, delegate1->mouse_event_count()); |
| 137 EXPECT_EQ(0, delegate2->mouse_event_count()); | 137 EXPECT_EQ(0, delegate2->mouse_event_count()); |
| 138 // Event was in local coordinates. | 138 // Event was in local coordinates. |
| 139 EXPECT_EQ(gfx::Point(1, 1), delegate1->mouse_event_location()); | 139 EXPECT_EQ(gfx::Point(1, 1), delegate1->mouse_event_location()); |
| 140 // Non-client flag was set. | 140 // Non-client flag was set. |
| 141 EXPECT_TRUE(delegate1->mouse_event_flags() & ui::EF_IS_NON_CLIENT); | 141 EXPECT_TRUE(delegate1->mouse_event_flags() & ui::EF_IS_NON_CLIENT); |
| 142 } | 142 } |
| 143 | 143 |
| 144 TEST_F(WindowEventDispatcherTest, RepostEvent) { | 144 TEST_F(WindowEventDispatcherTest, RepostEvent) { |
| 145 // Test RepostEvent in RootWindow. It only works for Mouse Press. | 145 // Test RepostEvent in RootWindow. It only works for Mouse Press and touch |
| 146 // press. |
| 146 EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown()); | 147 EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown()); |
| 147 gfx::Point point(10, 10); | 148 gfx::Point point(10, 10); |
| 148 ui::MouseEvent event(ui::ET_MOUSE_PRESSED, point, point, | 149 ui::MouseEvent event(ui::ET_MOUSE_PRESSED, point, point, |
| 149 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, | 150 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, |
| 150 ui::EF_LEFT_MOUSE_BUTTON); | 151 ui::EF_LEFT_MOUSE_BUTTON); |
| 151 host()->dispatcher()->RepostEvent(event); | 152 host()->dispatcher()->RepostEvent(&event); |
| 152 RunAllPendingInMessageLoop(); | 153 RunAllPendingInMessageLoop(); |
| 153 EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown()); | 154 EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown()); |
| 155 |
| 156 ui::TouchEvent touch_pressed_event( |
| 157 ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, ui::EventTimeForNow()); |
| 158 host()->dispatcher()->RepostEvent(&touch_pressed_event); |
| 159 RunAllPendingInMessageLoop(); |
| 160 EXPECT_TRUE(Env::GetInstance()->is_touch_down()); |
| 154 } | 161 } |
| 155 | 162 |
| 156 // Check that we correctly track the state of the mouse buttons in response to | 163 // Check that we correctly track the state of the mouse buttons in response to |
| 157 // button press and release events. | 164 // button press and release events. |
| 158 TEST_F(WindowEventDispatcherTest, MouseButtonState) { | 165 TEST_F(WindowEventDispatcherTest, MouseButtonState) { |
| 159 EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown()); | 166 EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown()); |
| 160 | 167 |
| 161 gfx::Point location; | 168 gfx::Point location; |
| 162 scoped_ptr<ui::MouseEvent> event; | 169 scoped_ptr<ui::MouseEvent> event; |
| 163 | 170 |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 // capture). | 634 // capture). |
| 628 EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown()); | 635 EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown()); |
| 629 EventFilterRecorder recorder; | 636 EventFilterRecorder recorder; |
| 630 scoped_ptr<Window> window(CreateNormalWindow(1, root_window(), NULL)); | 637 scoped_ptr<Window> window(CreateNormalWindow(1, root_window(), NULL)); |
| 631 window->SetBounds(gfx::Rect(20, 20, 40, 30)); | 638 window->SetBounds(gfx::Rect(20, 20, 40, 30)); |
| 632 window->AddPreTargetHandler(&recorder); | 639 window->AddPreTargetHandler(&recorder); |
| 633 window->SetCapture(); | 640 window->SetCapture(); |
| 634 const ui::MouseEvent press_event( | 641 const ui::MouseEvent press_event( |
| 635 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), | 642 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), |
| 636 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); | 643 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); |
| 637 host()->dispatcher()->RepostEvent(press_event); | 644 host()->dispatcher()->RepostEvent(&press_event); |
| 638 RunAllPendingInMessageLoop(); // Necessitated by RepostEvent(). | 645 RunAllPendingInMessageLoop(); // Necessitated by RepostEvent(). |
| 639 // Mouse moves/enters may be generated. We only care about a pressed. | 646 // Mouse moves/enters may be generated. We only care about a pressed. |
| 640 EXPECT_TRUE(EventTypesToString(recorder.events()).find("MOUSE_PRESSED") != | 647 EXPECT_TRUE(EventTypesToString(recorder.events()).find("MOUSE_PRESSED") != |
| 641 std::string::npos) << EventTypesToString(recorder.events()); | 648 std::string::npos) << EventTypesToString(recorder.events()); |
| 642 } | 649 } |
| 643 | 650 |
| 644 TEST_F(WindowEventDispatcherTest, MouseMovesHeld) { | 651 TEST_F(WindowEventDispatcherTest, MouseMovesHeld) { |
| 645 EventFilterRecorder recorder; | 652 EventFilterRecorder recorder; |
| 646 root_window()->AddPreTargetHandler(&recorder); | 653 root_window()->AddPreTargetHandler(&recorder); |
| 647 | 654 |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( | 1419 scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
| 1413 &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window())); | 1420 &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window())); |
| 1414 | 1421 |
| 1415 ui::GestureEventDetails details(ui::ET_GESTURE_TAP_DOWN); | 1422 ui::GestureEventDetails details(ui::ET_GESTURE_TAP_DOWN); |
| 1416 gfx::Point point(10, 10); | 1423 gfx::Point point(10, 10); |
| 1417 ui::GestureEvent event(point.x(), | 1424 ui::GestureEvent event(point.x(), |
| 1418 point.y(), | 1425 point.y(), |
| 1419 0, | 1426 0, |
| 1420 ui::EventTimeForNow(), | 1427 ui::EventTimeForNow(), |
| 1421 details); | 1428 details); |
| 1422 host()->dispatcher()->RepostEvent(event); | 1429 host()->dispatcher()->RepostEvent(&event); |
| 1423 RunAllPendingInMessageLoop(); | 1430 RunAllPendingInMessageLoop(); |
| 1424 // TODO(rbyers): Currently disabled - crbug.com/170987 | 1431 // TODO(rbyers): Currently disabled - crbug.com/170987 |
| 1425 EXPECT_FALSE(EventTypesToString(recorder.events()).find("GESTURE_TAP_DOWN") != | 1432 EXPECT_FALSE(EventTypesToString(recorder.events()).find("GESTURE_TAP_DOWN") != |
| 1426 std::string::npos); | 1433 std::string::npos); |
| 1427 recorder.Reset(); | 1434 recorder.Reset(); |
| 1428 root_window()->RemovePreTargetHandler(&recorder); | 1435 root_window()->RemovePreTargetHandler(&recorder); |
| 1429 } | 1436 } |
| 1430 | 1437 |
| 1431 // This class inherits from the EventFilterRecorder class which provides a | 1438 // This class inherits from the EventFilterRecorder class which provides a |
| 1432 // facility to record events. This class additionally provides a facility to | 1439 // facility to record events. This class additionally provides a facility to |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1450 } | 1457 } |
| 1451 EventFilterRecorder::OnTouchEvent(event); | 1458 EventFilterRecorder::OnTouchEvent(event); |
| 1452 } | 1459 } |
| 1453 | 1460 |
| 1454 void OnGestureEvent(ui::GestureEvent* event) override { | 1461 void OnGestureEvent(ui::GestureEvent* event) override { |
| 1455 EXPECT_EQ(done_cleanup_ ? repost_target_ : repost_source_, event->target()); | 1462 EXPECT_EQ(done_cleanup_ ? repost_target_ : repost_source_, event->target()); |
| 1456 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { | 1463 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { |
| 1457 if (!reposted_) { | 1464 if (!reposted_) { |
| 1458 EXPECT_NE(repost_target_, event->target()); | 1465 EXPECT_NE(repost_target_, event->target()); |
| 1459 reposted_ = true; | 1466 reposted_ = true; |
| 1460 repost_target_->GetHost()->dispatcher()->RepostEvent(*event); | 1467 repost_target_->GetHost()->dispatcher()->RepostEvent(event); |
| 1461 // Ensure that the reposted gesture event above goes to the | 1468 // Ensure that the reposted gesture event above goes to the |
| 1462 // repost_target_; | 1469 // repost_target_; |
| 1463 repost_source_->GetRootWindow()->RemoveChild(repost_source_); | 1470 repost_source_->GetRootWindow()->RemoveChild(repost_source_); |
| 1464 return; | 1471 return; |
| 1465 } | 1472 } |
| 1466 } | 1473 } |
| 1467 EventFilterRecorder::OnGestureEvent(event); | 1474 EventFilterRecorder::OnGestureEvent(event); |
| 1468 } | 1475 } |
| 1469 | 1476 |
| 1470 // Ignore mouse events as they don't fire at all times. This causes | 1477 // Ignore mouse events as they don't fire at all times. This causes |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 | 1720 |
| 1714 int mouse_event_count() const { return mouse_event_count_; } | 1721 int mouse_event_count() const { return mouse_event_count_; } |
| 1715 | 1722 |
| 1716 // TestWindowDelegate: | 1723 // TestWindowDelegate: |
| 1717 void OnMouseEvent(ui::MouseEvent* event) override { | 1724 void OnMouseEvent(ui::MouseEvent* event) override { |
| 1718 if ((event->flags() & ui::EF_SHIFT_DOWN) != 0 && | 1725 if ((event->flags() & ui::EF_SHIFT_DOWN) != 0 && |
| 1719 mouse_event_count_++ == 0) { | 1726 mouse_event_count_++ == 0) { |
| 1720 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), | 1727 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), |
| 1721 gfx::Point(10, 10), ui::EventTimeForNow(), | 1728 gfx::Point(10, 10), ui::EventTimeForNow(), |
| 1722 ui::EF_SHIFT_DOWN, 0); | 1729 ui::EF_SHIFT_DOWN, 0); |
| 1723 root_->GetHost()->dispatcher()->RepostEvent(mouse_event); | 1730 root_->GetHost()->dispatcher()->RepostEvent(&mouse_event); |
| 1724 } | 1731 } |
| 1725 } | 1732 } |
| 1726 | 1733 |
| 1727 private: | 1734 private: |
| 1728 Window* root_; | 1735 Window* root_; |
| 1729 int mouse_event_count_; | 1736 int mouse_event_count_; |
| 1730 | 1737 |
| 1731 DISALLOW_COPY_AND_ASSIGN(DontResetHeldEventWindowDelegate); | 1738 DISALLOW_COPY_AND_ASSIGN(DontResetHeldEventWindowDelegate); |
| 1732 }; | 1739 }; |
| 1733 | 1740 |
| 1734 } // namespace | 1741 } // namespace |
| 1735 | 1742 |
| 1736 // Verifies RootWindow doesn't reset |RootWindow::held_repostable_event_| after | 1743 // Verifies RootWindow doesn't reset |RootWindow::held_repostable_event_| after |
| 1737 // dispatching. This is done by using DontResetHeldEventWindowDelegate, which | 1744 // dispatching. This is done by using DontResetHeldEventWindowDelegate, which |
| 1738 // tracks the number of events with ui::EF_SHIFT_DOWN set (all reposted events | 1745 // tracks the number of events with ui::EF_SHIFT_DOWN set (all reposted events |
| 1739 // have EF_SHIFT_DOWN). When the first event is seen RepostEvent() is used to | 1746 // have EF_SHIFT_DOWN). When the first event is seen RepostEvent() is used to |
| 1740 // schedule another reposted event. | 1747 // schedule another reposted event. |
| 1741 TEST_F(WindowEventDispatcherTest, DontResetHeldEvent) { | 1748 TEST_F(WindowEventDispatcherTest, DontResetHeldEvent) { |
| 1742 DontResetHeldEventWindowDelegate delegate(root_window()); | 1749 DontResetHeldEventWindowDelegate delegate(root_window()); |
| 1743 scoped_ptr<Window> w1(CreateNormalWindow(1, root_window(), &delegate)); | 1750 scoped_ptr<Window> w1(CreateNormalWindow(1, root_window(), &delegate)); |
| 1744 w1->SetBounds(gfx::Rect(0, 0, 40, 40)); | 1751 w1->SetBounds(gfx::Rect(0, 0, 40, 40)); |
| 1745 ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), | 1752 ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), |
| 1746 gfx::Point(10, 10), ui::EventTimeForNow(), | 1753 gfx::Point(10, 10), ui::EventTimeForNow(), |
| 1747 ui::EF_SHIFT_DOWN, 0); | 1754 ui::EF_SHIFT_DOWN, 0); |
| 1748 root_window()->GetHost()->dispatcher()->RepostEvent(pressed); | 1755 root_window()->GetHost()->dispatcher()->RepostEvent(&pressed); |
| 1749 ui::MouseEvent pressed2(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), | 1756 ui::MouseEvent pressed2(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), |
| 1750 gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0); | 1757 gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0); |
| 1751 // Dispatch an event to flush event scheduled by way of RepostEvent(). | 1758 // Dispatch an event to flush event scheduled by way of RepostEvent(). |
| 1752 DispatchEventUsingWindowDispatcher(&pressed2); | 1759 DispatchEventUsingWindowDispatcher(&pressed2); |
| 1753 // Delegate should have seen reposted event (identified by way of | 1760 // Delegate should have seen reposted event (identified by way of |
| 1754 // EF_SHIFT_DOWN). Dispatch another event to flush the second | 1761 // EF_SHIFT_DOWN). Dispatch another event to flush the second |
| 1755 // RepostedEvent(). | 1762 // RepostedEvent(). |
| 1756 EXPECT_EQ(1, delegate.mouse_event_count()); | 1763 EXPECT_EQ(1, delegate.mouse_event_count()); |
| 1757 DispatchEventUsingWindowDispatcher(&pressed2); | 1764 DispatchEventUsingWindowDispatcher(&pressed2); |
| 1758 EXPECT_EQ(2, delegate.mouse_event_count()); | 1765 EXPECT_EQ(2, delegate.mouse_event_count()); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 // Should be deleted by |delegate|. | 1806 // Should be deleted by |delegate|. |
| 1800 WindowTreeHost* h2 = WindowTreeHost::Create(gfx::Rect(0, 0, 100, 100)); | 1807 WindowTreeHost* h2 = WindowTreeHost::Create(gfx::Rect(0, 0, 100, 100)); |
| 1801 h2->InitHost(); | 1808 h2->InitHost(); |
| 1802 DeleteHostFromHeldMouseEventDelegate delegate(h2); | 1809 DeleteHostFromHeldMouseEventDelegate delegate(h2); |
| 1803 // Owned by |h2|. | 1810 // Owned by |h2|. |
| 1804 Window* w1 = CreateNormalWindow(1, h2->window(), &delegate); | 1811 Window* w1 = CreateNormalWindow(1, h2->window(), &delegate); |
| 1805 w1->SetBounds(gfx::Rect(0, 0, 40, 40)); | 1812 w1->SetBounds(gfx::Rect(0, 0, 40, 40)); |
| 1806 ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), | 1813 ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), |
| 1807 gfx::Point(10, 10), ui::EventTimeForNow(), | 1814 gfx::Point(10, 10), ui::EventTimeForNow(), |
| 1808 ui::EF_SHIFT_DOWN, 0); | 1815 ui::EF_SHIFT_DOWN, 0); |
| 1809 h2->dispatcher()->RepostEvent(pressed); | 1816 h2->dispatcher()->RepostEvent(&pressed); |
| 1810 // RunAllPendingInMessageLoop() to make sure the |pressed| is run. | 1817 // RunAllPendingInMessageLoop() to make sure the |pressed| is run. |
| 1811 RunAllPendingInMessageLoop(); | 1818 RunAllPendingInMessageLoop(); |
| 1812 EXPECT_TRUE(delegate.got_mouse_event()); | 1819 EXPECT_TRUE(delegate.got_mouse_event()); |
| 1813 EXPECT_TRUE(delegate.got_destroy()); | 1820 EXPECT_TRUE(delegate.got_destroy()); |
| 1814 } | 1821 } |
| 1815 | 1822 |
| 1816 TEST_F(WindowEventDispatcherTest, WindowHideCancelsActiveTouches) { | 1823 TEST_F(WindowEventDispatcherTest, WindowHideCancelsActiveTouches) { |
| 1817 EventFilterRecorder recorder; | 1824 EventFilterRecorder recorder; |
| 1818 root_window()->AddPreTargetHandler(&recorder); | 1825 root_window()->AddPreTargetHandler(&recorder); |
| 1819 | 1826 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2039 | 2046 |
| 2040 void TearDown() override { | 2047 void TearDown() override { |
| 2041 window_.reset(); | 2048 window_.reset(); |
| 2042 WindowEventDispatcherTest::TearDown(); | 2049 WindowEventDispatcherTest::TearDown(); |
| 2043 } | 2050 } |
| 2044 | 2051 |
| 2045 private: | 2052 private: |
| 2046 // Used to avoid a copying |event| when binding to a closure. | 2053 // Used to avoid a copying |event| when binding to a closure. |
| 2047 static void RepostEventHelper(WindowEventDispatcher* dispatcher, | 2054 static void RepostEventHelper(WindowEventDispatcher* dispatcher, |
| 2048 scoped_ptr<ui::MouseEvent> event) { | 2055 scoped_ptr<ui::MouseEvent> event) { |
| 2049 dispatcher->RepostEvent(*event); | 2056 dispatcher->RepostEvent(event.get()); |
| 2050 } | 2057 } |
| 2051 | 2058 |
| 2052 scoped_ptr<Window> window_; | 2059 scoped_ptr<Window> window_; |
| 2053 ExitMessageLoopOnMousePress handler_; | 2060 ExitMessageLoopOnMousePress handler_; |
| 2054 | 2061 |
| 2055 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcherTestWithMessageLoop); | 2062 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcherTestWithMessageLoop); |
| 2056 }; | 2063 }; |
| 2057 | 2064 |
| 2058 TEST_F(WindowEventDispatcherTestWithMessageLoop, EventRepostedInNonNestedLoop) { | 2065 TEST_F(WindowEventDispatcherTestWithMessageLoop, EventRepostedInNonNestedLoop) { |
| 2059 CHECK(!message_loop()->is_running()); | 2066 CHECK(!message_loop()->is_running()); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2200 const base::Closure callback_on_right_click = base::Bind( | 2207 const base::Closure callback_on_right_click = base::Bind( |
| 2201 base::IgnoreResult(&WindowEventDispatcherTestInHighDPI::DispatchEvent), | 2208 base::IgnoreResult(&WindowEventDispatcherTestInHighDPI::DispatchEvent), |
| 2202 base::Unretained(this), base::Unretained(&mouse_move)); | 2209 base::Unretained(this), base::Unretained(&mouse_move)); |
| 2203 TriggerNestedLoopOnRightMousePress handler(callback_on_right_click); | 2210 TriggerNestedLoopOnRightMousePress handler(callback_on_right_click); |
| 2204 window->AddPreTargetHandler(&handler); | 2211 window->AddPreTargetHandler(&handler); |
| 2205 | 2212 |
| 2206 scoped_ptr<ui::MouseEvent> mouse( | 2213 scoped_ptr<ui::MouseEvent> mouse( |
| 2207 new ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), | 2214 new ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10), |
| 2208 gfx::Point(10, 10), ui::EventTimeForNow(), | 2215 gfx::Point(10, 10), ui::EventTimeForNow(), |
| 2209 ui::EF_RIGHT_MOUSE_BUTTON, ui::EF_RIGHT_MOUSE_BUTTON)); | 2216 ui::EF_RIGHT_MOUSE_BUTTON, ui::EF_RIGHT_MOUSE_BUTTON)); |
| 2210 host()->dispatcher()->RepostEvent(*mouse); | 2217 host()->dispatcher()->RepostEvent(mouse.get()); |
| 2211 EXPECT_EQ(0, handler.num_mouse_events()); | 2218 EXPECT_EQ(0, handler.num_mouse_events()); |
| 2212 | 2219 |
| 2213 base::RunLoop run_loop; | 2220 base::RunLoop run_loop; |
| 2214 run_loop.RunUntilIdle(); | 2221 run_loop.RunUntilIdle(); |
| 2215 // The window should receive the mouse-press and the mouse-move events. | 2222 // The window should receive the mouse-press and the mouse-move events. |
| 2216 EXPECT_EQ(2, handler.num_mouse_events()); | 2223 EXPECT_EQ(2, handler.num_mouse_events()); |
| 2217 // The mouse-move event location should be transformed because of the DSF | 2224 // The mouse-move event location should be transformed because of the DSF |
| 2218 // before it reaches the window. | 2225 // before it reaches the window. |
| 2219 EXPECT_EQ(gfx::Point(40, 40).ToString(), | 2226 EXPECT_EQ(gfx::Point(40, 40).ToString(), |
| 2220 handler.mouse_move_location().ToString()); | 2227 handler.mouse_move_location().ToString()); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 // 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|. |
| 2659 test_screen()->SetDeviceScaleFactor(2.f); | 2666 test_screen()->SetDeviceScaleFactor(2.f); |
| 2660 dispatcher->OnCursorMovedToRootLocation(gfx::Point(11, 11)); | 2667 dispatcher->OnCursorMovedToRootLocation(gfx::Point(11, 11)); |
| 2661 RunAllPendingInMessageLoop(); | 2668 RunAllPendingInMessageLoop(); |
| 2662 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_MOUSE_EXITED)); | 2669 EXPECT_TRUE(recorder.HasReceivedEvent(ui::ET_MOUSE_EXITED)); |
| 2663 | 2670 |
| 2664 w->RemovePreTargetHandler(&recorder); | 2671 w->RemovePreTargetHandler(&recorder); |
| 2665 } | 2672 } |
| 2666 | 2673 |
| 2667 } // namespace aura | 2674 } // namespace aura |
| OLD | NEW |