mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
1027f32e5c
--HG-- rename : dom/src/storage/nsDOMStorageDB.cpp => dom/src/storage/nsDOMStoragePersistentDB.cpp rename : dom/src/storage/nsDOMStorageDB.h => dom/src/storage/nsDOMStoragePersistentDB.h
54 lines
1.4 KiB
HTML
54 lines
1.4 KiB
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>cookie blocking test</title>
|
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
|
<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()
|
|
{
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
|
|
var io = Components.classes["@mozilla.org/network/io-service;1"]
|
|
.getService(Components.interfaces.nsIIOService);
|
|
var uri = io.newURI(window.location, "", null);
|
|
var cp = Components.classes["@mozilla.org/cookie/permission;1"]
|
|
.getService(Components.interfaces.nsICookiePermission);
|
|
|
|
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DENY);
|
|
|
|
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");
|
|
}
|
|
|
|
cp.setAccess(uri, Components.interfaces.nsICookiePermission.ACCESS_DEFAULT);
|
|
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body onload="startTest();">
|
|
|
|
</body>
|
|
</html>
|