|
1 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
2 <head> |
|
3 <title>embeded nulls 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 var k = "key with\x00null"; |
|
13 var v = "value with\x00null"; |
|
14 |
|
15 localStorage.setItem(k, v); |
|
16 |
|
17 is(localStorage.getItem("key with"), null, |
|
18 "not accessible by truncated key"); |
|
19 |
|
20 is(localStorage.getItem(k), "value with\x00null", |
|
21 "value is identical to what has been stored"); |
|
22 |
|
23 isnot(localStorage.getItem(k), "value with", |
|
24 "value is not truncated"); |
|
25 |
|
26 localStorage.clear(); |
|
27 |
|
28 SimpleTest.finish(); |
|
29 } |
|
30 |
|
31 SimpleTest.waitForExplicitFinish(); |
|
32 |
|
33 </script> |
|
34 |
|
35 </head> |
|
36 |
|
37 <body onload="startTest();"> |
|
38 |
|
39 </body> |
|
40 </html> |