diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/browsing-topics/topics-not-allowed-for-service-worker-fetch.tentative.https.html | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/browsing-topics/topics-not-allowed-for-service-worker-fetch.tentative.https.html')
-rw-r--r-- | testing/web-platform/tests/browsing-topics/topics-not-allowed-for-service-worker-fetch.tentative.https.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/web-platform/tests/browsing-topics/topics-not-allowed-for-service-worker-fetch.tentative.https.html b/testing/web-platform/tests/browsing-topics/topics-not-allowed-for-service-worker-fetch.tentative.https.html new file mode 100644 index 0000000000..1bd578e9bf --- /dev/null +++ b/testing/web-platform/tests/browsing-topics/topics-not-allowed-for-service-worker-fetch.tentative.https.html @@ -0,0 +1,36 @@ +<!doctype html> +<body> + <script src=/resources/testharness.js></script> + <script src=/resources/testharnessreport.js></script> + <script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> + <script> + promise_test(async t => { + let url = 'resources/topics-not-allowed-for-service-worker-fetch-helper.tentative.https.html'; + + let r = await service_worker_unregister_and_register(t, + 'resources/fetch-topics.js', url); + await wait_for_state(t, r.installing, 'activated'); + + var popup_window = window.open("/common/blank.html"); + + t.add_cleanup(async _=>{ + popup_window.close(); + await r.unregister(); + }); + + // The current page isn't yet controlled by the service worker. Thus, + // execute the actual test in a new page and let it post its result back + // to this page. + test_helper_popup_page_result = new Promise((resolve, reject) => { + window.addEventListener('message', t.step_func((e) => { + assert_equals(e.data.testResult, + 'Topics fetch initiated from service worker did not include the topics header'); + resolve(); + })); + }); + + popup_window.location = url; + await test_helper_popup_page_result; + }, 'test that fetch(<url>, {browsingTopics: true}) from a service worker context will not include the topics header'); + </script> +</body> |