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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrea Marchesini 2019-02-26 17:37:48 +00:00
parent 084ddbbf6d
commit 9e327d8957
2 changed files with 17 additions and 0 deletions

View File

@ -6,3 +6,4 @@ support-files =
[browser_broadcastChannel.js]
[browser_originattributes.js]
[browser_storage.js]
[browser_sharedWorker.js]

View File

@ -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.");
}
},
});