Skip to content

Commit

Permalink
Bug 1819854 [wpt PR 38783] - Unflake loaf test, a=testonly
Browse files Browse the repository at this point in the history
Automatic update from web-platform-tests
Unflake loaf test

- loaf-buffered test: don't assume that the first LoAF entry is
the one we injected.

Bug: 1420756
Change-Id: Id9ba50d0b24b3cfa42c21f01fb45a5c808700352
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4302731
Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1112110}

--

wpt-commits: a84d334b31f3a59020be7ee164e504ab0c44f7e6
wpt-pr: 38783
  • Loading branch information
noamr authored and moz-wptsync-bot committed Mar 7, 2023
1 parent fa312f8 commit 0e1d270
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ <h1>Long Animation Frame: buffered</h1>
promise_test(async t => {
busy_wait(very_long_frame_duration);
await new Promise(resolve => t.step_timeout(resolve, 0));
const entry = await new Promise(resolve => {
new PerformanceObserver(t.step_func((entryList) => {
const entry = entryList.getEntries()[0];
if (entry.duration >= very_long_frame_duration)
resolve(entry);
const result = await new Promise(resolve => {
new PerformanceObserver(t.step_func(entries => {
for (const e of entries.getEntries()) {
if (e.duration >= very_long_frame_duration)
resolve("entry-found");
}
})).observe({type: 'long-animation-frame', buffered: true});
t.step_timeout(() => resolve("timeout"), no_long_frame_timeout);
});
assert_equals(result, "entry-found");
}, 'PerformanceObserver with buffered flag can see previous long-animation-frame entries.');
</script>
</body>

0 comments on commit 0e1d270

Please sign in to comment.