diff options
Diffstat (limited to 'dom/tests/mochitest/localstorage/test_cookieBlock.html')
-rw-r--r-- | dom/tests/mochitest/localstorage/test_cookieBlock.html | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/dom/tests/mochitest/localstorage/test_cookieBlock.html b/dom/tests/mochitest/localstorage/test_cookieBlock.html new file mode 100644 index 000000000..c95cbca49 --- /dev/null +++ b/dom/tests/mochitest/localstorage/test_cookieBlock.html @@ -0,0 +1,42 @@ +<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> |