mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-04 07:40:42 +00:00
Bug 1264567 - Isolation tests of localStorage. r=baku, r=arthuredelstein
--HG-- extra : rebase_source : e1d1d07dc79d0081c993d84175f6985d2a80c263
This commit is contained in:
parent
5f357f7c51
commit
dae1f761d1
@ -7,3 +7,4 @@ support-files =
|
||||
|
||||
[browser_dummy.js]
|
||||
skip-if = true
|
||||
[browser_localStorageIsolation.js]
|
||||
|
@ -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);
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user