summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/cache-storage/crashtests/cache-response-clone.https.html
blob: ec930a87d934c4b232d42c9d411457a1776e86ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!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>