Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: LayoutTests/fast/forms/input-value-sanitization.html

Issue 189843008: Value sanitization for input[type=text] should not truncate a value at control character (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bug196640
Patch Set: Removed control characters truncation logic to match firefox and IE behavior Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/forms/input-value-sanitization-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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";
tkent 2014/03/11 04:03:06 Please add spaces around '='.
Habib Virji 2014/03/11 11:17:49 Done.
59 shouldBe('input.value', '"foo\\0bar"');
tkent 2014/03/11 04:03:06 Please use shouldBeEqualToString.
Habib Virji 2014/03/11 11:17:49 Done.
60
61 input.value="foo\abar";
62 shouldBe('input.value', '"foo\\abar"');
63
64 input.value="foo\bbar";
65 shouldBe('input.value', '"foo\\bbar"');
66
67 input.value="foo\tbar";
68 shouldBe('input.value', '"foo\\tbar"');
69
70 input.value="foo\vbar";
71 shouldBe('input.value', '"foo\\vbar"');
72
73 input.value="foo\fbar";
74 shouldBe('input.value', '"foo\\fbar"');
75
76 input.value="foo\ebar";
77 shouldBe('input.value', '"foo\\ebar"');
78
79 input.value="foo\^?bar";
80 shouldBe('input.value', '"foo\\^?bar"');
81
58 // FIXME: Add more sanitization tests. 82 // FIXME: Add more sanitization tests.
59 // https://bugs.webkit.org/show_bug.cgi?id=37024 83 // https://bugs.webkit.org/show_bug.cgi?id=37024
60 84
61 container.innerHTML = ''; 85 container.innerHTML = '';
62 86
63 </script> 87 </script>
64 </body> 88 </body>
65 </html> 89 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/input-value-sanitization-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698