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

Side by Side Diff: LayoutTests/editing/selection/caret-after-keypress.html

Issue 48903019: Delete js-test-post.js. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../fast/js/resources/js-test-pre.js"></script> 4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 <script> 5 <script>
6 description("This tests that 'input' event listener gets correct caret position after keypress."); 6 description("This tests that 'input' event listener gets correct caret position after keypress.");
7 7
8 var test = document.createElement("input") 8 var test = document.createElement("input")
9 document.body.appendChild(test); 9 document.body.appendChild(test);
10 test.focus(); 10 test.focus();
11 11
12 const backSpace = String.fromCharCode(8); 12 const backSpace = String.fromCharCode(8);
13 var input = ["a", "b", "c", backSpace, backSpace, backSpace]; 13 var input = ["a", "b", "c", backSpace, backSpace, backSpace];
14 var output = ["", "a", "ab", "abc", "ab", "a", ""]; 14 var output = ["", "a", "ab", "abc", "ab", "a", ""];
15 15
16 function dumpState() { 16 function dumpState() {
17 var expectedValue = output.shift(); 17 var expectedValue = output.shift();
18 shouldBeEqualToString("test.value", expectedValue); 18 shouldBeEqualToString("test.value", expectedValue);
19 shouldBe("test.selectionStart", "" + expectedValue.length); 19 shouldBe("test.selectionStart", "" + expectedValue.length);
20 shouldBe("test.selectionEnd", "" + expectedValue.length); 20 shouldBe("test.selectionEnd", "" + expectedValue.length);
21 debug(""); 21 debug("");
22 } 22 }
23 23
24 test.addEventListener("input", dumpState); 24 test.addEventListener("input", dumpState);
25 dumpState(); 25 dumpState();
26 while (input.length) 26 while (input.length)
27 eventSender.keyDown(input.shift()); 27 eventSender.keyDown(input.shift());
28 </script> 28 </script>
29 <script src="../../fast/js/resources/js-test-post.js"></script>
30 </body> 29 </body>
31 </html> 30 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698