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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/deleting/delete_by_word.html

Issue 2341563003: Makes assert_selection() to set focus to sample IFRAME (Closed)
Patch Set: 2016-09-14T14:56:27 Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/editing/assert_selection.js ('k') | no next file » | 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> 1 <!doctype html>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script> 4 <script src="../assert_selection.js"></script>
5 <script> 5 <script>
6 const isMac = navigator.platform.indexOf('Mac') === 0; 6 const isMac = navigator.platform.indexOf('Mac') === 0;
7 const kDeleteWordModifiers = isMac ? ['altKey'] : ['ctrlKey']; 7 const kDeleteWordModifiers = isMac ? ['altKey'] : ['ctrlKey'];
8 8
9 test(() => { 9 test(() => {
10 assert_not_equals(window.eventSender, undefined, 'This test requires eve ntSender.'); 10 assert_not_equals(window.eventSender, undefined, 'This test requires eve ntSender.');
11 assert_selection( 11 assert_selection(
12 [ 12 [
13 '<div contenteditable>', 13 '<div contenteditable>',
14 'one two |cha cha three four cha cha cha', 14 'one two |cha cha three four cha cha cha',
15 '</div>', 15 '</div>',
16 ].join(''), 16 ].join(''),
17 selection => { 17 selection => {
18 selection.document.execCommand('insertText', false, ' abc'); 18 selection.document.execCommand('insertText', false, ' abc');
19 eventSender.keyDown('Backspace', kDeleteWordModifiers); 19 eventSender.keyDown('Backspace', kDeleteWordModifiers);
20 selection.document.execCommand('insertText', false, ' cha'); 20 selection.document.execCommand('insertText', false, ' cha');
21 }, 21 },
22 // BR is a placeholder.
23 [ 22 [
24 '<div contenteditable>', 23 '<div contenteditable>',
25 'one two \u{00A0}abc cha|cha cha three four cha cha cha', 24 'one two \u{00A0} cha|cha cha three four cha cha cha',
26 '</div>', 25 '</div>',
27 ].join('')); 26 ].join(''));
28 }, 'Delete word'); 27 }, 'Delete word');
29 28
30 test(() => { 29 test(() => {
31 assert_not_equals(window.eventSender, undefined, 'This test requires eve ntSender.'); 30 assert_not_equals(window.eventSender, undefined, 'This test requires eve ntSender.');
32 assert_selection( 31 assert_selection(
33 [ 32 [
34 '<div contenteditable>', 33 '<div contenteditable>',
35 'one two |three four', 34 'one two |three four',
36 '</div>', 35 '</div>',
37 ].join(''), 36 ].join(''),
38 selection => { 37 selection => {
39 eventSender.keyDown('Backspace', kDeleteWordModifiers); 38 eventSender.keyDown('Backspace', kDeleteWordModifiers);
40 selection.document.execCommand('undo'); 39 selection.document.execCommand('undo');
41 }, 40 },
42 // BR is a placeholder.
43 [ 41 [
44 '<div contenteditable>', 42 '<div contenteditable>',
45 'one two |three four', 43 isMac
44 ? 'one |two ^three four'
45 : 'one two |three four',
46 '</div>', 46 '</div>',
47 ].join('')); 47 ].join(''));
48 }, 'Delete word then undo'); 48 }, 'Delete word then undo');
49 </script> 49 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/assert_selection.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698