Automatic update from web-platform-tests [fetch-later] Promote fetch-later wpt tests and fix some flakiness (#54738) - The [spec][1] has been merged. Remove all `.tentative` suffixes. - Update `third_party/blink/web_tests/external/wpt/fetch/fetch-later/resources/fetch-later.html` to account for some errors like QuotaExceededError that can't be cloned back to parent frame. - Fix `third_party/blink/web_tests/external/wpt/fetch/fetch-later/quota/same-origin-iframe/multiple-iframes.https.window.js` and remove its expectation. - `third_party/blink/web_tests/external/wpt/fetch/fetch-later/new-window.https.window.js` is still flaky. Will address it in another CL. [1]: https://github.com/whatwg/fetch/pull/1647 Bug: 434895695,434980772 Change-Id: Icb0d756ada01ec209a46eab7d055eb16c5b78a83 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6887785 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Ming-Ying Chung <mych@chromium.org> Reviewed-by: Tsuyoshi Horo <horo@chromium.org> Cr-Commit-Position: refs/heads/main@{#1512252} Co-authored-by: Ming-Ying Chung <mych@chromium.org> -- wpt-commits: 89966dffac4f95ade6d83c107fed3983251db1fc wpt-pr: 54738
32 lines
843 B
JavaScript
32 lines
843 B
JavaScript
// META: script=/common/utils.js
|
|
// META: script=/common/get-host-info.sub.js
|
|
// META: script=/fetch/fetch-later/resources/fetch-later-helper.js
|
|
|
|
'use strict';
|
|
|
|
const {
|
|
HTTPS_ORIGIN,
|
|
HTTPS_NOTSAMESITE_ORIGIN,
|
|
} = get_host_info();
|
|
|
|
async function loadElement(el) {
|
|
const loaded = new Promise(resolve => el.onload = resolve);
|
|
document.body.appendChild(el);
|
|
await loaded;
|
|
}
|
|
|
|
parallelPromiseTest(async t => {
|
|
const uuid = token();
|
|
const url = generateSetBeaconURL(uuid);
|
|
|
|
// Loads a blank iframe that fires a fetchLater request.
|
|
const iframe = document.createElement('iframe');
|
|
iframe.addEventListener('load', () => {
|
|
fetchLater(url, {activateAfter: 0});
|
|
});
|
|
await loadElement(iframe);
|
|
|
|
// The iframe should have sent the request.
|
|
await expectBeacon(uuid, {count: 1});
|
|
}, 'A blank iframe can trigger fetchLater.');
|