Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html>
<meta charset=utf-8 />
<title>Event Timing: Keyboard event simulated click</title>
<meta charset=utf-8 />
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script src=resources/event-timing-test-utils.js></script>
<button id='button'>Click me.</button>
<script>
promise_test(async t => {
let map = new Map();
const button = document.getElementById('button');
const callback = (entryList) => { entryList.getEntries().filter(filterAndAddToMap(['keydown','click'], map)); };
const readyToResolve = () => { return map.has('keydown') && map.has('click'); };
const observerPromise = createPerformanceObserverPromise(['event'], callback, readyToResolve);
await interactAndObserve('space-key-simulated-click', button, observerPromise);
assert_equals(map.get('click'), map.get('keydown'),
'Click event should have the same interaction id as the keydown event.');
}, 'Click event triggered by space key in checkbox should have the same\
interaction id as that of the associated keyboard events.');
</script>