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

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

Issue 1888163003: Articulate the cancel behavior in the WebTouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 df3e75ef111bd790549160abe2667d6fb303cc4b..43cf562a9f000b3041ed878cb426892f9275dda4 100644
--- a/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
@@ -139,8 +139,20 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
EXPECT_FLOAT_EQ(p0.radiusY, webTouchBuilder.touches[0].radiusY);
EXPECT_FLOAT_EQ(p0.rotationAngle, webTouchBuilder.touches[0].rotationAngle);
EXPECT_FLOAT_EQ(p0.force, webTouchBuilder.touches[0].force);
+ EXPECT_EQ(WebInputEvent::NonBlocking, webTouchBuilder.dispatchType);
}
+ // Test cancelable touchstart.
+ {
+ TouchList* touchList = TouchList::create();
+ touchList->append(touch0);
+ TouchEvent* touchEvent = TouchEvent::create(touchList, touchList, touchList, EventTypeNames::touchstart, domWindow, PlatformEvent::NoModifiers, true, false, 0);
+
+ WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent);
+ EXPECT_EQ(WebInputEvent::Blocking, webTouchBuilder.dispatchType);
+ }
+
+
// Test touchmove.
{
TouchList* activeTouchList = TouchList::create();
@@ -157,6 +169,7 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
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(WebInputEvent::NonBlocking, webTouchBuilder.dispatchType);
}
// Test touchmove, different point yields same ordering.
@@ -175,6 +188,7 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
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(WebInputEvent::NonBlocking, webTouchBuilder.dispatchType);
}
// Test touchend.
@@ -192,6 +206,7 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
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(WebInputEvent::NonBlocking, webTouchBuilder.dispatchType);
}
// Test touchcancel.
@@ -209,6 +224,7 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
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(WebInputEvent::NonBlocking, webTouchBuilder.dispatchType);
}
// Test max point limit.
@@ -477,7 +493,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
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_FALSE(webTouchBuilder.cancelable);
+ EXPECT_EQ(WebInputEvent::NonBlocking, webTouchBuilder.dispatchType);
}
}

Powered by Google App Engine
This is Rietveld 408576698