Bug 1638110 [wpt PR 23609] - De-flaky some pointerevents wpt tests - Part 2, a=testonly

Automatic update from web-platform-tests
De-flaky some pointerevents wpt tests - Part 2

Because of Linux memory leak, pointerevent wpt tests
pointerevent_pointerleave_does_not_bubble.html,
pointerevent_pointerout_received_once.html and
pointerevent_setpointercapture_disconnected.html are flaky, we
should finish the test in the actions promise's callback to guarantee
the actions are all executed before the test finishes to avoid memory
leak.

Bug: 998948
Change-Id: I8e94ef1f2aba426c7ce58deed096c9ec56b10f80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2198685
Commit-Queue: Lan Wei <lanwei@chromium.org>
Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#769431}

--

wpt-commits: 03e2258e2a76ff3f8269f83c601aec770c437853
wpt-pr: 23609
This commit is contained in:
Lan Wei 2020-05-21 10:23:17 +00:00 коммит произвёл moz-wptsync-bot
Родитель e2064b887a
Коммит 82eba5c29f
3 изменённых файлов: 17 добавлений и 6 удалений

Просмотреть файл

@ -17,6 +17,7 @@
<script type="text/javascript"> <script type="text/javascript">
var detected_pointertypes = {}; var detected_pointertypes = {};
var test_pointerEvent = async_test("pointerLeave event does not bubble"); // set up test harness var test_pointerEvent = async_test("pointerLeave event does not bubble"); // set up test harness
var actions_promise;
// showPointerTypes is defined in pointerevent_support.js // showPointerTypes is defined in pointerevent_support.js
// Requirements: the callback function will reference the test_pointerEvent object and // Requirements: the callback function will reference the test_pointerEvent object and
// will fail unless the async_test is created with the var name "test_pointerEvent". // will fail unless the async_test is created with the var name "test_pointerEvent".
@ -39,11 +40,14 @@
test_pointerEvent.step(function () { test_pointerEvent.step(function () {
assert_equals(event.target.id, "parent0", "Recieved " + event.type + " in parent for " + event.target.id); assert_equals(event.target.id, "parent0", "Recieved " + event.type + " in parent for " + event.target.id);
}); });
test_pointerEvent.done(); // complete test // Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_pointerEvent.done();
});
}); });
// Inject mouse inputs. // Inject mouse inputs.
new test_driver.Actions() actions_promise = new test_driver.Actions()
.pointerMove(0, 0, {origin: target0}) .pointerMove(0, 0, {origin: target0})
.pointerMove(0, 0) .pointerMove(0, 0)
.send(); .send();

Просмотреть файл

@ -26,6 +26,7 @@
<script> <script>
var pointeroutCounter = 0; var pointeroutCounter = 0;
var detected_pointertypes = {}; var detected_pointertypes = {};
var actions_promise;
setup({ explicit_done: true }); setup({ explicit_done: true });
add_completion_callback(showPointerTypes); add_completion_callback(showPointerTypes);
@ -47,12 +48,14 @@
test(function() { test(function() {
assert_true(pointeroutCounter == 1, "pointerout received just once") assert_true(pointeroutCounter == 1, "pointerout received just once")
}, "pointerout received just once"); }, "pointerout received just once");
done(); actions_promise.then( () => {
done();
});
}, 5000); }, 5000);
}); });
// Inject mouse inputs. // Inject mouse inputs.
new test_driver.Actions() actions_promise = new test_driver.Actions()
.pointerMove(0, 0, {origin: target0}) .pointerMove(0, 0, {origin: target0})
.pointerMove(0, 0) .pointerMove(0, 0)
.send(); .send();

Просмотреть файл

@ -14,6 +14,7 @@
var detected_pointertypes = {}; var detected_pointertypes = {};
add_completion_callback(showPointerTypes); add_completion_callback(showPointerTypes);
var test_setPointerCapture = async_test("setPointerCapture: DOMException InvalidStateError"); var test_setPointerCapture = async_test("setPointerCapture: DOMException InvalidStateError");
var actions_promise;
function run() { function run() {
var target0 = document.getElementById("target0"); var target0 = document.getElementById("target0");
@ -35,11 +36,14 @@
assert_equals(e.name, "InvalidStateError", "DOMException should be InvalidStateError"); assert_equals(e.name, "InvalidStateError", "DOMException should be InvalidStateError");
}); });
} }
test_setPointerCapture.done(); // Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_setPointerCapture.done();
});
}); });
// Inject mouse inputs. // Inject mouse inputs.
new test_driver.Actions() actions_promise = new test_driver.Actions()
.pointerMove(0, 0, {origin: target0}) .pointerMove(0, 0, {origin: target0})
.pointerDown() .pointerDown()
.pointerUp() .pointerUp()