Commit 5e92033a authored by yosin's avatar yosin Committed by Commit bot

Convert editing/deleting/delete-to-end-of-paragraph.html to use w3c test harness

This patch converts "editing/deleting/delete-to-end-of-paragraph.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/2333193002
Cr-Commit-Position: refs/heads/master@{#418777}
parent d5bcb937
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
| "<#selection-caret>four five six"
| <br>
<!DOCTYPE html> <!doctype html>
<html> <script src="../../resources/testharness.js"></script>
<head> <script src="../../resources/testharnessreport.js"></script>
<style> <script src="../assert_selection.js"></script>
.editing {
font-size: 24px;
width: 600px;
}
</style>
<title>Editing Test</title>
</head>
<body contenteditable id="root">
<div id="test" class="editing">one two three</div><div>four five six</div>
<script src="../../resources/dump-as-markup.js"></script>
<script> <script>
test(() => {
assert_not_equals(window.testRunner, undefined,
'This test requires testRunner.');
if (!window.testRunner) assert_selection(
document.write("(cannot run interactively)"); [
else { '<div contenteditable>',
testRunner.dumpEditingCallbacks(); '<div>|one two three</div>',
'<div>four five six</div>',
getSelection().collapse(document.getElementById('test'), 0); '</div>',
// test for 4570218 by using double deleteToEndOfParagraph ].join(''),
testRunner.execCommand("DeleteToEndOfParagraph"); selection => {
testRunner.execCommand("DeleteToEndOfParagraph"); testRunner.execCommand('deleteToEndOfParagraph');
Markup.dump('test'); },
} [
'<div contenteditable>',
'<div>|<br></div><div>four five six</div>',
'</div>',
].join(''),
'1 Delete a paragraph');
assert_selection(
[
'<div contenteditable>',
'<div>|<br></div>',
'<div>four five six</div>',
'</div>',
].join(''),
selection => {
testRunner.execCommand('deleteToEndOfParagraph');
},
[
'<div contenteditable>',
'<div>|four five six</div>',
'</div>',
].join(''),
'2 Delete an empty paragraph');
}, 'Delete to end of paragraph');
</script> </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