summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/infrastructure/assumptions/resources
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/infrastructure/assumptions/resources')
-rw-r--r--testing/web-platform/tests/infrastructure/assumptions/resources/fetch-and-post-result.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/web-platform/tests/infrastructure/assumptions/resources/fetch-and-post-result.html b/testing/web-platform/tests/infrastructure/assumptions/resources/fetch-and-post-result.html
new file mode 100644
index 0000000000..4df0c4c71a
--- /dev/null
+++ b/testing/web-platform/tests/infrastructure/assumptions/resources/fetch-and-post-result.html
@@ -0,0 +1,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>
+