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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/execCommand/format-block.html

Issue 2448373003: Convert editing/execCommand/format-block.html to utilize w3c test harness (Closed)
Patch Set: 2016-10-26T14:32:42 Created 4 years, 1 month 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/execCommand/format-block-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 <script src="../../resources/dump-as-markup.js"></script> 4 <script src="../assert_selection.js"></script>
5 <div id="test" style="border:1px solid black" contenteditable="true">
6 <p id="item1">Make Pre</p>
7 <br>
8 <div>Foo<br><span id="item2">Make h1</span><br>baz</div>
9 <br>
10 <address id="item3">Attempt to apply the current formatting here</address>
11 </div>
12 <script> 5 <script>
13 if (window.testRunner) 6 test(() => assert_selection(
14 testRunner.dumpEditingCallbacks(); 7 '<div contenteditable><p>|abc</p></div>',
8 'formatBlock pre',
9 '<div contenteditable><pre>|abc</pre></div>'),
10 'Convert P to PRE');
15 11
16 Markup.description("This test uses FormatBlock to modify three of the paragraphs below"); 12 test(() => assert_selection(
17 Markup.dump("test", "Before FormatBlock"); 13 '<div contenteditable><span>|abc</span></div>',
14 'formatBlock h1',
15 '<div contenteditable><h1><span>|abc</span></h1></div>'),
16 'Wrap SPAN with H1');
18 17
19 var s = window.getSelection(); 18 test(() => assert_selection(
20 var r = document.createRange(); 19 '<div contenteditable><address>|abc</address></div>',
21 var p1 = document.getElementById("item1"); 20 'formatBlock p',
22 var p2 = document.getElementById("item2"); 21 '<div contenteditable><p>|abc</p></div>'),
23 var p3 = document.getElementById("item3"); 22 'Convert ADDRESS to P');
24 s.collapse(p1, 0);
25 document.execCommand("FormatBlock", false, "pre");
26 s.collapse(p2, 0);
27 document.execCommand("FormatBlock", false, "h1");
28 s.collapse(p3, 0);
29 document.execCommand("FormatBlock", false, "address");
30 23
31 Markup.dump("test", "After FormatBlock"); 24 test(() => assert_selection(
32 25 '<div contenteditable><address>|abc</address></div>',
26 'formatBlock address',
27 '<div contenteditable><address>|abc</address></div>'),
28 'Keep existing block');
33 </script> 29 </script>
34 </body>
35 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/execCommand/format-block-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698