Source/WebKit/chromium: Use new type-specific WebGestureEvent fields
[WebKit-https.git] / Source / WebKit / chromium / tests / WebCompositorInputHandlerImplTest.cpp
index 8313b0f..82e3b54 100644 (file)
@@ -200,14 +200,14 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureScrollStarted)
     VERIFY_AND_RESET_MOCKS();
 
     gesture.type = WebInputEvent::GestureScrollUpdate;
-    gesture.deltaY = -40; // -Y means scroll down - i.e. in the +Y direction.
+    gesture.data.scrollUpdate.deltaY = -40; // -Y means scroll down - i.e. in the +Y direction.
     EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_, testing::Property(&WebCore::IntSize::height, testing::Gt(0))));
     m_inputHandler->handleInputEvent(gesture);
 
     VERIFY_AND_RESET_MOCKS();
 
     gesture.type = WebInputEvent::GestureScrollEnd;
-    gesture.deltaY = 0;
+    gesture.data.scrollUpdate.deltaY = 0;
     EXPECT_CALL(m_mockCCInputHandlerClient, scrollEnd());
     m_inputHandler->handleInputEvent(gesture);
 }
@@ -227,13 +227,13 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureScrollOnMainThread)
     VERIFY_AND_RESET_MOCKS();
 
     gesture.type = WebInputEvent::GestureScrollUpdate;
-    gesture.deltaY = 40;
+    gesture.data.scrollUpdate.deltaY = 40;
     m_inputHandler->handleInputEvent(gesture);
 
     VERIFY_AND_RESET_MOCKS();
 
     gesture.type = WebInputEvent::GestureScrollEnd;
-    gesture.deltaY = 0;
+    gesture.data.scrollUpdate.deltaY = 0;
     m_inputHandler->handleInputEvent(gesture);
 }
 
@@ -266,7 +266,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gesturePinch)
     VERIFY_AND_RESET_MOCKS();
 
     gesture.type = WebInputEvent::GesturePinchUpdate;
-    gesture.deltaX = 1.5;
+    gesture.data.pinchUpdate.scale = 1.5;
     gesture.x = 7;
     gesture.y = 13;
     EXPECT_CALL(m_mockCCInputHandlerClient, pinchGestureUpdate(1.5, WebCore::IntPoint(7, 13)));
@@ -275,7 +275,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gesturePinch)
     VERIFY_AND_RESET_MOCKS();
 
     gesture.type = WebInputEvent::GesturePinchUpdate;
-    gesture.deltaX = 0.5;
+    gesture.data.pinchUpdate.scale = 0.5;
     gesture.x = 9;
     gesture.y = 6;
     EXPECT_CALL(m_mockCCInputHandlerClient, pinchGestureUpdate(.5, WebCore::IntPoint(9, 6)));
@@ -298,7 +298,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingStarted)
         .WillOnce(testing::Return(WebCore::CCInputHandlerClient::ScrollStarted));
 
     gesture.type = WebInputEvent::GestureFlingStart;
-    gesture.deltaX = 10;
+    gesture.data.flingStart.velocityX = 10;
     EXPECT_CALL(m_mockCCInputHandlerClient, scheduleAnimation());
     m_inputHandler->handleInputEvent(gesture);
 
@@ -359,8 +359,8 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingAnimates)
     WebPoint flingPoint = WebPoint(7, 13);
     WebPoint flingGlobalPoint = WebPoint(17, 23);
     int modifiers = 7;
-    gesture.deltaX = flingDelta.x;
-    gesture.deltaY = flingDelta.y;
+    gesture.data.flingStart.velocityX = flingDelta.x;
+    gesture.data.flingStart.velocityY = flingDelta.y;
     gesture.x = flingPoint.x;
     gesture.y = flingPoint.y;
     gesture.globalX = flingGlobalPoint.x;
@@ -443,8 +443,8 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets)
     WebPoint flingPoint = WebPoint(7, 13);
     WebPoint flingGlobalPoint = WebPoint(17, 23);
     int modifiers = 1;
-    gesture.deltaX = flingDelta.x;
-    gesture.deltaY = flingDelta.y;
+    gesture.data.flingStart.velocityX = flingDelta.x;
+    gesture.data.flingStart.velocityY = flingDelta.y;
     gesture.x = flingPoint.x;
     gesture.y = flingPoint.y;
     gesture.globalX = flingGlobalPoint.x;
@@ -522,8 +522,8 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets)
     flingPoint = WebPoint(95, 87);
     flingGlobalPoint = WebPoint(32, 71);
     modifiers = 2;
-    gesture.deltaX = flingDelta.x;
-    gesture.deltaY = flingDelta.y;
+    gesture.data.flingStart.velocityX = flingDelta.x;
+    gesture.data.flingStart.velocityY = flingDelta.y;
     gesture.x = flingPoint.x;
     gesture.y = flingPoint.y;
     gesture.globalX = flingGlobalPoint.x;