Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 9 - Tests for DOM Cache and cookie settings changing, r=Ehsan

Differential Revision: https://phabricator.services.mozilla.com/D18957

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrea Marchesini 2019-03-07 10:17:57 +00:00
parent 9668d47aab
commit 5fccb35782
3 changed files with 15 additions and 1 deletions

View File

@ -5,6 +5,7 @@ support-files =
head.js
[browser_broadcastChannel.js]
[browser_domCache.js]
[browser_indexedDB.js]
[browser_originattributes.js]
[browser_storage.js]

View File

@ -0,0 +1,13 @@
CookiePolicyHelper.runTest("DOM Cache", {
cookieJarAccessAllowed: async _ => {
await content.caches.open("wow").then(
_ => { ok(true, "DOM Cache can be used!"); },
_ => { ok(false, "DOM Cache can be used!"); });
},
cookieJarAccessDenied: async _ => {
await content.caches.open("wow").then(
_ => { ok(false, "DOM Cache cannot be used!"); },
_ => { ok(true, "DOM Cache cannot be used!"); });
},
});

View File

@ -5,7 +5,7 @@ const PERM_DEFAULT = Ci.nsICookiePermission.ACCESS_DEFAULT;
const PERM_ALLOW = Ci.nsICookiePermission.ACCESS_ALLOW;
const PERM_DENY = Ci.nsICookiePermission.ACCESS_DENY;
const TEST_DOMAIN = "http://example.net/";
const TEST_DOMAIN = "https://example.com/";
const TEST_PATH = "browser/netwerk/cookie/test/browser/";
const TEST_TOP_PAGE = TEST_DOMAIN + TEST_PATH + "file_empty.html";