diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/event-timing/retrievability.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/event-timing/retrievability.html')
-rw-r--r-- | testing/web-platform/tests/event-timing/retrievability.html | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/testing/web-platform/tests/event-timing/retrievability.html b/testing/web-platform/tests/event-timing/retrievability.html new file mode 100644 index 0000000000..ab475fc529 --- /dev/null +++ b/testing/web-platform/tests/event-timing/retrievability.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<meta charset=utf-8> +<title>Event Timing: make sure 'event' entries are not retrievable by performance.getEntries* APIs.</title> +<meta name="timeout" content="long"> +<button id='button'>Generate a 'click' event</button> +<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> + +<script> + function validateEntries() { + const entriesByName = performance.getEntriesByName('mousedown', 'event'); + const entriesByType = performance.getEntriesByType('event'); + const allEntries = performance.getEntries(); + assert_equals(entriesByName.length, 0, 'Event Timing entry should not be retrievable by getEntriesByName'); + assert_equals(entriesByType.length, 0, 'Event Timing entry should not be retrievable by getEntriesByType'); + assert_equals(allEntries.filter(e => e.entryType === 'event').length, 0, 'Event Timing entry should not be retrievable by getEntries'); + } + + /* Timeline: + Begin Busy Loop + Click 1 arrives + End Busy Loop + (Dispatch and Process Click 1 - buffered) + Onload Event Fires + Validate entries + */ + async_test(function(t) { + assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.'); + new PerformanceObserver(t.step_func(entryList => { + if (entryList.getEntriesByName('mousedown').length > 0) { + validateEntries(); + t.done(); + } + })).observe({entryTypes: ['event']}); + clickAndBlockMain('button'); + }, "Event Timing: make sure event-timing entries are not retrievable by performance.getEntries*."); + +</script> +</html> |