2014-08-13 16:56:25 +04:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=1043106
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Test for Bug 1043106</title>
|
2019-04-16 06:53:28 +03:00
|
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
2014-08-13 16:56:25 +04:00
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1043106">Mozilla Bug 1043106</a>
|
|
|
|
<iframe id="iframe"></iframe>
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
var storage;
|
|
|
|
|
|
|
|
window.addEventListener("storage", function (event) {
|
2018-10-23 10:12:23 +03:00
|
|
|
is(event.storageArea, storage, "The storageArea is correct");
|
2016-11-09 00:36:46 +03:00
|
|
|
storage.removeItem("a");
|
2014-08-13 16:56:25 +04:00
|
|
|
runTests();
|
|
|
|
});
|
|
|
|
|
|
|
|
var tests = [ { key: 'localStorage', storage: localStorage },
|
|
|
|
{ key: 'sessionStorage', storage: sessionStorage } ];
|
|
|
|
function runTests() {
|
|
|
|
if (!tests.length) {
|
|
|
|
SimpleTest.finish();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var t = tests.shift();
|
|
|
|
storage = t.storage;
|
|
|
|
|
|
|
|
var ifr = document.getElementById("iframe");
|
2017-04-21 07:18:53 +03:00
|
|
|
ifr.srcdoc = "<script>"+ t.key + ".setItem(\"a\",\"b\");</"+"script>";
|
2014-08-13 16:56:25 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
runTests();
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|