Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 6 - Tests for SharedWorker and cookie settings changing, r=Ehsan
☠☠ backed out by 66a4a5cb3fc7 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 27 Feb 2019 19:56:39 +0000
changeset 519387 6b92fb3666d156c8547378eec6c6b2713d820046
parent 519386 476af2d7efe5b93b1a4c75695e1d1753071a6c83
child 519388 10afd61b758223b1a60541935817dc77ff033d30
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1525245
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 6 - Tests for SharedWorker and cookie settings changing, r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D18954
netwerk/cookie/test/browser/browser.ini
netwerk/cookie/test/browser/browser_sharedWorker.js
--- a/netwerk/cookie/test/browser/browser.ini
+++ b/netwerk/cookie/test/browser/browser.ini
@@ -1,8 +1,9 @@
 [DEFAULT]
 support-files =
   file_empty.html
   head.js
 
 [browser_broadcastChannel.js]
 [browser_originattributes.js]
 [browser_storage.js]
+[browser_sharedWorker.js]
new file mode 100644
--- /dev/null
+++ b/netwerk/cookie/test/browser/browser_sharedWorker.js
@@ -0,0 +1,16 @@
+CookiePolicyHelper.runTest("SharedWorker", {
+  cookieJarAccessAllowed: async _ => {
+    new content.SharedWorker("a.js", "foo");
+    ok(true, "SharedWorker is allowed");
+  },
+
+  cookieJarAccessDenied: async _ => {
+    try {
+      new content.SharedWorker("a.js", "foo");
+      ok(false, "SharedWorker cannot be used!");
+    } catch (e) {
+      ok(true, "SharedWorker cannot be used!");
+      is(e.name, "SecurityError", "We want a security error message.");
+    }
+  },
+});