Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /service-workers/cache-storage/crashtests/cache-response-clone.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="test-wait">
<meta charset="utf-8">
<script type="module">
const cache = await window.caches.open('cache_name_0')
await cache.add("")
const resp1 = await cache.match("")
const readStream = resp1.body
// Cloning will open the stream via NS_AsyncCopy in Gecko
resp1.clone()
// Give a little bit of time
await new Promise(setTimeout)
// At this point the previous open operation is about to finish but not yet.
// It will finish after the second open operation is made, potentially causing incorrect state.
await readStream.getReader().read();
document.documentElement.classList.remove('test-wait')
</script>