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
41 lines
1.4 KiB
HTML
41 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<head>
|
|
</head>
|
|
<body>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/fetch/fetch-later/resources/fetch-later-helper.js"></script>
|
|
<script>
|
|
const PARAMS = new URL(location.href).searchParams;
|
|
const TARGET_URL= decodeURIComponent(PARAMS.get('url')) || '';
|
|
const BODY_TYPE = PARAMS.get('bodyType');
|
|
const BODY_SIZE = PARAMS.get('bodySize');
|
|
const BODY = BODY_TYPE !== null && BODY_SIZE !== null ? makeBeaconData(generatePayload(BODY_SIZE), BODY_TYPE) : null;
|
|
const REQUEST_INIT = Object.assign({},
|
|
PARAMS.has('activateAfter') ? {activateAfter: parseInt(PARAMS.get('activateAfter'), 10)} : null,
|
|
PARAMS.has('method') ? {method: PARAMS.get('method')} : null,
|
|
PARAMS.has('referrer') ? {referrer: PARAMS.get('referrer')} : null,
|
|
BODY !== null ? {body: BODY} : null,
|
|
);
|
|
|
|
function postMessageBack(message) {
|
|
if (window.opener) {
|
|
window.opener.postMessage(message, '*');
|
|
} else {
|
|
parent.postMessage(message, '*');
|
|
}
|
|
}
|
|
|
|
try {
|
|
fetchLater(TARGET_URL, REQUEST_INIT);
|
|
postMessageBack({type: FetchLaterIframeMessageType.DONE});
|
|
} catch (e) {
|
|
postMessageBack({
|
|
type: FetchLaterIframeMessageType.ERROR,
|
|
// When an error is caught, it might not be cloneable across the boundary.
|
|
error: {name: e.name, message: e.message}
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|