Commit 01d571da authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

Rename touch tap function in pointerevent_support.js

In order to run the web-platform-tests automatically, we will use
testdriver Action API in all the wpt to simulate inputs.

pointerevent_support.js keeps many commonly used functions in the
pointer event tests. There are click function for all input types,
touch, mouse and pen. So I make the current touch tap function to a
general "clickInTarget" function for all inputs.

Bug: 606367
Change-Id: I8da3e8910c6ec0128a40d38ce6ac21bf24c449a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1604328Reviewed-by: default avatarNavid Zolghadr <nzolghadr@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658669}
parent 7a07ae38
......@@ -56,7 +56,7 @@
// Inject touch inputs.
pointerDragInTarget("touch", target, 'right').then(function() {
return touchTapInTarget(button);
return clickInTarget("touch", button);
}).then(function() {
test_pointer_event.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
......@@ -286,9 +286,10 @@ function touchScrollInTarget(target, direction) {
.send();
}
function touchTapInTarget(target) {
function clickInTarget(pointerType, target) {
var pointerId = pointerType + "Pointer1";
return new test_driver.Actions()
.addPointer("pointer1", "touch")
.addPointer(pointerId, pointerType)
.pointerMove(0, 0, {origin: target})
.pointerDown()
.pointerUp()
......
......@@ -115,7 +115,7 @@
touchScrollInTarget(scrollTarget, 'down').then(function() {
return touchScrollInTarget(scrollTarget, 'right');
}).then(function() {
return touchTapInTarget(btnComplete);
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
......@@ -110,7 +110,7 @@
touchScrollInTarget(scrollTarget, 'down').then(function() {
return touchScrollInTarget(scrollTarget, 'right');
}).then(function() {
return touchTapInTarget(btnComplete);
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
......@@ -110,7 +110,7 @@
touchScrollInTarget(scrollTarget, 'down').then(function() {
return touchScrollInTarget(scrollTarget, 'right');
}).then(function() {
return touchTapInTarget(btnComplete);
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
......@@ -115,7 +115,7 @@
touchScrollInTarget(scrollTarget, 'down').then(function() {
return touchScrollInTarget(scrollTarget, 'right');
}).then(function() {
return touchTapInTarget(btnComplete);
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
......@@ -110,7 +110,7 @@
touchScrollInTarget(scrollTarget, 'down').then(function() {
return touchScrollInTarget(scrollTarget, 'right');
}).then(function() {
return touchTapInTarget(btnComplete);
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
......@@ -109,7 +109,7 @@
touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
return touchTapInTarget(btnComplete);
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
......@@ -104,7 +104,7 @@
touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
return touchTapInTarget(btnComplete);
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
......@@ -109,7 +109,7 @@
touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
return touchTapInTarget(btnComplete);
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
......@@ -105,7 +105,7 @@
touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
return touchTapInTarget(btnComplete);
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment