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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/inserting/insert-text-with-newlines.html

Issue 2180863002: Convert editing/insert-text-with-newlines.html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-25T18:37:37 Created 4 years, 4 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/insert-text-with-newlines-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 <!doctype html>
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 '<div contenteditable>Foo | <i> bar</i></div>',
8 selection => {
9 selection.document.execCommand('insertText', false, 'x');
10 selection.document.execCommand('insertText', false, 'x');
11 selection.document.execCommand('insertText', false, 'x');
12 },
13 '<div contenteditable>Foo xxx|<i>bar</i></div>'),
14 'Collapse spaces');
1 15
2 <html> 16 test(() => assert_selection(
3 <head> 17 '<div contenteditable>Foo <i> bar</i>\n\n|baz</div>',
18 selection => {
19 selection.document.execCommand('insertText', false, 'x');
20 selection.document.execCommand('insertText', false, 'x');
21 selection.document.execCommand('insertText', false, 'x');
22 },
23 '<div contenteditable>Foo <i> bar</i>\u{00A0}xxx|baz</div>'),
24 'Replace newlines into nbsp');
4 25
5 <style> 26 test(() => assert_selection(
6 .editing { 27 '<div contenteditable>foo|bar</div>',
7 border: 2px solid red; 28 selection => {
8 padding: 12px; 29 selection.document.execCommand('insertLineBreak');
9 font-size: 24px; 30 selection.document.execCommand('insertLineBreak');
10 } 31 },
11 </style> 32 '<div contenteditable>foo<br><br>|bar</div>'),
12 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script > 33 'Insert BRs');
13
14 <script>
15
16 function moveNSpacesAndType(n) {
17 for (i = 0; i < n; i++) {
18 moveSelectionForwardByCharacterCommand();
19 }
20 for (i = 0; i < 3; i++) {
21 typeCharacterCommand();
22 }
23 }
24
25 function editingTest() {
26 moveNSpacesAndType(4);
27 insertLineBreakCommand();
28 moveNSpacesAndType(4);
29 insertLineBreakCommand();
30 insertLineBreakCommand();
31 moveNSpacesAndType(4);
32 }
33
34 </script> 34 </script>
35
36 <title>Editing Test</title>
37 </head>
38 <body>
39 <div contenteditable id="root" class="editing">
40 <span id="test">Foo <i> bar</i>
41
42 baz</span>
43 </div>
44
45 <script>
46 runEditingTest();
47 </script>
48
49 </body>
50 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/inserting/insert-text-with-newlines-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698