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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/execCommand/remove-formatting.html

Issue 2452003002: Convert editing/deleting/remove-formatting.html to utilize w3c test harness (Closed)
Patch Set: 2016-10-26T17:13:06 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/remove-formatting-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" contenteditable="true">
6 <b>foo</b><a href="http://www.google.com/">bar</a><i>baz</i><br>
7 <table border="1"><tr><td>foo</td><td>bar</td><td>baz</td></tr></table>
8 <u>foo</u>bar<span style="text-decoration:line-through">baz</span><br>
9 </div>
10 <pre id="console"></pre>
11 <script> 5 <script>
6 test(() => assert_selection(
7 '<div contenteditable><a href="http://foo">bar</a></div>',
8 selection => {
9 assert_false(selection.document.execCommand('removeFormat'),
10 'RemoveFormat enabled with no selection');
11 },
12 '<div contenteditable><a href="http://foo">bar</a></div>'),
13 'RemoveFormat command with no selection');
12 14
13 if (window.testRunner) 15 test(() => assert_selection(
14 testRunner.dumpEditingCallbacks(); 16 '<div contenteditable><b>|abc</b></div>',
17 selection => {
18 assert_false(selection.document.execCommand('removeFormat'),
19 'RemoveFormat enabled with no selection');
20 },
21 '<div contenteditable><b>|abc</b></div>'),
22 'RemoveFormat command with caret');
15 23
16 function log(message) { 24 test(() => assert_selection(
17 var console = document.getElementById("console"); 25 [
18 console.innerHTML += message + '\n'; 26 '<div contenteditable>',
19 } 27 '<b>^abc</b>',
20 28 '<a href="#foo">def</a>',
21 var e = document.getElementById("test"); 29 '<i>ghi</i><br>',
22 var s = window.getSelection(); 30 '<table><tbody><tr><td>one</td><td>two</td></tr></tbody></table>',
23 31 '<u>jkl</u>',
24 if (document.queryCommandEnabled("RemoveFormat")) 32 'mno',
25 log("Failure: RemoveFormat enabled with no selection."); 33 '<span style="text-decoration:line-through">baz|</span><br>',
26 s.collapse(e, 0); 34 '</div>',
27 if (document.queryCommandEnabled("RemoveFormat")) 35 ].join(''),
28 log("Failure: RemoveFormat enabled with a caret selection."); 36 'removeFormat',
29 document.execCommand("SelectAll"); 37 [
30 if (!document.queryCommandEnabled("RemoveFormat")) 38 '<div contenteditable>',
31 log("Failure: RemoveFormat disabled with an editable selection."); 39 '^abc',
32 if (!document.execCommand("RemoveFormat")) 40 '<a href="#foo">def</a>',
33 log("Failure: execCommand('RemoveFormat') returned false."); 41 'ghi<br>',
34 42 '<table><tbody><tr><td>one</td><td>two</td></tr></tbody></table>',
35 Markup.description('This is a test for execCommand("RemoveFormat"). It demonstra tes a bug: everything in the editable region below should be selected, as everyt hing was selected before Remove Format was performed.'); 43 'jkl',
36 Markup.dump(e, 'markup'); 44 'mno',
37 Markup.dump('console', 'console'); 45 'baz|<br>',
38 46 '</div>',
47 ].join('')),
48 'RemoveFormat command with range selection');
39 </script> 49 </script>
40 </body>
41 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/execCommand/remove-formatting-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698