Bug 1680340 [wpt PR 26724] - Simulate user inputs in pointerevent_capture_suppressing_mouse.html, a=testonly

Automatic update from web-platform-tests
Simulate user inputs in pointerevent_capture_suppressing_mouse.html

Use testdriver Action API to simulate mouse actions in
pointerevents/pointerevent_capture_suppressing_mouse.html.

Bug: 1145677
Change-Id: I329d4b814020dd3c0d22c807c36828f5e868b4cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2568825
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833510}

--

wpt-commits: 88780a69aa6ef42becab170fc1ddec9e5a61704e
wpt-pr: 26724
This commit is contained in:
Lan Wei 2020-12-04 03:55:23 +00:00 коммит произвёл moz-wptsync-bot
Родитель a94cf410aa
Коммит 48f0874da0
1 изменённых файлов: 24 добавлений и 1 удалений

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

@ -6,6 +6,9 @@
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<!-- Additional helper script for common checks across event types -->
<script type="text/javascript" src="pointerevent_support.js"></script>
</head>
@ -53,6 +56,7 @@
var test_lostpointercapture = async_test("lostpointercapture event received");
var test_pointerover_no_capture = async_test("pointerover event without capture received");
var test_pointerover_capture = async_test("pointerover event with capture received");
var test_pointerout_no_capture = async_test("pointerout event without capture received");
@ -64,6 +68,8 @@
var test_pointerleave_no_capture = async_test("pointerleave event without capture received");
var test_pointerleave_after_capture = async_test("pointerleave event after lostpointercapture received");
var actions_promise;
window.onload = function() {
on_event(captureButton, 'pointerdown', function(e) {
if(isPointerCapture == false) {
@ -147,7 +153,10 @@
}
else {
if (lostPointerCaptureReceived) {
test_pointerleave_after_capture.done();
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_pointerleave_after_capture.done();
});
} else {
test_pointerleave_no_capture.done();
}
@ -190,6 +199,20 @@
}, "pointerleave shouldn't trigger for the purple rectangle while the black rectangle has capture");
}
});
actions_promise = new test_driver.Actions()
.pointerMove(0, 0, {origin: target0})
.pointerMove(0, 0, {origin: target1})
.pointerMove(0, 0, {origin: btnCapture})
.pointerDown()
.pointerMove(0, 0, {origin: btnCapture})
.pointerMove(10, 0, {origin: btnCapture})
.pointerMove(0, 0, {origin: target1})
.pointerMove(0, 0, {origin: target0})
.pointerMove(0, 0, {origin: target1})
.pointerUp()
.pointerMove(0, 0, {origin: target1})
.send();
}
</script>
<h1>Pointer Events Capture Test</h1>