Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / localstorage-value-truncation.html
blob242376a5a62cee25956663b88a69dedd8812c9aa
1 <html>
2 <body>
3 <p>In this test we need to find out if the browser can save the localStorage item correctly without truncated by the \x00 in the middle of the string.</p>
4 <script type="text/javascript">
5 var key = 'TruncVal';
6 var value = '123\x00567';
8 var x = localStorage.getItem(key);
9 if (!x) {
10 localStorage.setItem(key, value);
11 document.write("<p>It hasn't got the '" + key + "' in the localStorage database, will create it using:<br>");
12 document.write("<code>localStorage.setItem('" + key + "', '" + value + "');</code><br>");
13 document.write("Now close your browser and start it again to see the results.</p>");
15 else {
16 document.write("<p>The value of " + key + " is: '" + x + "', the length is: " + x.length + "<br>");
18 if (x == value) {
19 document.write("PASS.");
21 else {
22 document.write("FAIL: The expected value is: '" + value + "', the expected length is: " + value.length);
24 document.write("</p><a href=\"javascript:localStorage.removeItem('" + key + "');\">remove '" + key + "' from localStorage</a>");
26 </script>
28 <p>This is for <a href="https://bugs.webkit.org/show_bug.cgi?id=58762">https://bugs.webkit.org/show_bug.cgi?id=58762</a>
29 </p>
30 </body>
31 </html>