OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p>Tests for value sanitization algorithm.</p> | 7 <p>Tests for value sanitization algorithm.</p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <script> | 9 <script> |
10 var input; | 10 var input; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 container.innerHTML = '<input type="text" id="text" value="\n\r foo bar \n\r\n">
'; | 48 container.innerHTML = '<input type="text" id="text" value="\n\r foo bar \n\r\n">
'; |
49 input = document.getElementById('text'); | 49 input = document.getElementById('text'); |
50 shouldBe('input.value', '" foo bar "'); | 50 shouldBe('input.value', '" foo bar "'); |
51 input.focus(); | 51 input.focus(); |
52 document.execCommand('SelectAll'); | 52 document.execCommand('SelectAll'); |
53 shouldBe('document.getSelection().toString()', '" foo bar "'); | 53 shouldBe('document.getSelection().toString()', '" foo bar "'); |
54 | 54 |
55 input.value = String.fromCharCode(0xD800); | 55 input.value = String.fromCharCode(0xD800); |
56 shouldBe('input.value', 'String.fromCharCode(0xD800)'); | 56 shouldBe('input.value', 'String.fromCharCode(0xD800)'); |
57 | 57 |
58 input.value = 'foo\0bar'; | |
59 shouldBeEqualToString('input.value', 'foo\0bar'); | |
60 | |
61 input.value = 'foo\bbar'; | |
62 shouldBeEqualToString('input.value', "foo\bbar"); | |
63 | |
64 input.value = 'foo\tbar'; | |
65 shouldBeEqualToString('input.value', "foo\tbar"); | |
66 | |
67 input.value = "foo\vbar"; | |
68 shouldBeEqualToString('input.value', "foo\vbar"); | |
69 | |
70 input.value = "foo\fbar"; | |
71 shouldBeEqualToString('input.value', "foo\fbar"); | |
72 | |
73 // FIXME: Add more sanitization tests. | 58 // FIXME: Add more sanitization tests. |
74 // https://bugs.webkit.org/show_bug.cgi?id=37024 | 59 // https://bugs.webkit.org/show_bug.cgi?id=37024 |
75 | 60 |
76 container.innerHTML = ''; | 61 container.innerHTML = ''; |
77 | 62 |
78 </script> | 63 </script> |
79 </body> | 64 </body> |
80 </html> | 65 </html> |
OLD | NEW |