Changeset 128199 in webkit
- Timestamp:
- Sep 11, 2012 9:59:08 AM (12 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r128168 r128199 1 2012-09-11 Iain Merrick <husky@chromium.org> 2 3 [chromium] Fix double call to scrollBegin() when handling scroll gesture 4 https://bugs.webkit.org/show_bug.cgi?id=95322 5 6 Reviewed by James Robinson. 7 8 WebCompositorInputHandlerImpl::handleGestureFling() calls scrollBegin() on its 9 client, then if the result is ScrollStarted, it creates a PlatformGestureCurve 10 object to handle the fling animation. This patch adds a matching scrollEnd() 11 before the animation starts. 12 13 Now using strict mocks in WebCompositorInputHandlerImplTest, which turns all 14 unexpected calls into test failures. This ensures that scrollBegin / scrollEnd 15 happen exactly when we want and at no other times. 16 17 * src/WebCompositorInputHandlerImpl.cpp: 18 (WebKit::WebCompositorInputHandlerImpl::handleGestureFling): 19 * tests/WebCompositorInputHandlerImplTest.cpp: 20 (WebCompositorInputHandlerImplTest): 21 (WebKit::TEST_F): 22 1 23 2012-09-11 Peter Beverloo <peter@chromium.org> 2 24 -
trunk/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
r127948 r128199 206 206 switch (scrollStatus) { 207 207 case WebInputHandlerClient::ScrollStatusStarted: { 208 m_inputHandlerClient->scrollEnd(); 208 209 m_wheelFlingCurve = PlatformGestureCurveFactory::get()->createCurve(gestureEvent.data.flingStart.sourceDevice, FloatPoint(gestureEvent.data.flingStart.velocityX, gestureEvent.data.flingStart.velocityY)); 209 210 TRACE_EVENT_ASYNC_BEGIN1("cc", "WebCompositorInputHandlerImpl::handleGestureFling::started", this, "curve", m_wheelFlingCurve->debugName()); -
trunk/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp
r127960 r128199 134 134 135 135 protected: 136 MockWebInputHandlerClientm_mockInputHandlerClient;136 testing::StrictMock<MockWebInputHandlerClient> m_mockInputHandlerClient; 137 137 OwnPtr<WebCompositorInputHandlerImpl> m_inputHandler; 138 MockWebCompositorInputHandlerClientm_mockClient;138 testing::StrictMock<MockWebCompositorInputHandlerClient> m_mockClient; 139 139 WebGestureEvent gesture; 140 140 WebKitTests::WebCompositorInitializer m_initializer; … … 256 256 EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) 257 257 .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted)); 258 EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()); 259 EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation()); 258 260 259 261 gesture.type = WebInputEvent::GestureFlingStart; 260 262 gesture.data.flingStart.velocityX = 10; 261 EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation());262 263 m_inputHandler->handleInputEvent(gesture); 263 264 … … 329 330 EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) 330 331 .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted)); 332 EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()); 331 333 m_inputHandler->handleInputEvent(gesture); 332 334 … … 413 415 EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) 414 416 .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted)); 417 EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()); 415 418 m_inputHandler->handleInputEvent(gesture); 416 419 … … 492 495 EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) 493 496 .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted)); 497 EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()); 494 498 m_inputHandler->handleInputEvent(gesture); 495 499
Note: See TracChangeset
for help on using the changeset viewer.