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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/input/ctrl-up-down.html

Issue 2100243002: Remove non-standardize key code names from event_sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix inspector tests that were missed by sed Created 4 years, 5 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 <div id="container"> 1 <div id="container">
2 <p id="description"></p> 2 <p id="description"></p>
3 Manual steps: 3 Manual steps:
4 <ol> 4 <ol>
5 <li>Move middle of the first paragraph</li> 5 <li>Move middle of the first paragraph</li>
6 <li>Type Ctrl+Up</li> 6 <li>Type Ctrl+Up</li>
7 <li>Caret should be start of paragrah</li> 7 <li>Caret should be start of paragrah</li>
8 <li>Type Ctrl+Down</li> 8 <li>Type Ctrl+Down</li>
9 <li>Caret should be next paragrah</li> 9 <li>Caret should be next paragrah</li>
10 <li>Do above step with Ctrl+Shift key to extend selection</li> 10 <li>Do above step with Ctrl+Shift key to extend selection</li>
11 </ol> 11 </ol>
12 Sample editable: 12 Sample editable:
13 <div id="sample" contenteditable="true"><p>This is the first paragraph. Key bind ing of Ctrl+Up/Down are available only Windows.</p><p>This is second paragraph. Do you want to have these key bindings on other platforms?</p> 13 <div id="sample" contenteditable="true"><p>This is the first paragraph. Key bind ing of Ctrl+Up/Down are available only Windows.</p><p>This is second paragraph. Do you want to have these key bindings on other platforms?</p>
14 </div> 14 </div>
15 </div> 15 </div>
16 <script src="../../resources/js-test.js"></script> 16 <script src="../../resources/js-test.js"></script>
17 <script> 17 <script>
18 description('Test Ctrl+Up/Down motion'); 18 description('Test Ctrl+Up/Down motion');
19 function $(id) { return document.getElementById(id); } 19 function $(id) { return document.getElementById(id); }
20 var sample = $('sample'); 20 var sample = $('sample');
21 var selection = window.getSelection(); 21 var selection = window.getSelection();
22 var range = document.createRange(); 22 var range = document.createRange();
23 range.setStart(sample.firstChild.firstChild, 3); 23 range.setStart(sample.firstChild.firstChild, 3);
24 selection.addRange(range); 24 selection.addRange(range);
25 sample.focus(); 25 sample.focus();
26 var paragraph1 = sample.firstChild.firstChild; 26 var paragraph1 = sample.firstChild.firstChild;
27 var paragraph2 = sample.childNodes[1].firstChild; 27 var paragraph2 = sample.childNodes[1].firstChild;
28 if (window.eventSender) { 28 if (window.eventSender) {
29 eventSender.keyDown('upArrow', ['ctrlKey']); 29 eventSender.keyDown('ArrowUp', ['ctrlKey']);
30 shouldBeEqualToString('selection.type', 'Caret'); 30 shouldBeEqualToString('selection.type', 'Caret');
31 shouldBe('selection.focusNode', 'paragraph1'); 31 shouldBe('selection.focusNode', 'paragraph1');
32 shouldBe('selection.focusOffset', '0'); 32 shouldBe('selection.focusOffset', '0');
33 33
34 eventSender.keyDown('downArrow', ['ctrlKey']); 34 eventSender.keyDown('ArrowDown', ['ctrlKey']);
35 shouldBeEqualToString('selection.type', 'Caret'); 35 shouldBeEqualToString('selection.type', 'Caret');
36 shouldBe('selection.focusNode', 'paragraph2'); 36 shouldBe('selection.focusNode', 'paragraph2');
37 shouldBe('selection.focusOffset', '3'); 37 shouldBe('selection.focusOffset', '3');
38 38
39 eventSender.keyDown('downArrow', ['ctrlKey', 'shiftKey']); 39 eventSender.keyDown('ArrowDown', ['ctrlKey', 'shiftKey']);
40 shouldBeEqualToString('selection.type', 'Range'); 40 shouldBeEqualToString('selection.type', 'Range');
41 shouldBe('selection.focusNode', 'paragraph2'); 41 shouldBe('selection.focusNode', 'paragraph2');
42 shouldBe('selection.focusOffset', '84'); 42 shouldBe('selection.focusOffset', '84');
43 43
44 eventSender.keyDown('upArrow', ['ctrlKey', 'shiftKey']); 44 eventSender.keyDown('ArrowUp', ['ctrlKey', 'shiftKey']);
45 shouldBeEqualToString('selection.type', 'Range'); 45 shouldBeEqualToString('selection.type', 'Range');
46 shouldBe('selection.focusNode', 'paragraph1'); 46 shouldBe('selection.focusNode', 'paragraph1');
47 shouldBe('selection.focusOffset', '3'); 47 shouldBe('selection.focusOffset', '3');
48 } 48 }
49 if (window.testRunner) 49 if (window.testRunner)
50 $('container').outerHTML = ''; 50 $('container').outerHTML = '';
51 </script> 51 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698