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

Unified Diff: third_party/WebKit/LayoutTests/editing/undo/undo-indent.html

Issue 2010333003: Convert undo-indent*.html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-05-27T11:26:03 Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/undo/undo-indent-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/undo/undo-indent-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698