Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: Source/web/tests/WebInputEventConversionTest.cpp

Issue 1216053014: Add WebPointerEvent, WebMouseProperties and WebPointerProperties types. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/tests/TouchActionTest.cpp ('k') | public/web/WebInputEvent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebInputEventConversionTest.cpp
diff --git a/Source/web/tests/WebInputEventConversionTest.cpp b/Source/web/tests/WebInputEventConversionTest.cpp
index e0b7362b66ff6caf03dddb748c04c4e9aec6a78a..557de664f20a07835ff1608b1fcee486241d9b8a 100644
--- a/Source/web/tests/WebInputEventConversionTest.cpp
+++ b/Source/web/tests/WebInputEventConversionTest.cpp
@@ -108,19 +108,19 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
LayoutView* documentLayoutView = document->layoutView();
WebTouchPoint p0, p1;
- p0.id = 1;
- p1.id = 2;
+ p0.pointerId = 1;
+ p1.pointerId = 2;
p0.screenPosition = WebFloatPoint(100.f, 50.f);
p1.screenPosition = WebFloatPoint(150.f, 25.f);
p0.position = WebFloatPoint(10.f, 10.f);
p1.position = WebFloatPoint(5.f, 5.f);
- p0.radiusX = p1.radiusY = 10.f;
- p0.radiusY = p1.radiusX = 5.f;
+ p0.width = p1.height = 10.f;
+ p0.width = p1.height = 5.f;
p0.rotationAngle = p1.rotationAngle = 1.f;
- p0.force = p1.force = 25.f;
+ p0.pressure = p1.pressure = 25.f;
- RefPtrWillBeRawPtr<Touch> touch0 = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), p0.id, p0.screenPosition, p0.position, FloatSize(p0.radiusX, p0.radiusY), p0.rotationAngle, p0.force);
- RefPtrWillBeRawPtr<Touch> touch1 = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), p1.id, p1.screenPosition, p1.position, FloatSize(p1.radiusX, p1.radiusY), p1.rotationAngle, p1.force);
+ RefPtrWillBeRawPtr<Touch> touch0 = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), p0.pointerId, p0.screenPosition, p0.position, FloatSize(p0.width, p0.height), p0.rotationAngle, p0.pressure);
+ RefPtrWillBeRawPtr<Touch> touch1 = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), p1.pointerId, p1.screenPosition, p1.position, FloatSize(p1.width, p1.height), p1.rotationAngle, p1.pressure);
// Test touchstart.
{
@@ -136,10 +136,10 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
EXPECT_FLOAT_EQ(p0.screenPosition.y, webTouchBuilder.touches[0].screenPosition.y);
EXPECT_FLOAT_EQ(p0.position.x, webTouchBuilder.touches[0].position.x);
EXPECT_FLOAT_EQ(p0.position.y, webTouchBuilder.touches[0].position.y);
- EXPECT_FLOAT_EQ(p0.radiusX, webTouchBuilder.touches[0].radiusX);
- EXPECT_FLOAT_EQ(p0.radiusY, webTouchBuilder.touches[0].radiusY);
+ EXPECT_FLOAT_EQ(p0.width, webTouchBuilder.touches[0].width);
+ EXPECT_FLOAT_EQ(p0.height, webTouchBuilder.touches[0].height);
EXPECT_FLOAT_EQ(p0.rotationAngle, webTouchBuilder.touches[0].rotationAngle);
- EXPECT_FLOAT_EQ(p0.force, webTouchBuilder.touches[0].force);
+ EXPECT_FLOAT_EQ(p0.pressure, webTouchBuilder.touches[0].pressure);
}
// Test touchmove.
@@ -156,8 +156,8 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
EXPECT_EQ(WebInputEvent::TouchMove, webTouchBuilder.type);
EXPECT_EQ(WebTouchPoint::StateMoved, webTouchBuilder.touches[0].state);
EXPECT_EQ(WebTouchPoint::StateStationary, webTouchBuilder.touches[1].state);
- EXPECT_EQ(p0.id, webTouchBuilder.touches[0].id);
- EXPECT_EQ(p1.id, webTouchBuilder.touches[1].id);
+ EXPECT_EQ(p0.pointerId, webTouchBuilder.touches[0].pointerId);
+ EXPECT_EQ(p1.pointerId, webTouchBuilder.touches[1].pointerId);
}
// Test touchmove, different point yields same ordering.
@@ -174,8 +174,8 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
EXPECT_EQ(WebInputEvent::TouchMove, webTouchBuilder.type);
EXPECT_EQ(WebTouchPoint::StateStationary, webTouchBuilder.touches[0].state);
EXPECT_EQ(WebTouchPoint::StateMoved, webTouchBuilder.touches[1].state);
- EXPECT_EQ(p0.id, webTouchBuilder.touches[0].id);
- EXPECT_EQ(p1.id, webTouchBuilder.touches[1].id);
+ EXPECT_EQ(p0.pointerId, webTouchBuilder.touches[0].pointerId);
+ EXPECT_EQ(p1.pointerId, webTouchBuilder.touches[1].pointerId);
}
// Test touchend.
@@ -191,8 +191,8 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
EXPECT_EQ(WebInputEvent::TouchEnd, webTouchBuilder.type);
EXPECT_EQ(WebTouchPoint::StateStationary, webTouchBuilder.touches[0].state);
EXPECT_EQ(WebTouchPoint::StateReleased, webTouchBuilder.touches[1].state);
- EXPECT_EQ(p0.id, webTouchBuilder.touches[0].id);
- EXPECT_EQ(p1.id, webTouchBuilder.touches[1].id);
+ EXPECT_EQ(p0.pointerId, webTouchBuilder.touches[0].pointerId);
+ EXPECT_EQ(p1.pointerId, webTouchBuilder.touches[1].pointerId);
}
// Test touchcancel.
@@ -208,8 +208,8 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
EXPECT_EQ(WebInputEvent::TouchCancel, webTouchBuilder.type);
EXPECT_EQ(WebTouchPoint::StateCancelled, webTouchBuilder.touches[0].state);
EXPECT_EQ(WebTouchPoint::StateCancelled, webTouchBuilder.touches[1].state);
- EXPECT_EQ(p0.id, webTouchBuilder.touches[0].id);
- EXPECT_EQ(p1.id, webTouchBuilder.touches[1].id);
+ EXPECT_EQ(p0.pointerId, webTouchBuilder.touches[0].pointerId);
+ EXPECT_EQ(p1.pointerId, webTouchBuilder.touches[1].pointerId);
}
// Test max point limit.
@@ -217,7 +217,7 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
RefPtrWillBeRawPtr<TouchList> touchList = TouchList::create();
RefPtrWillBeRawPtr<TouchList> changedTouchList = TouchList::create();
for (int i = 0; i <= static_cast<int>(WebTouchEvent::touchesLengthCap) * 2; ++i) {
- RefPtrWillBeRawPtr<Touch> touch = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), i, p0.screenPosition, p0.position, FloatSize(p0.radiusX, p0.radiusY), p0.rotationAngle, p0.force);
+ RefPtrWillBeRawPtr<Touch> touch = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), i, p0.screenPosition, p0.position, FloatSize(p0.width, p0.height), p0.rotationAngle, p0.pressure);
touchList->append(touch);
changedTouchList->append(touch);
}
@@ -390,15 +390,15 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
webTouchEvent.touches[0].screenPosition.y = 10.4f;
webTouchEvent.touches[0].position.x = 10.6f;
webTouchEvent.touches[0].position.y = 10.4f;
- webTouchEvent.touches[0].radiusX = 10.6f;
- webTouchEvent.touches[0].radiusY = 10.4f;
+ webTouchEvent.touches[0].width = 10.6f;
+ webTouchEvent.touches[0].height = 10.4f;
EXPECT_FLOAT_EQ(10.6f, webTouchEvent.touches[0].screenPosition.x);
EXPECT_FLOAT_EQ(10.4f, webTouchEvent.touches[0].screenPosition.y);
EXPECT_FLOAT_EQ(10.6f, webTouchEvent.touches[0].position.x);
EXPECT_FLOAT_EQ(10.4f, webTouchEvent.touches[0].position.y);
- EXPECT_FLOAT_EQ(10.6f, webTouchEvent.touches[0].radiusX);
- EXPECT_FLOAT_EQ(10.4f, webTouchEvent.touches[0].radiusY);
+ EXPECT_FLOAT_EQ(10.6f, webTouchEvent.touches[0].width);
+ EXPECT_FLOAT_EQ(10.4f, webTouchEvent.touches[0].height);
PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent);
EXPECT_FLOAT_EQ(10.6f, platformTouchBuilder.touchPoints()[0].screenPos().x());
@@ -467,8 +467,8 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
EXPECT_FLOAT_EQ(9.5, webTouchBuilder.touches[0].screenPosition.y);
EXPECT_FLOAT_EQ(3.5, webTouchBuilder.touches[0].position.x);
EXPECT_FLOAT_EQ(2, webTouchBuilder.touches[0].position.y);
- EXPECT_FLOAT_EQ(4, webTouchBuilder.touches[0].radiusX);
- EXPECT_FLOAT_EQ(4.5, webTouchBuilder.touches[0].radiusY);
+ EXPECT_FLOAT_EQ(4, webTouchBuilder.touches[0].width);
+ EXPECT_FLOAT_EQ(4.5, webTouchBuilder.touches[0].height);
EXPECT_FALSE(webTouchBuilder.cancelable);
}
}
@@ -607,8 +607,8 @@ TEST(WebInputEventConversionTest, InputEventsTransform)
webTouchEvent.touches[0].screenPosition.y = 110;
webTouchEvent.touches[0].position.x = 100;
webTouchEvent.touches[0].position.y = 110;
- webTouchEvent.touches[0].radiusX = 30;
- webTouchEvent.touches[0].radiusY = 30;
+ webTouchEvent.touches[0].width = 30;
+ webTouchEvent.touches[0].height = 30;
PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent);
EXPECT_FLOAT_EQ(100, platformTouchBuilder.touchPoints()[0].screenPos().x());
« no previous file with comments | « Source/web/tests/TouchActionTest.cpp ('k') | public/web/WebInputEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698