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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/inserting/typing-around-image-001.html

Issue 2291973002: Convert editing/inserting/typing-around-image-001.html to use w3c test harness (Closed)
Patch Set: 2016-08-30T15:58:33 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 | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/inserting/typing-around-image-001-expected.png » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <!doctype html>
2 <head> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script>
5 <script>
6 test(() => assert_selection(
7 [
8 '<div contenteditable>',
9 '|<img src="../resources/abe.png">',
10 '<img src="../resources/abe.png">',
11 ' <img src="../resources/abe.png">',
12 '</div>',
13 ].join(''),
14 selection => {
15 selection.document.execCommand('insertText', false, 'a');
16 selection.modify('move', 'forward', 'character');
17 selection.document.execCommand('insertText', false, 'bcd');
18 selection.modify('move', 'forward', 'character');
19 selection.document.execCommand('insertText', false, 'efg');
20 selection.modify('move', 'forward', 'character');
21 selection.document.execCommand('insertText', false, 'hij');
22 selection.modify('move', 'forward', 'character');
23 selection.document.execCommand('insertText', false, 'klm');
3 24
4 <style> 25 },
5 .editing { 26 [
6 border: 2px solid red; 27 '<div contenteditable>',
7 padding: 12px; 28 'a<img src="../resources/abe.png">',
8 font-size: 24px; 29 'bcd<img src="../resources/abe.png">',
9 } 30 'efg\u{00A0}hij<img src="../resources/abe.png">',
10 </style> 31 'klm|',
11 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script > 32 '</div>',
12 33 ].join('')),
13 <script> 34 'insertText around image');
14
15 function moveNSpacesAndType(n) {
16 for (i = 0; i < n; i++) {
17 moveSelectionForwardByCharacterCommand();
18 }
19 for (i = 0; i < 3; i++) {
20 typeCharacterCommand();
21 }
22 }
23
24 function editingTest() {
25 typeCharacterCommand();
26 moveNSpacesAndType(1);
27 moveNSpacesAndType(1);
28 moveNSpacesAndType(1);
29 moveNSpacesAndType(1);
30 }
31
32 </script> 35 </script>
33
34 <title>Editing Test</title>
35 </head>
36 <body>
37 <div contenteditable id="root" class="editing">
38 <span id="test"><img src="../resources/abe.png"><img src="../resources/abe.png"> <img src="../resources/abe.png"></span>
39 </div>
40
41 <script>
42 runEditingTest();
43 </script>
44
45 </body>
46 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/inserting/typing-around-image-001-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698