summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/http-cache/resources/split-cache-popup.html
blob: edb579479414fe980782b54fd39305c12b3de9e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>HTTP Cache - helper</title>
  <meta name="help" href="https://fetch.spec.whatwg.org/#http-cache-partitions">
  <meta name="timeout" content="normal">
  <script src="/resources/testharness.js"></script>
  <script src="../http-cache.js"></script>
</head>
<body>
<script>
   window.addEventListener("message", function listener(event) {
      window.removeEventListener("message", listener)

      var fetchFunction = makeFetchFunctions(event.data.requests, event.data.uuid)[event.data.index]
      fetchFunction.code(event.data.index).then(
         function(response) {
            event.source.postMessage("success", event.origin)
         },
         function(response) {
            event.source.postMessage("error", event.origin)
         }
      )
   })
</script>
</body>
</html>