Commit 4279cdda authored by yosin's avatar yosin Committed by Commit bot

Convert editing/deleting/merge-paragraph-from-h6*.html to use w3c test harness

This patch converts "editing/deleting/merge-paragraph-from-h6*.html" to use w3c
test harness to simplify test script, and consolidates into
"merge_paragraph_from_h6.html" since these test scripts use similar test sample,
for improving code health.

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

Review-Url: https://codereview.chromium.org/2336173002
Cr-Commit-Position: refs/heads/master@{#418501}
parent 2b726fa6
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
This tests deleting line break before h6.
WebKit should not cancel styles added by h6 by those of document's default style.
| "
hello<#selection-caret>world"
| "
"
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
This tests deleting line break before h6.
WebKit should not cancel styles added by h6 by those of document's default style but still keep "hello" italicized and "world" in red.
| "
"
| <em>
| "hello<#selection-caret>"
| <span>
| style="color: red;"
| "world"
| "
"
<!DOCTYPE html>
<html>
<body>
<p id="description">This tests deleting line break before h6.
WebKit should not cancel styles added by h6 by those of document's default style but still keep "hello" italicized and "world" in red.</p>
<div id="test" contenteditable>
<em>hello</em>
<h6><font color="blue" style="color:red">world</font></h6>
</div>
</div>
<script src="../editing.js"></script>
<script src="../../resources/dump-as-markup.js"></script>
<script>
function editingTest() {
moveSelectionForwardByLineCommand();
deleteCommand();
Markup.description(document.getElementById('description').textContent);
Markup.dump('test');
}
runEditingTest();
</script>
</body>
</html>
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
This tests deleting line break before h6.
WebKit should not cancel styles added by h6 by those of document's default style but still keep "hello" italicized and "world" in red.
| "
"
| <em>
| "hello<#selection-caret>"
| <span>
| style="color: red;"
| "world"
| "
"
<!DOCTYPE html>
<html>
<body>
<p id="description">This tests deleting line break before h6.
WebKit should not cancel styles added by h6 by those of document's default style but still keep "hello" italicized and "world" in red.</p>
<div id="test" contenteditable>
<em>hello</em>
<h6><font color="red">world</font></h6>
</div>
</div>
<script src="../editing.js"></script>
<script src="../../resources/dump-as-markup.js"></script>
<script>
function editingTest() {
moveSelectionForwardByLineCommand();
deleteCommand();
Markup.description(document.getElementById('description').textContent);
Markup.dump('test');
}
runEditingTest();
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<p id="description">This tests deleting line break before h6.
WebKit should not cancel styles added by h6 by those of document's default style.</p>
<div id="test" contenteditable>
hello
<h6>world</h6>
</div>
</div>
<script src="../editing.js"></script>
<script src="../../resources/dump-as-markup.js"></script>
<script>
function editingTest() {
moveSelectionForwardByLineCommand();
deleteCommand();
Markup.description(document.getElementById('description').textContent);
Markup.dump('test');
}
runEditingTest();
</script>
</body>
</html>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() =>assert_selection(
[
'<div contenteditable>',
'foo<h6>|bar</h6>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'foo|bar',
'</div>',
].join('')),
'1 deleting line break before H6');
test(() =>assert_selection(
[
'<div contenteditable>',
'<em>foo</em><h6><font color="red">|bar</font></h6>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<em>foo|</em><span style="color: red;">bar</span>',
'</div>',
].join('')),
'2 deleting line break before H6+FONT');
test(() =>assert_selection(
[
'<div contenteditable>',
'<em>foo</em><h6><font color="blue" style="color:red">|bar</font></h6>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<em>foo|</em><span style="color: red;">bar</span>',
'</div>',
].join('')),
'3 deleting line break before H6 with style');
</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