Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 9 - Tests for DOM Cache and cookie settings changing, r=Ehsan
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 08 Mar 2019 09:02:53 +0000
changeset 463106 89c5023dd68eff8871e748be6167895760a725af
parent 463105 d778cbd509c36457d865516a07143831ba49d46e
child 463107 98ff0248c6079b9518e2b96d19bacb5402a21bda
push id35666
push usershindli@mozilla.com
push dateFri, 08 Mar 2019 13:49:21 +0000
treeherdermozilla-central@3cddc7cd4da5 [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 9 - Tests for DOM Cache and cookie settings changing, r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D18957
netwerk/cookie/test/browser/browser.ini
netwerk/cookie/test/browser/browser_domCache.js
netwerk/cookie/test/browser/head.js
--- a/netwerk/cookie/test/browser/browser.ini
+++ b/netwerk/cookie/test/browser/browser.ini
@@ -1,12 +1,13 @@
 [DEFAULT]
 support-files =
   file_empty.html
   file_empty.js
   head.js
 
 [browser_broadcastChannel.js]
+[browser_domCache.js]
 [browser_indexedDB.js]
 [browser_originattributes.js]
 [browser_storage.js]
 [browser_serviceWorker.js]
 [browser_sharedWorker.js]
new file mode 100644
--- /dev/null
+++ b/netwerk/cookie/test/browser/browser_domCache.js
@@ -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!"); });
+  },
+});
--- a/netwerk/cookie/test/browser/head.js
+++ b/netwerk/cookie/test/browser/head.js
@@ -1,16 +1,16 @@
 const BEHAVIOR_ACCEPT = Ci.nsICookieService.BEHAVIOR_ACCEPT;
 const BEHAVIOR_REJECT = Ci.nsICookieService.BEHAVIOR_REJECT;
 
 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";
 
 // Helper to eval() provided cookieJarAccessAllowed and cookieJarAccessDenied
 // toString()ed optionally async function in freshly created tabs with
 // BEHAVIOR_ACCEPT and BEHAVIOR_REJECT configured, respectively, in a number of
 // permutations. This includes verifying that changing the permission while the
 // page is open still results in the state of the permission when the