dom/tests/mochitest/localstorage/test_cookieBlock.html

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:44560d208fdb
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head>
3 <title>cookie blocking test</title>
4
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
7
8 <script type="text/javascript">
9
10 function startTest()
11 {
12 try {
13 localStorage.setItem("blocked", "blockedvalue");
14 ok(false, "Exception for localStorage.setItem, ACCESS_DENY");
15 }
16 catch (ex) {
17 ok(true, "Exception for localStorage.setItem, ACCESS_DENY");
18 }
19
20 try {
21 localStorage.getItem("blocked");
22 ok(false, "Exception for localStorage.getItem, ACCESS_DENY");
23 }
24 catch (ex) {
25 ok(true, "Exception for localStorage.getItem, ACCESS_DENY");
26 }
27
28 SimpleTest.finish();
29 }
30
31 SimpleTest.waitForExplicitFinish();
32
33 SpecialPowers.pushPermissions([{'type': 'cookie', 'allow': false, 'context': document}], startTest);
34
35 </script>
36
37 </head>
38
39 <body>
40
41 </body>
42 </html>

mercurial