| Index: third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp b/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
|
| index 2f77f2c681246d87dd9ae3883d5811eaa2f37739..f3cfa329088c77c3bce36169c6a08ad524e6be14 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
|
| @@ -135,10 +135,10 @@ TEST(WebInputEventConversionTest, InputEventsScaling) {
|
| WebMouseEvent webMouseEvent(WebInputEvent::MouseMove,
|
| WebInputEvent::NoModifiers,
|
| WebInputEvent::TimeStampForTesting);
|
| - webMouseEvent.x = 10;
|
| - webMouseEvent.y = 10;
|
| - webMouseEvent.globalX = 10;
|
| - webMouseEvent.globalY = 10;
|
| + webMouseEvent.position.x = 10;
|
| + webMouseEvent.position.y = 10;
|
| + webMouseEvent.screenPosition.x = 10;
|
| + webMouseEvent.screenPosition.y = 10;
|
| webMouseEvent.movementX = 10;
|
| webMouseEvent.movementY = 10;
|
|
|
| @@ -147,8 +147,8 @@ TEST(WebInputEventConversionTest, InputEventsScaling) {
|
| IntPoint position = flooredIntPoint(transformedEvent.positionInRootFrame());
|
| EXPECT_EQ(5, position.x());
|
| EXPECT_EQ(5, position.y());
|
| - EXPECT_EQ(10, transformedEvent.globalX);
|
| - EXPECT_EQ(10, transformedEvent.globalY);
|
| + EXPECT_EQ(10, transformedEvent.screenPosition.x);
|
| + EXPECT_EQ(10, transformedEvent.screenPosition.y);
|
|
|
| IntPoint movement = flooredIntPoint(transformedEvent.movementInRootFrame());
|
| EXPECT_EQ(5, movement.x());
|
| @@ -365,10 +365,10 @@ TEST(WebInputEventConversionTest, InputEventsTransform) {
|
| WebMouseEvent webMouseEvent(WebInputEvent::MouseMove,
|
| WebInputEvent::NoModifiers,
|
| WebInputEvent::TimeStampForTesting);
|
| - webMouseEvent.x = 100;
|
| - webMouseEvent.y = 110;
|
| - webMouseEvent.globalX = 100;
|
| - webMouseEvent.globalY = 110;
|
| + webMouseEvent.position.x = 100;
|
| + webMouseEvent.position.y = 110;
|
| + webMouseEvent.screenPosition.x = 100;
|
| + webMouseEvent.screenPosition.y = 110;
|
| webMouseEvent.movementX = 60;
|
| webMouseEvent.movementY = 60;
|
|
|
| @@ -378,8 +378,8 @@ TEST(WebInputEventConversionTest, InputEventsTransform) {
|
|
|
| EXPECT_FLOAT_EQ(30, position.x());
|
| EXPECT_FLOAT_EQ(30, position.y());
|
| - EXPECT_EQ(100, transformedEvent.globalX);
|
| - EXPECT_EQ(110, transformedEvent.globalY);
|
| + EXPECT_EQ(100, transformedEvent.screenPosition.x);
|
| + EXPECT_EQ(110, transformedEvent.screenPosition.y);
|
|
|
| IntPoint movement = flooredIntPoint(transformedEvent.movementInRootFrame());
|
| EXPECT_EQ(20, movement.x());
|
| @@ -390,16 +390,16 @@ TEST(WebInputEventConversionTest, InputEventsTransform) {
|
| WebMouseEvent webMouseEvent1(WebInputEvent::MouseMove,
|
| WebInputEvent::NoModifiers,
|
| WebInputEvent::TimeStampForTesting);
|
| - webMouseEvent1.x = 100;
|
| - webMouseEvent1.y = 110;
|
| - webMouseEvent1.globalX = 100;
|
| - webMouseEvent1.globalY = 110;
|
| + webMouseEvent1.position.x = 100;
|
| + webMouseEvent1.position.y = 110;
|
| + webMouseEvent1.screenPosition.x = 100;
|
| + webMouseEvent1.screenPosition.y = 110;
|
| webMouseEvent1.movementX = 60;
|
| webMouseEvent1.movementY = 60;
|
|
|
| WebMouseEvent webMouseEvent2 = webMouseEvent1;
|
| - webMouseEvent2.y = 140;
|
| - webMouseEvent2.globalY = 140;
|
| + webMouseEvent2.position.y = 140;
|
| + webMouseEvent2.screenPosition.y = 140;
|
| webMouseEvent2.movementY = 30;
|
|
|
| std::vector<const WebInputEvent*> events;
|
| @@ -413,8 +413,8 @@ TEST(WebInputEventConversionTest, InputEventsTransform) {
|
| FloatPoint position = coalescedevents[0].positionInRootFrame();
|
| EXPECT_FLOAT_EQ(30, position.x());
|
| EXPECT_FLOAT_EQ(30, position.y());
|
| - EXPECT_EQ(100, coalescedevents[0].globalX);
|
| - EXPECT_EQ(110, coalescedevents[0].globalY);
|
| + EXPECT_EQ(100, coalescedevents[0].screenPosition.x);
|
| + EXPECT_EQ(110, coalescedevents[0].screenPosition.y);
|
|
|
| IntPoint movement =
|
| flooredIntPoint(coalescedevents[0].movementInRootFrame());
|
| @@ -424,8 +424,8 @@ TEST(WebInputEventConversionTest, InputEventsTransform) {
|
| position = coalescedevents[1].positionInRootFrame();
|
| EXPECT_FLOAT_EQ(30, position.x());
|
| EXPECT_FLOAT_EQ(40, position.y());
|
| - EXPECT_EQ(100, coalescedevents[1].globalX);
|
| - EXPECT_EQ(140, coalescedevents[1].globalY);
|
| + EXPECT_EQ(100, coalescedevents[1].screenPosition.x);
|
| + EXPECT_EQ(140, coalescedevents[1].screenPosition.y);
|
|
|
| movement = flooredIntPoint(coalescedevents[1].movementInRootFrame());
|
| EXPECT_EQ(20, movement.x());
|
| @@ -679,10 +679,10 @@ TEST(WebInputEventConversionTest, VisualViewportOffset) {
|
| WebMouseEvent webMouseEvent(WebInputEvent::MouseMove,
|
| WebInputEvent::NoModifiers,
|
| WebInputEvent::TimeStampForTesting);
|
| - webMouseEvent.x = 10;
|
| - webMouseEvent.y = 10;
|
| - webMouseEvent.globalX = 10;
|
| - webMouseEvent.globalY = 10;
|
| + webMouseEvent.position.x = 10;
|
| + webMouseEvent.position.y = 10;
|
| + webMouseEvent.screenPosition.x = 10;
|
| + webMouseEvent.screenPosition.y = 10;
|
|
|
| WebMouseEvent transformedMouseEvent =
|
| TransformWebMouseEvent(view, webMouseEvent);
|
| @@ -690,18 +690,18 @@ TEST(WebInputEventConversionTest, VisualViewportOffset) {
|
| flooredIntPoint(transformedMouseEvent.positionInRootFrame());
|
| EXPECT_EQ(5 + visualOffset.x(), position.x());
|
| EXPECT_EQ(5 + visualOffset.y(), position.y());
|
| - EXPECT_EQ(10, transformedMouseEvent.globalX);
|
| - EXPECT_EQ(10, transformedMouseEvent.globalY);
|
| + EXPECT_EQ(10, transformedMouseEvent.screenPosition.x);
|
| + EXPECT_EQ(10, transformedMouseEvent.screenPosition.y);
|
| }
|
|
|
| {
|
| WebMouseWheelEvent webMouseWheelEvent(WebInputEvent::MouseWheel,
|
| WebInputEvent::NoModifiers,
|
| WebInputEvent::TimeStampForTesting);
|
| - webMouseWheelEvent.x = 10;
|
| - webMouseWheelEvent.y = 10;
|
| - webMouseWheelEvent.globalX = 10;
|
| - webMouseWheelEvent.globalY = 10;
|
| + webMouseWheelEvent.position.x = 10;
|
| + webMouseWheelEvent.position.y = 10;
|
| + webMouseWheelEvent.screenPosition.x = 10;
|
| + webMouseWheelEvent.screenPosition.y = 10;
|
|
|
| WebMouseWheelEvent scaledMouseWheelEvent =
|
| TransformWebMouseWheelEvent(view, webMouseWheelEvent);
|
| @@ -709,8 +709,8 @@ TEST(WebInputEventConversionTest, VisualViewportOffset) {
|
| flooredIntPoint(scaledMouseWheelEvent.positionInRootFrame());
|
| EXPECT_EQ(5 + visualOffset.x(), position.x());
|
| EXPECT_EQ(5 + visualOffset.y(), position.y());
|
| - EXPECT_EQ(10, scaledMouseWheelEvent.globalX);
|
| - EXPECT_EQ(10, scaledMouseWheelEvent.globalY);
|
| + EXPECT_EQ(10, scaledMouseWheelEvent.screenPosition.x);
|
| + EXPECT_EQ(10, scaledMouseWheelEvent.screenPosition.y);
|
| }
|
|
|
| {
|
| @@ -784,20 +784,24 @@ TEST(WebInputEventConversionTest, ElasticOverscroll) {
|
| WebMouseEvent webMouseEvent(WebInputEvent::MouseMove,
|
| WebInputEvent::NoModifiers,
|
| WebInputEvent::TimeStampForTesting);
|
| - webMouseEvent.x = 10;
|
| - webMouseEvent.y = 50;
|
| - webMouseEvent.globalX = 10;
|
| - webMouseEvent.globalY = 50;
|
| + webMouseEvent.position.x = 10;
|
| + webMouseEvent.position.y = 50;
|
| + webMouseEvent.screenPosition.x = 10;
|
| + webMouseEvent.screenPosition.y = 50;
|
|
|
| WebMouseEvent transformedMouseEvent =
|
| TransformWebMouseEvent(view, webMouseEvent);
|
| IntPoint position =
|
| flooredIntPoint(transformedMouseEvent.positionInRootFrame());
|
|
|
| - EXPECT_EQ(webMouseEvent.x + elasticOverscroll.width(), position.x());
|
| - EXPECT_EQ(webMouseEvent.y + elasticOverscroll.height(), position.y());
|
| - EXPECT_EQ(webMouseEvent.globalX, transformedMouseEvent.globalX);
|
| - EXPECT_EQ(webMouseEvent.globalY, transformedMouseEvent.globalY);
|
| + EXPECT_EQ(webMouseEvent.position.x + elasticOverscroll.width(),
|
| + position.x());
|
| + EXPECT_EQ(webMouseEvent.position.y + elasticOverscroll.height(),
|
| + position.y());
|
| + EXPECT_EQ(webMouseEvent.screenPosition.x,
|
| + transformedMouseEvent.screenPosition.x);
|
| + EXPECT_EQ(webMouseEvent.screenPosition.y,
|
| + transformedMouseEvent.screenPosition.y);
|
| }
|
|
|
| // Elastic overscroll and pinch-zoom (this doesn't actually ever happen,
|
| @@ -811,24 +815,26 @@ TEST(WebInputEventConversionTest, ElasticOverscroll) {
|
| WebMouseEvent webMouseEvent(WebInputEvent::MouseMove,
|
| WebInputEvent::NoModifiers,
|
| WebInputEvent::TimeStampForTesting);
|
| - webMouseEvent.x = 10;
|
| - webMouseEvent.y = 10;
|
| - webMouseEvent.globalX = 10;
|
| - webMouseEvent.globalY = 10;
|
| + webMouseEvent.position.x = 10;
|
| + webMouseEvent.position.y = 10;
|
| + webMouseEvent.screenPosition.x = 10;
|
| + webMouseEvent.screenPosition.y = 10;
|
|
|
| WebMouseEvent transformedMouseEvent =
|
| TransformWebMouseEvent(view, webMouseEvent);
|
| IntPoint position =
|
| flooredIntPoint(transformedMouseEvent.positionInRootFrame());
|
|
|
| - EXPECT_EQ(webMouseEvent.x / pageScale + visualOffset.x() +
|
| + EXPECT_EQ(webMouseEvent.position.x / pageScale + visualOffset.x() +
|
| elasticOverscroll.width(),
|
| position.x());
|
| - EXPECT_EQ(webMouseEvent.y / pageScale + visualOffset.y() +
|
| + EXPECT_EQ(webMouseEvent.position.y / pageScale + visualOffset.y() +
|
| elasticOverscroll.height(),
|
| position.y());
|
| - EXPECT_EQ(webMouseEvent.globalX, transformedMouseEvent.globalX);
|
| - EXPECT_EQ(webMouseEvent.globalY, transformedMouseEvent.globalY);
|
| + EXPECT_EQ(webMouseEvent.screenPosition.x,
|
| + transformedMouseEvent.screenPosition.x);
|
| + EXPECT_EQ(webMouseEvent.screenPosition.y,
|
| + transformedMouseEvent.screenPosition.y);
|
| }
|
| }
|
|
|
| @@ -857,20 +863,24 @@ TEST(WebInputEventConversionTest, ElasticOverscrollWithPageReload) {
|
| WebMouseEvent webMouseEvent(WebInputEvent::MouseMove,
|
| WebInputEvent::NoModifiers,
|
| WebInputEvent::TimeStampForTesting);
|
| - webMouseEvent.x = 10;
|
| - webMouseEvent.y = 50;
|
| - webMouseEvent.globalX = 10;
|
| - webMouseEvent.globalY = 50;
|
| + webMouseEvent.position.x = 10;
|
| + webMouseEvent.position.y = 50;
|
| + webMouseEvent.screenPosition.x = 10;
|
| + webMouseEvent.screenPosition.y = 50;
|
|
|
| WebMouseEvent transformedMouseEvent =
|
| TransformWebMouseEvent(view, webMouseEvent);
|
| IntPoint position =
|
| flooredIntPoint(transformedMouseEvent.positionInRootFrame());
|
|
|
| - EXPECT_EQ(webMouseEvent.x + elasticOverscroll.width(), position.x());
|
| - EXPECT_EQ(webMouseEvent.y + elasticOverscroll.height(), position.y());
|
| - EXPECT_EQ(webMouseEvent.globalX, transformedMouseEvent.globalX);
|
| - EXPECT_EQ(webMouseEvent.globalY, transformedMouseEvent.globalY);
|
| + EXPECT_EQ(webMouseEvent.position.x + elasticOverscroll.width(),
|
| + position.x());
|
| + EXPECT_EQ(webMouseEvent.position.y + elasticOverscroll.height(),
|
| + position.y());
|
| + EXPECT_EQ(webMouseEvent.screenPosition.x,
|
| + transformedMouseEvent.screenPosition.x);
|
| + EXPECT_EQ(webMouseEvent.screenPosition.y,
|
| + transformedMouseEvent.screenPosition.y);
|
| }
|
| }
|
|
|
|
|