Commit e211f36d authored by yosin's avatar yosin Committed by Commit bot

Convert editing/execCommand/remove-list-item-1.html to use w3c test harness

This patch converts "editing/execCommand/remove-list-item-1.html" to use w3c
test harness to simplify test script for improving readability.

BUG=n/a
TEST=n/a; no behavior changes

Review-Url: https://codereview.chromium.org/2276563003
Cr-Commit-Position: refs/heads/master@{#414278}
parent 9b98997d
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
This tests de-listing content.
There should be a single BR above this line and no OL or LI.
<br>There should be a single BR above this line and no OL or LI.
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script> <script>
if (window.testRunner) { test(() => assert_selection(
testRunner.dumpEditingCallbacks(); [
testRunner.dumpAsText(); '<div contenteditable>',
} '<ol>',
</script> '<li>|</li>',
<p>This tests de-listing content.</p> '<li>foo bar</li>',
<div id="div" contenteditable="true"><ol><li></li><li>There should be a single BR above this line and no OL or LI.</li></ol></div> '</ol>',
<p id="console"></p> '</div>',
].join(''),
<script> selection => {
selection.document.execCommand('selectAll');
function log(message) { selection.document.execCommand('insertOrderedList');
var console = document.getElementById("console"); },
var text = document.createTextNode(message); [
console.appendChild(text); '<div contenteditable>',
} // TODO(yosin): We should study why unlistify sets caret before
// last character.
var div = document.getElementById("div"); '^<br>foo ba|r',
var sel = window.getSelection(); '</div>',
].join('')),
div.focus(); 'Unlistify with an empty list item');
document.execCommand("SelectAll");
document.execCommand("InsertOrderedList");
log(div.innerHTML);
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment