gecko-dev/dom/tests/mochitest/localstorage/test_cookieBlock.html
Martijn Wargers 33bb7b2d4d Bug 913706 - Fix the tests for B2G mochitest that use nsICookiePermission.setAccess. r=honzab.moz
--HG--
extra : rebase_source : 54036e1638d9de46d7ee0116d40e527046d0b26d
2013-09-16 17:15:22 +02:00

43 lines
925 B
HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>cookie blocking test</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript">
function startTest()
{
try {
localStorage.setItem("blocked", "blockedvalue");
ok(false, "Exception for localStorage.setItem, ACCESS_DENY");
}
catch (ex) {
ok(true, "Exception for localStorage.setItem, ACCESS_DENY");
}
try {
localStorage.getItem("blocked");
ok(false, "Exception for localStorage.getItem, ACCESS_DENY");
}
catch (ex) {
ok(true, "Exception for localStorage.getItem, ACCESS_DENY");
}
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPermissions([{'type': 'cookie', 'allow': false, 'context': document}], startTest);
</script>
</head>
<body>
</body>
</html>