Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/browser/renderer_host/input/timeout_monitor.h" | 9 #include "content/browser/renderer_host/input/timeout_monitor.h" |
| 10 #include "content/browser/renderer_host/input/touch_event_queue.h" | 10 #include "content/browser/renderer_host/input/touch_event_queue.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 WebGestureEvent event; | 111 WebGestureEvent event; |
| 112 event.type = type; | 112 event.type = type; |
| 113 queue_->OnGestureScrollEvent( | 113 queue_->OnGestureScrollEvent( |
| 114 GestureEventWithLatencyInfo(event, ui::LatencyInfo())); | 114 GestureEventWithLatencyInfo(event, ui::LatencyInfo())); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void SendTouchEventAck(InputEventAckState ack_result) { | 117 void SendTouchEventAck(InputEventAckState ack_result) { |
| 118 queue_->ProcessTouchAck(ack_result, ui::LatencyInfo()); | 118 queue_->ProcessTouchAck(ack_result, ui::LatencyInfo()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void SendUncancelableTouchMoveEventAck() { | |
| 122 queue_->ProcessUncancelableTouchMoveAck(); | |
| 123 } | |
| 124 | |
| 121 void SendGestureEventAck(WebInputEvent::Type type, | 125 void SendGestureEventAck(WebInputEvent::Type type, |
| 122 InputEventAckState ack_result) { | 126 InputEventAckState ack_result) { |
| 123 blink::WebGestureEvent gesture_event; | 127 blink::WebGestureEvent gesture_event; |
| 124 gesture_event.type = type; | 128 gesture_event.type = type; |
| 125 GestureEventWithLatencyInfo event(gesture_event, ui::LatencyInfo()); | 129 GestureEventWithLatencyInfo event(gesture_event, ui::LatencyInfo()); |
| 126 queue_->OnGestureEventAck(event, ack_result); | 130 queue_->OnGestureEventAck(event, ack_result); |
| 127 } | 131 } |
| 128 | 132 |
| 129 void SetFollowupEvent(const WebTouchEvent& event) { | 133 void SetFollowupEvent(const WebTouchEvent& event) { |
| 130 followup_touch_event_.reset(new WebTouchEvent(event)); | 134 followup_touch_event_.reset(new WebTouchEvent(event)); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 InputEventAckState acked_event_state() const { | 268 InputEventAckState acked_event_state() const { |
| 265 return last_acked_event_state_; | 269 return last_acked_event_state_; |
| 266 } | 270 } |
| 267 | 271 |
| 268 static void RunTasksAndWait(base::TimeDelta delay) { | 272 static void RunTasksAndWait(base::TimeDelta delay) { |
| 269 base::MessageLoop::current()->PostDelayedTask( | 273 base::MessageLoop::current()->PostDelayedTask( |
| 270 FROM_HERE, base::MessageLoop::QuitClosure(), delay); | 274 FROM_HERE, base::MessageLoop::QuitClosure(), delay); |
| 271 base::MessageLoop::current()->Run(); | 275 base::MessageLoop::current()->Run(); |
| 272 } | 276 } |
| 273 | 277 |
| 278 int sent_uncancelable_touch_move_count() const { | |
| 279 return queue_->SentUncancelableTouchMoveCount(); | |
| 280 } | |
| 281 | |
| 282 int pending_uncancelable_event_ack_count() const { | |
| 283 return queue_->PendingUncancelableEventAckCount(); | |
| 284 } | |
| 285 | |
| 274 private: | 286 private: |
| 275 void SendTouchEvent() { | 287 void SendTouchEvent() { |
| 276 SendTouchEvent(touch_event_); | 288 SendTouchEvent(touch_event_); |
| 277 touch_event_.ResetPoints(); | 289 touch_event_.ResetPoints(); |
| 278 } | 290 } |
| 279 | 291 |
| 280 void ResetQueueWithConfig(const TouchEventQueue::Config& config) { | 292 void ResetQueueWithConfig(const TouchEventQueue::Config& config) { |
| 281 queue_.reset(new TouchEventQueue(this, config)); | 293 queue_.reset(new TouchEventQueue(this, config)); |
| 282 queue_->OnHasTouchEventHandlers(true); | 294 queue_->OnHasTouchEventHandlers(true); |
| 283 } | 295 } |
| (...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1825 INPUT_EVENT_ACK_STATE_CONSUMED); | 1837 INPUT_EVENT_ACK_STATE_CONSUMED); |
| 1826 | 1838 |
| 1827 // An async touch should fire after the throttling interval has expired, but | 1839 // An async touch should fire after the throttling interval has expired, but |
| 1828 // it should not start the touch ack timeout. | 1840 // it should not start the touch ack timeout. |
| 1829 MoveTouchPoint(0, 5, 5); | 1841 MoveTouchPoint(0, 5, 5); |
| 1830 EXPECT_TRUE(HasPendingAsyncTouchMove()); | 1842 EXPECT_TRUE(HasPendingAsyncTouchMove()); |
| 1831 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1843 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 1832 | 1844 |
| 1833 AdvanceTouchTime(kMinSecondsBetweenThrottledTouchmoves + 0.1); | 1845 AdvanceTouchTime(kMinSecondsBetweenThrottledTouchmoves + 0.1); |
| 1834 MoveTouchPoint(0, 5, 5); | 1846 MoveTouchPoint(0, 5, 5); |
| 1835 EXPECT_FALSE(IsTimeoutRunning()); | 1847 SendUncancelableTouchMoveEventAck(); |
| 1848 // EXPECT_FALSE(IsTimeoutRunning()); | |
| 1836 EXPECT_FALSE(HasPendingAsyncTouchMove()); | 1849 EXPECT_FALSE(HasPendingAsyncTouchMove()); |
| 1837 EXPECT_FALSE(sent_event().cancelable); | 1850 EXPECT_FALSE(sent_event().cancelable); |
| 1838 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 1851 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 1839 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1852 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 1840 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1853 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 1841 | 1854 |
| 1842 // An unconsumed scroll event will resume synchronous touchmoves, which are | 1855 // An unconsumed scroll event will resume synchronous touchmoves, which are |
| 1843 // subject to the ack timeout. | 1856 // subject to the ack timeout. |
| 1844 SendGestureEventAck(WebInputEvent::GestureScrollUpdate, | 1857 SendGestureEventAck(WebInputEvent::GestureScrollUpdate, |
| 1845 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 1858 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1964 SendGestureEvent(WebInputEvent::GestureScrollEnd); | 1977 SendGestureEvent(WebInputEvent::GestureScrollEnd); |
| 1965 ResetTouchEvent(); | 1978 ResetTouchEvent(); |
| 1966 | 1979 |
| 1967 PressTouchPoint(0, 0); | 1980 PressTouchPoint(0, 0); |
| 1968 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 1981 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 1969 EXPECT_EQ(WebInputEvent::TouchStart, sent_event().type); | 1982 EXPECT_EQ(WebInputEvent::TouchStart, sent_event().type); |
| 1970 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 1983 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 1971 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 1984 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 1972 } | 1985 } |
| 1973 | 1986 |
| 1987 TEST_F(TouchEventQueueTest, SendNextThrottledAsyncTouchMoveAfterAck) { | |
|
tdresser
2015/03/25 14:16:18
Give a brief summary of what scenario the test cov
lanwei
2015/03/26 11:54:38
Done.
| |
| 1988 // Process a TouchStart | |
| 1989 PressTouchPoint(0, 1); | |
| 1990 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 1991 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | |
| 1992 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 1993 | |
| 1994 // Initiate async touchmove dispatch after the start of a scroll sequence. | |
| 1995 MoveTouchPoint(0, 0, 5); | |
| 1996 WebGestureEvent followup_scroll; | |
| 1997 followup_scroll.type = WebInputEvent::GestureScrollBegin; | |
| 1998 SetFollowupEvent(followup_scroll); | |
| 1999 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | |
| 2000 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2001 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2002 | |
| 2003 MoveTouchPoint(0, 0, 10); | |
| 2004 followup_scroll.type = WebInputEvent::GestureScrollUpdate; | |
| 2005 SetFollowupEvent(followup_scroll); | |
| 2006 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | |
| 2007 EXPECT_FALSE(HasPendingAsyncTouchMove()); | |
| 2008 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2009 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2010 | |
| 2011 // Now queue a second touchmove and verify it's not (yet) dispatched. | |
|
tdresser
2015/03/25 14:16:18
Clarify that it's not yet dispatched because we've
lanwei
2015/03/26 11:54:38
Done.
| |
| 2012 MoveTouchPoint(0, 0, 20); | |
| 2013 EXPECT_TRUE(HasPendingAsyncTouchMove()); | |
| 2014 EXPECT_EQ(0U, queued_event_count()); | |
| 2015 EXPECT_EQ(0U, GetAndResetSentEventCount()); | |
| 2016 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
|
tdresser
2015/03/25 14:16:18
Add a comment indicating that this is a fake ack.
| |
| 2017 | |
| 2018 // Coalease the subsequent touchmove with pending_async_touch_move_ and not | |
|
tdresser
2015/03/25 14:16:18
"and not ready for dispatching" -> "but don't disp
lanwei
2015/03/26 11:54:38
Done.
| |
| 2019 // ready for dispatching. | |
| 2020 MoveTouchPoint(0, 0, 30); | |
| 2021 EXPECT_TRUE(HasPendingAsyncTouchMove()); | |
| 2022 EXPECT_EQ(0U, queued_event_count()); | |
| 2023 EXPECT_EQ(0U, GetAndResetSentEventCount()); | |
| 2024 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2025 EXPECT_EQ(0, sent_uncancelable_touch_move_count()); | |
| 2026 | |
| 2027 AdvanceTouchTime(kMinSecondsBetweenThrottledTouchmoves + 0.1); | |
| 2028 MoveTouchPoint(0, 0, 40); | |
| 2029 EXPECT_FALSE(HasPendingAsyncTouchMove()); | |
| 2030 EXPECT_FALSE(sent_event().cancelable); | |
| 2031 EXPECT_EQ(1U, queued_event_count()); | |
|
tdresser
2015/03/25 14:16:18
Why is there still something in the queue? Shouldn
lanwei
2015/03/26 11:54:38
When the touch move is sent but the fake ack is no
| |
| 2032 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2033 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | |
| 2034 EXPECT_EQ(1, sent_uncancelable_touch_move_count()); | |
| 2035 | |
| 2036 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | |
| 2037 EXPECT_EQ(0U, queued_event_count()); | |
| 2038 EXPECT_EQ(0U, GetAndResetSentEventCount()); | |
| 2039 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2040 | |
| 2041 // Do not dispatch the event until ThrottledTouchmoves intervals expires and | |
| 2042 // receive an ack from render. | |
| 2043 AdvanceTouchTime(kMinSecondsBetweenThrottledTouchmoves + 0.1); | |
| 2044 MoveTouchPoint(0, 0, 50); | |
| 2045 EXPECT_TRUE(HasPendingAsyncTouchMove()); | |
| 2046 EXPECT_EQ(0U, queued_event_count()); | |
| 2047 EXPECT_EQ(0U, GetAndResetSentEventCount()); | |
| 2048 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2049 EXPECT_EQ(1, sent_uncancelable_touch_move_count()); | |
| 2050 | |
| 2051 // Send pending_async_touch_move_ when we receive an ack back from render. | |
| 2052 SendUncancelableTouchMoveEventAck(); | |
| 2053 EXPECT_FALSE(HasPendingAsyncTouchMove()); | |
| 2054 EXPECT_EQ(1U, queued_event_count()); | |
| 2055 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2056 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | |
| 2057 EXPECT_EQ(1, sent_uncancelable_touch_move_count()); | |
| 2058 } | |
| 2059 | |
| 2060 TEST_F(TouchEventQueueTest, AsyncTouchFlushedByNonTouchMoveIgnoreAck) { | |
| 2061 // Process a TouchStart | |
| 2062 PressTouchPoint(0, 1); | |
| 2063 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2064 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | |
| 2065 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2066 | |
| 2067 // Initiate async touchmove dispatch after the start of a scroll sequence. | |
| 2068 MoveTouchPoint(0, 0, 5); | |
| 2069 WebGestureEvent followup_scroll; | |
| 2070 followup_scroll.type = WebInputEvent::GestureScrollBegin; | |
| 2071 SetFollowupEvent(followup_scroll); | |
| 2072 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | |
| 2073 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2074 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2075 | |
| 2076 MoveTouchPoint(0, 0, 10); | |
| 2077 followup_scroll.type = WebInputEvent::GestureScrollUpdate; | |
| 2078 SetFollowupEvent(followup_scroll); | |
| 2079 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | |
| 2080 EXPECT_FALSE(HasPendingAsyncTouchMove()); | |
| 2081 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2082 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2083 | |
| 2084 // Now queue a second touchmove and verify it's not (yet) dispatched. | |
| 2085 MoveTouchPoint(0, 0, 20); | |
| 2086 EXPECT_TRUE(HasPendingAsyncTouchMove()); | |
| 2087 EXPECT_EQ(0U, queued_event_count()); | |
| 2088 EXPECT_EQ(0U, GetAndResetSentEventCount()); | |
| 2089 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2090 | |
| 2091 // Coalease the subsequent touchmove with pending_async_touch_move_ and not | |
| 2092 // ready for dispatching. | |
| 2093 MoveTouchPoint(0, 0, 30); | |
| 2094 EXPECT_TRUE(HasPendingAsyncTouchMove()); | |
| 2095 EXPECT_EQ(0U, queued_event_count()); | |
| 2096 EXPECT_EQ(0U, GetAndResetSentEventCount()); | |
| 2097 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2098 EXPECT_EQ(0, sent_uncancelable_touch_move_count()); | |
| 2099 | |
| 2100 AdvanceTouchTime(kMinSecondsBetweenThrottledTouchmoves + 0.1); | |
| 2101 MoveTouchPoint(0, 0, 40); | |
| 2102 EXPECT_FALSE(HasPendingAsyncTouchMove()); | |
| 2103 EXPECT_FALSE(sent_event().cancelable); | |
| 2104 EXPECT_EQ(1U, queued_event_count()); | |
| 2105 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2106 EXPECT_EQ(0U, GetAndResetAckedEventCount()); | |
| 2107 EXPECT_EQ(1, sent_uncancelable_touch_move_count()); | |
| 2108 | |
| 2109 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | |
| 2110 EXPECT_EQ(0U, queued_event_count()); | |
| 2111 EXPECT_EQ(0U, GetAndResetSentEventCount()); | |
| 2112 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2113 | |
| 2114 MoveTouchPoint(0, 10, 50); | |
| 2115 EXPECT_TRUE(HasPendingAsyncTouchMove()); | |
| 2116 EXPECT_EQ(0U, queued_event_count()); | |
| 2117 EXPECT_EQ(0U, GetAndResetSentEventCount()); | |
| 2118 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | |
| 2119 EXPECT_EQ(1, sent_uncancelable_touch_move_count()); | |
| 2120 | |
| 2121 // Send touchend will flush pending_async_touch_move_. | |
| 2122 PressTouchPoint(30, 30); | |
| 2123 EXPECT_FALSE(HasPendingAsyncTouchMove()); | |
| 2124 EXPECT_EQ(WebInputEvent::TouchMove, sent_event().type); | |
| 2125 EXPECT_FALSE(sent_event().cancelable); | |
| 2126 EXPECT_EQ(10, sent_event().touches[0].position.x); | |
| 2127 EXPECT_EQ(50, sent_event().touches[0].position.y); | |
| 2128 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2129 EXPECT_EQ(2, sent_uncancelable_touch_move_count()); | |
| 2130 EXPECT_EQ(0, pending_uncancelable_event_ack_count()); | |
| 2131 | |
| 2132 // Touchend is not cancelable during async touch dispatch, reset | |
| 2133 // sent_uncancelable_touch_move_count, and update | |
| 2134 // pending_uncancelable_event_ack_count. | |
| 2135 SendTouchEventAck(INPUT_EVENT_ACK_STATE_IGNORED); | |
| 2136 EXPECT_EQ(WebInputEvent::TouchStart, sent_event().type); | |
| 2137 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2138 EXPECT_EQ(0, sent_uncancelable_touch_move_count()); | |
| 2139 EXPECT_EQ(2, pending_uncancelable_event_ack_count()); | |
| 2140 | |
| 2141 // Ignore the uncancelable touchmove acks until | |
| 2142 // pending_uncancelable_event_ack_count set to 0. | |
| 2143 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | |
| 2144 SendUncancelableTouchMoveEventAck(); | |
| 2145 EXPECT_EQ(1, pending_uncancelable_event_ack_count()); | |
| 2146 EXPECT_EQ(0, sent_uncancelable_touch_move_count()); | |
| 2147 EXPECT_EQ(0U, queued_event_count()); | |
| 2148 EXPECT_FALSE(HasPendingAsyncTouchMove()); | |
| 2149 | |
| 2150 // Send out the next uncancelable touchmove even when there are acks which | |
| 2151 // are not back from render. | |
| 2152 AdvanceTouchTime(kMinSecondsBetweenThrottledTouchmoves + 0.1); | |
| 2153 MoveTouchPoint(0, 20, 30); | |
| 2154 EXPECT_FALSE(HasPendingAsyncTouchMove()); | |
| 2155 EXPECT_EQ(WebInputEvent::TouchMove, sent_event().type); | |
| 2156 EXPECT_FALSE(sent_event().cancelable); | |
| 2157 EXPECT_EQ(1U, GetAndResetSentEventCount()); | |
| 2158 EXPECT_EQ(1, sent_uncancelable_touch_move_count()); | |
| 2159 EXPECT_EQ(1, pending_uncancelable_event_ack_count()); | |
| 2160 } | |
| 2161 | |
| 1974 TEST_F(TouchEventQueueTest, TouchAbsorptionWithConsumedFirstMove) { | 2162 TEST_F(TouchEventQueueTest, TouchAbsorptionWithConsumedFirstMove) { |
| 1975 // Queue a TouchStart. | 2163 // Queue a TouchStart. |
| 1976 PressTouchPoint(0, 1); | 2164 PressTouchPoint(0, 1); |
| 1977 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2165 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 1978 EXPECT_EQ(0U, queued_event_count()); | 2166 EXPECT_EQ(0U, queued_event_count()); |
| 1979 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 2167 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 1980 | 2168 |
| 1981 MoveTouchPoint(0, 20, 5); | 2169 MoveTouchPoint(0, 20, 5); |
| 1982 SendGestureEvent(blink::WebInputEvent::GestureScrollBegin); | 2170 SendGestureEvent(blink::WebInputEvent::GestureScrollBegin); |
| 1983 SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); | 2171 SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2052 | 2240 |
| 2053 // If subsequent touchmoves aren't consumed, the generated scroll events | 2241 // If subsequent touchmoves aren't consumed, the generated scroll events |
| 2054 // will restore async touch dispatch. | 2242 // will restore async touch dispatch. |
| 2055 MoveTouchPoint(0, 25, 5); | 2243 MoveTouchPoint(0, 25, 5); |
| 2056 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2244 SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 2057 SendGestureEvent(blink::WebInputEvent::GestureScrollUpdate); | 2245 SendGestureEvent(blink::WebInputEvent::GestureScrollUpdate); |
| 2058 ASSERT_EQ(1U, GetAndResetSentEventCount()); | 2246 ASSERT_EQ(1U, GetAndResetSentEventCount()); |
| 2059 EXPECT_TRUE(sent_event().cancelable); | 2247 EXPECT_TRUE(sent_event().cancelable); |
| 2060 AdvanceTouchTime(kMinSecondsBetweenThrottledTouchmoves + 0.1); | 2248 AdvanceTouchTime(kMinSecondsBetweenThrottledTouchmoves + 0.1); |
| 2061 MoveTouchPoint(0, 30, 5); | 2249 MoveTouchPoint(0, 30, 5); |
| 2250 SendUncancelableTouchMoveEventAck(); | |
| 2062 ASSERT_EQ(1U, GetAndResetSentEventCount()); | 2251 ASSERT_EQ(1U, GetAndResetSentEventCount()); |
| 2063 SendTouchEventAck(INPUT_EVENT_ACK_STATE_IGNORED); | 2252 SendTouchEventAck(INPUT_EVENT_ACK_STATE_IGNORED); |
| 2064 EXPECT_FALSE(sent_event().cancelable); | 2253 EXPECT_FALSE(sent_event().cancelable); |
| 2065 | 2254 |
| 2066 // The touchend will be uncancelable during an active scroll sequence. | 2255 // The touchend will be uncancelable during an active scroll sequence. |
| 2067 ReleaseTouchPoint(0); | 2256 ReleaseTouchPoint(0); |
| 2068 ASSERT_EQ(1U, GetAndResetSentEventCount()); | 2257 ASSERT_EQ(1U, GetAndResetSentEventCount()); |
| 2069 EXPECT_FALSE(sent_event().cancelable); | 2258 EXPECT_FALSE(sent_event().cancelable); |
| 2070 } | 2259 } |
| 2071 | 2260 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2252 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 2441 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 2253 | 2442 |
| 2254 // TouchMove should be allowed and test for touches state. | 2443 // TouchMove should be allowed and test for touches state. |
| 2255 const WebTouchEvent& event2 = sent_event(); | 2444 const WebTouchEvent& event2 = sent_event(); |
| 2256 EXPECT_EQ(WebInputEvent::TouchMove, event2.type); | 2445 EXPECT_EQ(WebInputEvent::TouchMove, event2.type); |
| 2257 EXPECT_EQ(WebTouchPoint::StateStationary, event2.touches[0].state); | 2446 EXPECT_EQ(WebTouchPoint::StateStationary, event2.touches[0].state); |
| 2258 EXPECT_EQ(WebTouchPoint::StateMoved, event2.touches[1].state); | 2447 EXPECT_EQ(WebTouchPoint::StateMoved, event2.touches[1].state); |
| 2259 } | 2448 } |
| 2260 | 2449 |
| 2261 } // namespace content | 2450 } // namespace content |
| OLD | NEW |