diff options
Diffstat (limited to 'testing/web-platform/tests/browsing-topics/resources/fetch-topics-header-not-visible-in-service-worker-helper.tentative.https.html')
-rw-r--r-- | testing/web-platform/tests/browsing-topics/resources/fetch-topics-header-not-visible-in-service-worker-helper.tentative.https.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/browsing-topics/resources/fetch-topics-header-not-visible-in-service-worker-helper.tentative.https.html b/testing/web-platform/tests/browsing-topics/resources/fetch-topics-header-not-visible-in-service-worker-helper.tentative.https.html new file mode 100644 index 0000000000..e9cb8144e0 --- /dev/null +++ b/testing/web-platform/tests/browsing-topics/resources/fetch-topics-header-not-visible-in-service-worker-helper.tentative.https.html @@ -0,0 +1,21 @@ +<!doctype html> +<body> + <script> + var current_url = window.location.href; + var fetch_url = current_url.substring(0, current_url.lastIndexOf("/")) + '/empty.html' + + navigator.serviceWorker.addEventListener('message', e => { + if (e.data.fetchUrl == fetch_url) { + if (e.data.topicsHeader === 'null') { + window.opener.postMessage( + {testResult: 'Service worker intercepted no topics header'}, '*'); + } else { + window.opener.postMessage( + {testResult: 'Service worker intercepted topics header'}, '*'); + } + } + }); + + fetch(fetch_url, {browsingTopics: true}); + </script> +</body> |