summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/cookies/attributes/resources/path-redirect-shared.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/cookies/attributes/resources/path-redirect-shared.js')
-rw-r--r--testing/web-platform/tests/cookies/attributes/resources/path-redirect-shared.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/testing/web-platform/tests/cookies/attributes/resources/path-redirect-shared.js b/testing/web-platform/tests/cookies/attributes/resources/path-redirect-shared.js
new file mode 100644
index 0000000000..777d0abd33
--- /dev/null
+++ b/testing/web-platform/tests/cookies/attributes/resources/path-redirect-shared.js
@@ -0,0 +1,11 @@
+// Note: this function has a dependency on testdriver.js. Any test files calling
+// it should include testdriver.js and testdriver-vendor.js
+window.addEventListener("message", (e) => {
+ setTestContextUsingRootWindow();
+ if (e.data == "getAndExpireCookiesForRedirectTest") {
+ const cookies = document.cookie;
+ test_driver.delete_all_cookies().then(() => {
+ e.source.postMessage({"cookies": cookies}, '*');
+ });
+ }
+}); \ No newline at end of file