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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/deleting/paragraph-in-preserveNewline.html

Issue 2297103002: Convert editing/deleting/paragraph-in-preserveNewline.html to use w3c test harness (Closed)
Patch Set: 2016-08-31T13:31:55 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/editing/deleting/paragraph-in-preserveNewline-expected.txt » ('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> 1 <!doctype html>
2 <html> 2 <script src="../../resources/testharness.js"></script>
3 <body> 3 <script src="../../resources/testharnessreport.js"></script>
4 <p id="description">This tests for a bug where deleting a paragraph in preserveN ewline text would introduce an extra line. You should see '\nbar' below.</p> 4 <script src="../assert_selection.js"></script>
5 <div id="test" contenteditable="true"><pre>foo 5 <script>
6 bar</pre></div> 6 test(() => {
7 assert_not_equals(window.internals, undefined,
8 'This test requires window.internals');
9 ['mac', 'win', 'unix', 'android'].forEach(platform => {
10 internals.settings.setEditingBehavior(platform);
11 assert_selection(
12 '<div contenteditable><pre>^foo|\n</pre></div>',
13 'delete',
14 '<div contenteditable><pre>|\n</pre></div>',
15 `${platform}: Delete a paragraph in preserving newline`);
7 16
8 <script src="../../resources/dump-as-markup.js"></script> 17 assert_selection(
9 <script> 18 '<div contenteditable><pre>^foo|\n</pre></div>',
10 function runTestsOn(platform) { 19 selection => {
11 var sel = window.getSelection(); 20 selection.document.execCommand('delete');
12 var e = document.getElementById("test"); 21 selection.document.execCommand('undo');
13 22 },
14 if (window.internals) 23 '<div contenteditable><pre>^foo|\n</pre></div>',
15 internals.settings.setEditingBehavior(platform); 24 '${platform}: Undo after delete a paragraph in preserving newlin e');
16 25 });
17 sel.collapse(e, 0); 26 });
18 sel.modify("extend", "forward", "character");
19 sel.modify("extend", "forward", "character");
20 sel.modify("extend", "forward", "character");
21 document.execCommand("Delete");
22 Markup.dump("test", "on " + platform);
23 document.execCommand("undo");
24 Markup.dump("test", "after undo on " + platform);
25 }
26
27 if (window.testRunner)
28 testRunner.dumpEditingCallbacks();
29 Markup.description(description.textContent);
30 Markup.dump("test", "initial state");
31 runTestsOn("mac");
32 runTestsOn("win");
33 runTestsOn("unix");
34 runTestsOn("android");
35 </script> 27 </script>
36 </body>
37 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/deleting/paragraph-in-preserveNewline-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698