Commit 32690e80 authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

Revert "Use promise in wpt pointer event tests to finish the tests"

This reverts commit 42f777c7.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Use promise in wpt pointer event tests to finish the tests
> 
> Instead of adding a variable to check if the test is finished, we can
> create a promise object and finish the test at its last callback.
> 
> Bug: 606367
> Change-Id: Iabf281a1fffca85630683e79436a8b442057b824
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1618002
> Commit-Queue: Lan Wei <lanwei@chromium.org>
> Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#663936}

TBR=lanwei@chromium.org,nzolghadr@chromium.org

Change-Id: Ic907a109cc3c377347b80882318c95e05f2b2389
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 606367
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1631364Reviewed-by: default avatarLan Wei <lanwei@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664001}
parent f2947270
......@@ -92,7 +92,7 @@
function run() {
var target0 = document.getElementById("target0");
var btnComplete = document.getElementById("btnComplete");
var actions_promise;
var clickIsReceived = false;
// Check if touch-action attribute works properly for embedded divs
// Scrollable-Parent, Child: `auto`, Grand-Child: `none`
......@@ -103,11 +103,7 @@
assert_equals(target0.scrollLeft, 0, "scroll x offset should be 0 in the end of the test");
assert_equals(target0.scrollTop, 0, "scroll y offset should be 0 in the end of the test");
});
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
clickIsReceived = true;
updateDescriptionComplete();
});
......@@ -116,11 +112,15 @@
});
// Inject touch inputs.
actions_promise = touchScrollInTarget(scrollTarget, 'down');
actions_promise.then(function() {
touchScrollInTarget(scrollTarget, 'right');
touchScrollInTarget(scrollTarget, 'down').then(function() {
return touchScrollInTarget(scrollTarget, 'right');
}).then(function() {
return clickInTarget("touch", btnComplete);
}).then(function() {
clickInTarget("touch", btnComplete);
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
}, "click should be received before the test finishes");
test_touchaction.done();
});
}
</script>
......
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