diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /testing/web-platform/tests/event-timing/interactionid-keypress.html | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/event-timing/interactionid-keypress.html')
-rw-r--r-- | testing/web-platform/tests/event-timing/interactionid-keypress.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/web-platform/tests/event-timing/interactionid-keypress.html b/testing/web-platform/tests/event-timing/interactionid-keypress.html new file mode 100644 index 0000000000..a6f2009967 --- /dev/null +++ b/testing/web-platform/tests/event-timing/interactionid-keypress.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html> +<meta charset=utf-8 /> +<meta name="timeout" content="long"> +<title>Event Timing: interactionId-keypress.</title> +<textarea id='test'></textarea> +<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> + +<script> + let observedEntries = []; + let map = new Map(); + const events = ['keydown','keypress','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 < 3) + return; + assert_greater_than(map.get('keypress'), 0, 'Should have a non-trivial interactionId'); + assert_equals(map.get('keydown'), map.get('keypress'), 'The keydown and the keypress should have the same interactionId'); + assert_equals(map.get('keyup'), map.get('keypress'), 'The keyup and the keypress should have the same interactionId'); + assert_equals('t', document.getElementById('test').value); + t.done(); + })).observe({ type: "event" }); + + addListenersAndPress(document.getElementById('test'), 't', events); + }, "Event Timing: compare event timing interactionId for keypress."); + + +</script> + +</html>
\ No newline at end of file |