Commit 9f028ea2 authored by yosin's avatar yosin Committed by Commit bot

Convert editing/execCommand/insertHTML.html to use w3c test harness

This patch converts "editing/execCommand/insertHTML.html" to use w3c test
harness to simplify test script for improving code health.

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

Review-Url: https://codereview.chromium.org/2330353004
Cr-Commit-Position: refs/heads/master@{#418497}
parent bdac06c0
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
This is a test of execCommand(insertHTML, ...). The contents of the editable div below should be the same before and after the test.
hello 1 2 world!
hello<table style="display:inline-table" border="1"><tbody><tr><td>1</td><td>2</td></tr></tbody></table><b>world</b>!
<html> <!doctype html>
<head> <script src="../../resources/testharness.js"></script>
<script src=../editing.js language="JavaScript" type="text/JavaScript"></script> <script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script> <script>
test(() => assert_selection(
if (window.testRunner) '<div contenteditable>|</div>',
window.testRunner.dumpAsText(); 'insertHTML foo<table style="display:inline-table"><tr><td>1</td><td>2</td></tr></table><b>bar</b>!',
[
function log(message) { '<div contenteditable>',
var console = document.getElementById("console"); 'foo',
var li = document.createElement("li"); '<table style="display:inline-table"><tbody>',
var text = document.createTextNode(message); '<tr><td>1</td><td>2</td></tr>',
li.appendChild(text); '</tbody></table>',
console.appendChild(li); '<b>bar</b>!|',
} '</div>',
].join('')),
function editingTest() { 'insertHTML');
var d = document.getElementById("test");
var html = d.innerHTML.toLowerCase();
selectAllCommand();
deleteCommand();
insertHTMLCommand(html);
log(d.innerHTML);
}
</script> </script>
</head>
<body>
<p>This is a test of execCommand(insertHTML, ...). The contents of the editable div below should be the same before and after the test.</p>
<div id="test" contenteditable="true">hello<table style="display:inline-table" border=1><tr><td>1</td><td>2</td></tr></table><b>world</b>!</div>
<ul id="console"></ul>
<script>
runEditingTest();
</script>
</body>
</html>
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