Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 9 - Tests for DOM Cache and cookie settings changing, r=Ehsan
☠☠ backed out by 32412e6eb551 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 06 Mar 2019 17:02:43 +0000
changeset 462661 2020227181ccbe32dd3e8cddf6860cf32634344e
parent 462660 fc3c64c330b914adc88eb115c2175c84314a6c85
child 462662 8ff9e8f45e02c5a46473df098e5a4aff2c971236
push id79778
push useramarchesini@mozilla.com
push dateWed, 06 Mar 2019 17:08:17 +0000
treeherderautoland@9f8a1b410320 [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