diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/event-timing/interactionid-press-key-as-input.html | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/event-timing/interactionid-press-key-as-input.html')
-rw-r--r-- | testing/web-platform/tests/event-timing/interactionid-press-key-as-input.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/testing/web-platform/tests/event-timing/interactionid-press-key-as-input.html b/testing/web-platform/tests/event-timing/interactionid-press-key-as-input.html new file mode 100644 index 0000000000..b1e725b5c6 --- /dev/null +++ b/testing/web-platform/tests/event-timing/interactionid-press-key-as-input.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> +<meta charset=utf-8 /> +<meta name="timeout" content="long"> +<title>Event Timing: interactionId-press-key-as-input.</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', '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'); + 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 key press as input."); +</script> + +</html>
\ No newline at end of file |