From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../tests/longtask-timing/buffered-flag.window.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 testing/web-platform/tests/longtask-timing/buffered-flag.window.js (limited to 'testing/web-platform/tests/longtask-timing/buffered-flag.window.js') diff --git a/testing/web-platform/tests/longtask-timing/buffered-flag.window.js b/testing/web-platform/tests/longtask-timing/buffered-flag.window.js new file mode 100644 index 0000000000..a0ba728ed2 --- /dev/null +++ b/testing/web-platform/tests/longtask-timing/buffered-flag.window.js @@ -0,0 +1,26 @@ +// META: script=resources/utils.js + +async_test(t => { + assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.'); + new PerformanceObserver(t.step_func((entryList, obs) => { + const observer = new PerformanceObserver(t.step_func_done(list => { + let longtaskObserved = false; + list.getEntries().forEach(entry => { + if (entry.entryType === 'mark') + return; + checkLongTaskEntry(entry); + longtaskObserved = true; + }); + assert_true(longtaskObserved, 'Did not observe buffered longtask.'); + })); + observer.observe({type: 'longtask', buffered: true}); + // Observer mark so that we can flush the observer callback. + observer.observe({type: 'mark'}); + performance.mark('m'); + // Disconnect the embedding observer so this callback only runs once. + obs.disconnect(); + })).observe({entryTypes: ['longtask']}); + // Create a long task. + const begin = window.performance.now(); + while (window.performance.now() < begin + 60); +}, 'PerformanceObserver with buffered flag can see previous longtask entries.'); -- cgit v1.2.3