browser_sharedWorker.js (476B)
1 "use strict"; 2 3 CookiePolicyHelper.runTest("SharedWorker", { 4 cookieJarAccessAllowed: async w => { 5 new w.SharedWorker("a.js", "foo"); 6 ok(true, "SharedWorker is allowed"); 7 }, 8 9 cookieJarAccessDenied: async w => { 10 try { 11 new w.SharedWorker("a.js", "foo"); 12 ok(false, "SharedWorker cannot be used!"); 13 } catch (e) { 14 ok(true, "SharedWorker cannot be used!"); 15 is(e.name, "SecurityError", "We want a security error message."); 16 } 17 }, 18 });