| Index: third_party/WebKit/LayoutTests/editing/undo/undo-indent.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/undo/undo-indent.html b/third_party/WebKit/LayoutTests/editing/undo/undo-indent.html
|
| index 74d24d836008a77a5135ef48c7dcc3887facffc8..cadc287b8476c6e59217f723812d19f24d938741 100644
|
| --- a/third_party/WebKit/LayoutTests/editing/undo/undo-indent.html
|
| +++ b/third_party/WebKit/LayoutTests/editing/undo/undo-indent.html
|
| @@ -1,50 +1,26 @@
|
| -<html>
|
| -<body>
|
| -<div>
|
| -This tests indenting "three" then undoing the indent. You should see one, two and three numbered 1 through 3 then four as a sublist with number 1.
|
| -<p>
|
| -<a href="https://bugs.webkit.org/show_bug.cgi?id=28722">Bugzilla bug</a>
|
| -<br>
|
| -<a href="rdar://problem/7169206">Radar bug</a>
|
| -</p>
|
| -<ol id="e" contenteditable="true">
|
| -<li>one</li>
|
| -<li>two</li>
|
| -<li id="test">three</li>
|
| -<ol><li>four</li></ol>
|
| -</ol>
|
| -</div>
|
| -
|
| -<ul>
|
| -<li>Before indent:<span id="c1"></span></li>
|
| -<li>After indent:<span id="c2"></span></li>
|
| -<li>After undoing:<span id="c3"></span></li>
|
| -</ul>
|
| -
|
| -<script type="text/javascript">
|
| -
|
| -if (window.testRunner) {
|
| - testRunner.dumpEditingCallbacks();
|
| - testRunner.dumpAsText();
|
| -}
|
| -
|
| -var e = document.getElementById('e');
|
| -
|
| -document.getElementById('c1').appendChild(document.createTextNode(e.innerHTML));
|
| -
|
| -var s = window.getSelection();
|
| -var r = document.createRange();
|
| -r.selectNode(document.getElementById('test'));
|
| -s.removeAllRanges();
|
| -s.addRange(r);
|
| -document.execCommand("Indent", false, "");
|
| -document.getElementById('c2').appendChild(document.createTextNode(e.innerHTML));
|
| -
|
| -document.execCommand("Undo");
|
| -document.getElementById('c3').appendChild(document.createTextNode(e.innerHTML));
|
| -
|
| -if (document.getElementById('c1').innerHTML == document.getElementById('c3').innerHTML)
|
| - document.write("The test passed");
|
| -else
|
| - document.write("The test failed.");
|
| +<!doctype html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../assert_selection.js"></script>
|
| +<div id="log"></div>
|
| +<script>
|
| +test(() => {
|
| + assert_selection(
|
| + '<ol contenteditable><li>one</li><li>two</li><li>^three|</li><ol><li>four</li></ol></ol>',
|
| + selection => {
|
| + selection.document.execCommand('Indent');
|
| + selection.document.execCommand('Undo');
|
| + },
|
| + '<ol contenteditable><li>one</li><li>two</li><li>^three|</li><ol><li>four</li></ol></ol>');
|
| +
|
| + assert_selection(
|
| + '<ol contenteditable><li>one</li><li>two</li><li>^three|</li><ol><li>four</li></ol></ol>',
|
| + selection => {
|
| + selection.document.execCommand('Indent');
|
| + selection.document.querySelector('ol').contentEditable = false;
|
| + selection.document.execCommand('Undo');
|
| + },
|
| + '<ol contenteditable=\"false\"><li>one</li><li>two</li><ol><li>^three|</li><li>four</li></ol></ol>',
|
| + 'Undo does nothing for uneditable');
|
| +});
|
| </script>
|
|
|