Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=267008 (#44124)

--

wpt-commits: 6309dbdfb541d31ada0ef4c775d1b06cab5d7321
wpt-pr: 44124
This commit is contained in:
Abrar Rahman Protyasha 2024-01-24 21:45:19 +00:00 коммит произвёл moz-wptsync-bot
Родитель 5bf0cdb277
Коммит 7bb4f50ad6
1 изменённых файлов: 34 добавлений и 0 удалений

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

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<title>Button value of corresponding pointerup/pointerdown are equivalent</title>
<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>
<script src="pointerevent_support.js"></script>
<input id="target" style="margin: 20px">
<script>
'use strict';
const target = document.getElementById("target");
promise_test(async test => {
const test_pointer = "testPointer";
let actions = new test_driver.Actions();
actions = actions.addPointer(test_pointer, "mouse")
.pointerMove(0,0, {sourceName:test_pointer, origin:target})
.pointerDown({sourceName:test_pointer, button:actions.ButtonType.RIGHT})
.pointerUp({sourceName:test_pointer, button:actions.ButtonType.RIGHT});
target.addEventListener("contextmenu", event => { event.preventDefault(); });
let pointerdown_promise = getEvent("pointerdown", target, test);
let pointerup_promise = getEvent("pointerup", target, test);
await actions.send();
let pointerdown_event = await pointerdown_promise;
let pointerup_event = await pointerup_promise;
assert_equals(pointerup_event.button, pointerdown_event.button, "The 'button' property of a pointerup event should match the 'button' property of the corresponding pointerdown event");
}, "Test that the 'button' property of a pointerup event matches the 'button' property of the corresponding pointerdown event");
</script>