Commit 2e4ae143 authored by yosin's avatar yosin Committed by Commit bot

Convert editing/execCommand/switch-list-type-with-orphaned-li.html to use w3c test harness

This patch converts "editing/execCommand/switch-list-type-with-orphaned-li.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/2272983002
Cr-Commit-Position: refs/heads/master@{#414255}
parent 7a427cc2
This tests switching multiple lists with an orphaned list child to an ordered list.
| "
"
| <ol>
| <li>
| "<#selection-anchor>webkit"
| <li>
| "rocks"
| "
"
| <li>
| "because of"
| "
"
| <li>
| "you<#selection-focus>"
| "
"
| "
"
| "
"
| "
"
| "
"
<script src="../../resources/dump-as-markup.js"></script>
<body>
<div id="test" contenteditable>
<ul>
<li>webkit</li>
</ul>
<li>rocks</li>
<ul>
<li>because of</li>
</ul>
<ol>
<li>you</li>
</ol>
</div>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
Markup.description('This tests switching multiple lists with an orphaned list child to an ordered list.');
var test = document.getElementById('test');
window.getSelection().selectAllChildren(test);
document.execCommand('InsertOrderedList', false, null);
Markup.dump('test');
test(() => assert_selection(
[
'<div contenteditable>^',
'<ul>',
'<li>webkit</li>',
'</ul>',
'<li>rocks</li>', // orphaned list child
'<ul>',
'<li>because of</li>',
'</ul>',
'<ol>',
'<li>you</li>',
'</ol>',
'|</div>',
].join(''),
'insertOrderedList',
[
'<div contenteditable>',
'<ol>',
'<li>^webkit</li>',
'<li>rocks</li>',
'<li>because of</li>',
'<li>you|</li>',
'</ol>',
'</div>',
].join('')),
'Switching multiple lists with an orphaned list child to an ordered list');
</script>
</body>
This tests switching multiple lists with an orphaned list child to an ordered list.
| "
"
| <ol>
| <li>
| "<#selection-anchor>webkit"
| <li>
| "rocks"
| "
"
| <li>
| "because of"
| "
"
| <li>
| "you<#selection-focus>"
| "
"
| "
"
| "
"
| "
"
| "
"
This tests switching multiple lists with an orphaned list child to an ordered list.
| "
"
| <ol>
| <li>
| "<#selection-anchor>webkit"
| <li>
| "rocks"
| "
"
| <li>
| "because of"
| "
"
| "
"
| "
"
| <ol>
| "
"
| <li>
| "you<#selection-focus>"
| "
"
| "
"
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