Bug 1264567 - Isolation tests of localStorage. r=baku, r=arthuredelstein

--HG--
extra : rebase_source : e1d1d07dc79d0081c993d84175f6985d2a80c263
This commit is contained in:
Jonathan Hao 2016-08-30 00:06:00 -04:00
parent 5f357f7c51
commit dae1f761d1
3 changed files with 26 additions and 1 deletions

View File

@ -7,3 +7,4 @@ support-files =
[browser_dummy.js]
skip-if = true
[browser_localStorageIsolation.js]

View File

@ -0,0 +1,24 @@
/**
* Bug 1264567 - A test case for localStorage isolation.
*/
const TEST_PAGE = "http://mochi.test:8888/browser/browser/components/" +
"originattributes/test/browser/file_firstPartyBasic.html";
// Use a random key so we don't access it in later tests.
const key = Math.random().toString();
// Define the testing function
function* doTest(aBrowser) {
return yield ContentTask.spawn(aBrowser, key, function (key) {
let value = content.localStorage.getItem(key);
if (value === null) {
// No value is found, so we create one.
value = Math.random().toString();
content.localStorage.setItem(key, value);
}
return value;
});
}
IsolationTestTools.runTests(TEST_PAGE, doTest);

View File

@ -176,7 +176,7 @@ this.IsolationTestTools = {
add_task(function* addTaskForIsolationTests() {
let testSettings = [
{ mode: TEST_MODE_FIRSTPARTY,
skip: false,
skip: true,
prefs: [["privacy.firstparty.isolate", true]]
},
{ mode: TEST_MODE_NO_ISOLATION,