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 --- .../long-animation-frame/tentative/loaf-basic.html | 57 +++++++++ .../tentative/loaf-blocking-duration.html | 64 ++++++++++ .../tentative/loaf-buffered.html | 28 +++++ .../tentative/loaf-desired-exec-time.html | 121 +++++++++++++++++++ .../tentative/loaf-event-listener.html | 44 +++++++ .../tentative/loaf-first-ui-event.html | 101 ++++++++++++++++ .../long-animation-frame/tentative/loaf-idle.html | 36 ++++++ .../tentative/loaf-iframe-popup.html | 65 ++++++++++ .../tentative/loaf-pause-duration.html | 30 +++++ .../tentative/loaf-promise.html | 52 ++++++++ .../tentative/loaf-script-block.html | 50 ++++++++ .../tentative/loaf-script-window-attribution.html | 76 ++++++++++++ .../tentative/loaf-source-location.html | 43 +++++++ .../tentative/loaf-supportedEntryTypes.html | 22 ++++ .../tentative/loaf-timeline.html | 27 +++++ .../tentative/loaf-toJSON.html | 46 ++++++++ .../tentative/loaf-user-callback.html | 56 +++++++++ .../tentative/loaf-visibility.html | 26 ++++ .../tentative/loaf-window-only.worker.js | 11 ++ .../tentative/resources/busy.js | 4 + .../tentative/resources/utils.js | 131 +++++++++++++++++++++ 21 files changed, 1090 insertions(+) create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-basic.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-blocking-duration.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-buffered.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-desired-exec-time.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-event-listener.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-first-ui-event.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-idle.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-iframe-popup.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-pause-duration.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-promise.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-script-block.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-script-window-attribution.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-source-location.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-supportedEntryTypes.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-timeline.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-toJSON.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-user-callback.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-visibility.html create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/loaf-window-only.worker.js create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/resources/busy.js create mode 100644 testing/web-platform/tests/long-animation-frame/tentative/resources/utils.js (limited to 'testing/web-platform/tests/long-animation-frame/tentative') diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-basic.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-basic.html new file mode 100644 index 0000000000..c6d3f8e32a --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-basic.html @@ -0,0 +1,57 @@ + + +Long Animation Frame Timing: basic + + + + + + +

Long Animation Frame: basic

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-blocking-duration.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-blocking-duration.html new file mode 100644 index 0000000000..1671a386ac --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-blocking-duration.html @@ -0,0 +1,64 @@ + + +Long Animation Frame Timing: basic + + + + + +

Long Animation Frame: blocking duration

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-buffered.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-buffered.html new file mode 100644 index 0000000000..1a07036b15 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-buffered.html @@ -0,0 +1,28 @@ + + +Long Animation Frame Timing: basic + + + + + + +

Long Animation Frame: buffered

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-desired-exec-time.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-desired-exec-time.html new file mode 100644 index 0000000000..dd350078b6 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-desired-exec-time.html @@ -0,0 +1,121 @@ + + +Long Animation Frame Timing: queue time + + + + + + + + + +

Long Animation Frame: queue time

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-event-listener.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-event-listener.html new file mode 100644 index 0000000000..f866a1dfd8 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-event-listener.html @@ -0,0 +1,44 @@ + + +Long Animation Frame Timing: basic + + + + + + +

Long Animation Frame: event handlers

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-first-ui-event.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-first-ui-event.html new file mode 100644 index 0000000000..47a3a51de2 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-first-ui-event.html @@ -0,0 +1,101 @@ + + +Long Animation Frame Timing: first UI Event + + + + + + + + + +

Long Animation Frame: First UI Event

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-idle.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-idle.html new file mode 100644 index 0000000000..bc9f910bb1 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-idle.html @@ -0,0 +1,36 @@ + + +Long Animation Frame Timing: requestIdleCallback + + + + + + +

Long Animation Frame: requestIdleCallback

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-iframe-popup.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-iframe-popup.html new file mode 100644 index 0000000000..565273b6c6 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-iframe-popup.html @@ -0,0 +1,65 @@ + + +Long Animation Frame Timing: iframes & popups + + + + + + + + +
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-pause-duration.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-pause-duration.html new file mode 100644 index 0000000000..6894164fbf --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-pause-duration.html @@ -0,0 +1,30 @@ + + +Long Animation Frame Timing: pause + + + + + + +

