summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/infrastructure/assumptions/resources/fetch-and-post-result.html
blob: 4df0c4c71acd4a1a4025b3596a956ace8763ab25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<script>
  window.addEventListener("message", function (event) {
    fetch(event.data)
      .then(response => {
        parent.postMessage(`success: status = ${response.status}`, "*");
      })
      .catch(error => {
        parent.postMessage(`failure: error = ${error.name}`, "*")
      });
  });
</script>