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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/modify_move/move-by-character-crash-test-textarea.html

Issue 1809963002: [Editing][CodeHealth] Use w3c testharness in editing/seletion/move-by-* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
2 <html> 4 <html>
3 <body> 5 <body>
4 This test sets caret at the beginning of backward text and moving the character to left and right. WebKit should not crash and you should see PASS below:
5 <textarea id="editor">&#8238;LTR 6 <textarea id="editor">&#8238;LTR
6 </textarea> 7 </textarea>
7 <script> 8 <script>
8 onload = function() { 9 test(function() {
9 var sel = window.getSelection(); 10 var sel = window.getSelection();
10 sel.empty(); 11 sel.empty();
11 var test = document.getElementById("editor"); 12 var test = document.getElementById("editor");
12 test.focus(); 13 test.focus();
13 test.selectionDirection = 'none'; 14 test.selectionDirection = 'none';
14 test.selectionStart = 0; 15 test.selectionStart = 0;
15 test.selectionEnd = 0; 16 test.selectionEnd = 0;
16 getSelection().modify("move", "left", "character"); 17 getSelection().modify("move", "left", "character");
17 getSelection().modify("move", "left", "character"); 18 getSelection().modify("move", "left", "character");
18 test.selectionDirection = 'none'; 19 test.selectionDirection = 'none';
19 test.selectionStart = 1; 20 test.selectionStart = 1;
20 test.selectionEnd = 1; 21 test.selectionEnd = 1;
21 getSelection().modify("move", "right", "character"); 22 getSelection().modify("move", "right", "character");
22 getSelection().modify("move", "right", "character"); 23 getSelection().modify("move", "right", "character");
23 document.body.innerHTML = "PASS"; 24 }, "This test sets caret at the beginning of backward text and moving the charac ter to left and right.");
24 };
25
26 if (window.testRunner)
27 testRunner.dumpAsText();
28
29 </script> 25 </script>
30 </body> 26 </body>
31 </html> 27 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698