diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/event-timing/interactionid-press-key-no-effect.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/event-timing/interactionid-press-key-no-effect.html')
-rw-r--r-- | testing/web-platform/tests/event-timing/interactionid-press-key-no-effect.html | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/testing/web-platform/tests/event-timing/interactionid-press-key-no-effect.html b/testing/web-platform/tests/event-timing/interactionid-press-key-no-effect.html new file mode 100644 index 0000000000..ad4dc2595c --- /dev/null +++ b/testing/web-platform/tests/event-timing/interactionid-press-key-no-effect.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html> +<meta charset=utf-8 /> +<meta name="timeout" content="long"> +<title>Event Timing: interactionId-press-key-no-effect.</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=resources/event-timing-test-utils.js></script> + +<body> + <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tempus + lacinia nisi, eget tempor orci. Nullam congue pharetra arcu, et consectetur + massa mollis tincidunt. Quisque odio sapien, viverra finibus lectus ac, + consectetur ornare quam. In hac habitasse platea dictumst. Morbi cursus est + odio, non fermentum ligula posuere vitae. Sed ullamcorper convallis rhoncus. + In condimentum neque nec metus hendrerit, et cursus ipsum aliquet. + </p> +</body> +<script> + let observedEntries = []; + let map = new Map(); + const events = ['keydown', 'keyup']; + + async_test(function (t) { + assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.'); + + new PerformanceObserver(t.step_func(entryList => { + observedEntries = observedEntries.concat(entryList.getEntries().filter(filterAndAddToMap(events, map))); + + if (observedEntries.length < 2) + return; + + events.forEach(e => assert_greater_than(map.get(e), 0, 'Should have a non-trivial interactionId for ' + e + ' event')); + assert_equals(map.get('keydown'), map.get('keyup'), 'The keydown and the keyup should have the same interactionId'); + t.done(); + })).observe({ type: "event" }); + + addListenersAndPress(document.body, 't', events); + }, "Event Timing: compare event timing interactionId for key press with no effect."); +</script>
\ No newline at end of file |