Long Animation Frame: pause

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-promise.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-promise.html new file mode 100644 index 0000000000..5ead569c8a --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-promise.html @@ -0,0 +1,52 @@ + + +Long Animation Frame Timing: promise resolvers + + + + + + + +

Long Animation Frame: promise resolvers

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-script-block.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-script-block.html new file mode 100644 index 0000000000..866eea09e0 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-script-block.html @@ -0,0 +1,50 @@ + + +Long Animation Frame Timing: basic + + + + + + + +

Long Animation Frame: script blocks

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-script-window-attribution.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-script-window-attribution.html new file mode 100644 index 0000000000..f54a1f23cb --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-script-window-attribution.html @@ -0,0 +1,76 @@ + + + +Long Animation Frame Timing: window attribution + + + + + + + + +
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-source-location.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-source-location.html new file mode 100644 index 0000000000..ffda000207 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-source-location.html @@ -0,0 +1,43 @@ + + +Long Animation Frame Timing: source location extraction + + + + + + +

Long Animation Frame: source location extraction

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-supportedEntryTypes.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-supportedEntryTypes.html new file mode 100644 index 0000000000..efa01481fa --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-supportedEntryTypes.html @@ -0,0 +1,22 @@ + + +Long Animation Frame Timing: supportedEntryTypes + + + + + +

Long Animation Frame: supportedEntryTypes

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-timeline.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-timeline.html new file mode 100644 index 0000000000..c434a26ef8 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-timeline.html @@ -0,0 +1,27 @@ + + +Long Animation Frame Timing: basic + + + + + + +

Long Animation Frame: basic

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-toJSON.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-toJSON.html new file mode 100644 index 0000000000..5b249e6972 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-toJSON.html @@ -0,0 +1,46 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-user-callback.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-user-callback.html new file mode 100644 index 0000000000..3d868af87f --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-user-callback.html @@ -0,0 +1,56 @@ + + +Long Animation Frame Timing: basic + + + + + + +

Long Animation Frame: user callbacks

