Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005'

This commit is contained in:
WPT Sync Bot
2022-11-10 01:22:36 +00:00
parent ace9b32b1c
commit df68c4e5d1
15632 changed files with 514865 additions and 155000 deletions

View File

@@ -3,6 +3,8 @@
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="/common/utils.js"></script>
<script src="resources/utils.js"></script>
<body>
<script>
@@ -10,32 +12,23 @@
setup(() => assertSpeculationRulesIsSupported());
promise_test(async t => {
const bc = new BroadcastChannel('prerender-channel');
const gotMessage = new Promise(resolve => {
bc.addEventListener('message', e => {
resolve(e.data);
}, {
once: true
});
});
const cacheName = 'checkallowed';
const cacheName = token();
const cache = await caches.open(cacheName);
await cache.add('resources/cache.txt');
t.add_cleanup(() => caches.delete(cacheName));
const response = await cache.match('resources/cache.txt');
const cacheText = await (response ? response.text() : 'primary cache match failed');
// Start prerendering a page that attempts to access cache storage.
startPrerendering(`resources/cache-storage-access.https.html`);
const result = await gotMessage;
const {exec} = await create_prerendered_page(t);
const result = await exec(async cacheName => {
const cache = await caches.open(cacheName);
const match = await cache.match('cache.txt');
return await match.text();
}, [cacheName]);
assert_equals(
result, cacheText,
'prerendering page should be able to read from cache storage.');
await caches.delete(cacheName);
bc.close();
}, 'prerendering page should be able to access cache storage')
</script>