+
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-visibility.html b/testing/web-platform/tests/long-animation-frame/tentative/loaf-visibility.html new file mode 100644 index 0000000000..97038e3073 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-visibility.html @@ -0,0 +1,26 @@ + + + +Long Animation Frame Timing: iframes + + + + + + + + + +
+ + diff --git a/testing/web-platform/tests/long-animation-frame/tentative/loaf-window-only.worker.js b/testing/web-platform/tests/long-animation-frame/tentative/loaf-window-only.worker.js new file mode 100644 index 0000000000..c1f0439c4b --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/loaf-window-only.worker.js @@ -0,0 +1,11 @@ +importScripts("/resources/testharness.js"); + +test(() => { + assert_false(PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")); +}, 'PerformanceObserver should not include "long-animation-frame" in workers'); + +test(() => { + assert_false("PerformanceLongAnimationFrameTiming" in self); +}, 'PerformanceLongAnimationFrameTiming should not be exposed in workers'); + +done(); diff --git a/testing/web-platform/tests/long-animation-frame/tentative/resources/busy.js b/testing/web-platform/tests/long-animation-frame/tentative/resources/busy.js new file mode 100644 index 0000000000..9d761b6de5 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/resources/busy.js @@ -0,0 +1,4 @@ +(() => { + const deadline = performance.now() + 360; + while (performance.now() < deadline) {} +})(); diff --git a/testing/web-platform/tests/long-animation-frame/tentative/resources/utils.js b/testing/web-platform/tests/long-animation-frame/tentative/resources/utils.js new file mode 100644 index 0000000000..8781252e94 --- /dev/null +++ b/testing/web-platform/tests/long-animation-frame/tentative/resources/utils.js @@ -0,0 +1,131 @@ +const windowLoaded = new Promise(resolve => window.addEventListener('load', resolve)); +setup(() => + assert_implements(window.PerformanceLongAnimationFrameTiming, + 'Long animation frames are not supported.')); + +const very_long_frame_duration = 360; +const no_long_frame_timeout = very_long_frame_duration * 3; +const waiting_for_long_frame_timeout = very_long_frame_duration * 10; + +function loaf_promise(t) { + return new Promise(resolve => { + const observer = new PerformanceObserver(entries => { + const entry = entries.getEntries()[0]; + // TODO: understand why we need this 5ms epsilon. + if (entry.duration > very_long_frame_duration - 5) { + observer.disconnect(); + resolve(entry); + } + }); + + t.add_cleanup(() => observer.disconnect()); + + observer.observe({entryTypes: ['long-animation-frame']}); + }); +} + +function busy_wait(ms_delay = very_long_frame_duration) { + const deadline = performance.now() + ms_delay; + while (performance.now() < deadline) {} +} + +async function expect_long_frame(cb, t) { + await windowLoaded; + await new Promise(resolve => t.step_timeout(resolve, 0)); + const timeout = new Promise((resolve, reject) => + t.step_timeout(() => resolve("timeout"), waiting_for_long_frame_timeout)); + const receivedLongFrame = loaf_promise(t); + await cb(t); + const entry = await Promise.race([ + receivedLongFrame, + timeout + ]); + return entry; +} + +async function expect_long_frame_with_script(cb, predicate, t) { + for (let i = 0; i < 10; ++i) { + const entry = await expect_long_frame(cb, t); + if (entry === "timeout" || !entry.scripts.length) + continue; + for (const script of entry.scripts) { + if (predicate(script)) + return [entry, script]; + } + } + + return []; +} + +async function expect_no_long_frame(cb, t) { + await windowLoaded; + for (let i = 0; i < 5; ++i) { + const receivedLongFrame = loaf_promise(t); + await cb(); + const result = await Promise.race([receivedLongFrame, + new Promise(resolve => t.step_timeout(() => resolve("timeout"), + no_long_frame_timeout))]); + if (result === "timeout") + return false; + } + + throw new Error("Consistently creates long frame"); +} + +async function prepare_exec_iframe(t, origin) { + const iframe = document.createElement("iframe"); + t.add_cleanup(() => iframe.remove()); + const url = new URL("/common/dispatcher/remote-executor.html", origin); + const uuid = token(); + url.searchParams.set("uuid", uuid); + iframe.src = url.href; + document.body.appendChild(iframe); + await new Promise(resolve => iframe.addEventListener("load", resolve)); + return [new RemoteContext(uuid), iframe]; +} + + +async function prepare_exec_popup(t, origin) { + const url = new URL("/common/dispatcher/remote-executor.html", origin); + const uuid = token(); + url.searchParams.set("uuid", uuid); + const popup = window.open(url); + t.add_cleanup(() => popup.close()); + return [new RemoteContext(uuid), popup]; +} +function test_loaf_script(cb, name, type, label) { + promise_test(async t => { + let [entry, script] = []; + [entry, script] = await expect_long_frame_with_script(cb, + script => ( + script.type === type && + script.name.startsWith(name) && + script.duration >= very_long_frame_duration), t); + + assert_true(!!entry, "Entry detected"); + assert_greater_than_equal(script.duration, very_long_frame_duration); + assert_greater_than_equal(entry.duration, script.duration); + assert_greater_than_equal(script.executionStart, script.startTime); + assert_greater_than_equal(script.startTime, entry.startTime) + assert_equals(script.window, window); + assert_equals(script.forcedStyleAndLayoutDuration, 0); + assert_equals(script.windowAttribution, "self"); +}, `LoAF script: ${name} ${type},${label ? ` ${label}` : ''}`); + +} + +function test_self_user_callback(cb, name, label) { + test_loaf_script(cb, name, "user-callback", label); +} + +function test_self_event_listener(cb, name) { + test_loaf_script(cb, name, "event-listener"); +} + +function test_promise_script(cb, resolve_or_reject, name, label) { + test_loaf_script(cb, name, `${resolve_or_reject}-promise`, label); +} + +function test_self_script_block(cb, name, type) { + test_loaf_script(cb, name, type); +} -- cgit v1.2.3