Commit 147f981b authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() in editing/deleting/delete-line-016.html

This patch changes "editing/deleting/delete-line-016.html" to utilize
|selection_test()| to avoid using unnecessary reference images for ease of
maintenance and enabling new features, e.g. EditingNG, high-DPI font, etc.

Bug: 679977
Change-Id: I7ecc87274a67dad77e1433ad1abcc99cc1db6c23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2309610
Commit-Queue: Kent Tamura <tkent@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790255}
parent 54f71a32
<html>
<head>
<script src="../editing.js"></script>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
function editingTest() {
extendSelectionForwardByLineCommand();
deleteCommand();
}
// This tests deletion of an empty line starting inside a <div> element, but
// ending outside that element (just before a <br>). In this case, the <div>
// has no content inside it, but a min-height style prevents it from collapsing.
// If the deletion is successful, the result should have two lines, and the
// insertion point should be on the second line, at the end of the editable
// area
selection_test(
[
'<div contenteditable>',
'<div>a</div><div style="min-height:50px">^</div>|<br>',
'</div>',
],
'Delete',
[
'<div contenteditable>',
'<div>a</div><div style="min-height:50px">|<br></div>',
'</div>',
],
'Delete an empty line starting inside <div> but ending outside it');
</script>
</head>
<body>
<p>This tests deletion of an empty line starting inside a &lt;div&gt; element,
but ending outside that element (just before a &lt;br&gt;). In this case, the
&lt;div&gt; has no content inside it, but a min-height style prevents it from
collapsing. If the deletion is successful, the result should have two lines,
and the insertion point should be on the second line, at the end of the editable area.</p>
<div contenteditable>
<div>a</div><div id="test" style="min-height:50px"></div><br>
</div>
</body>
<script>runEditingTest()</script>
</html>
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584
LayoutBlockFlow {P} at (0,0) size 784x60
LayoutText {#text} at (0,0) size 767x59
text run at (0,0) width 767: "This tests deletion of an empty line starting inside a <div> element, but ending outside that element (just before a <br>). In"
text run at (0,20) width 766: "this case, the <div> has no content inside it, but a min-height style prevents it from collapsing. If the deletion is successful,"
text run at (0,40) width 725: "the result should have two lines, and the insertion point should be on the second line, at the end of the editable area."
LayoutBlockFlow {DIV} at (0,76) size 784x70
LayoutBlockFlow {DIV} at (0,0) size 784x20
LayoutText {#text} at (0,0) size 7x19
text run at (0,0) width 7: "a"
LayoutBlockFlow {DIV} at (0,20) size 784x50
LayoutBR {BR} at (0,0) size 0x19
caret: position 0 of child 0 {BR} of child 2 {DIV} of child 3 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584
LayoutBlockFlow {P} at (0,0) size 784x72
LayoutText {#text} at (0,0) size 779x72
text run at (0,0) width 770: "This tests deletion of an empty line starting inside a <div> element, but ending outside that element (just before a <br>)."
text run at (0,18) width 730: "In this case, the <div> has no content inside it, but a min-height style prevents it from collapsing. If the deletion is"
text run at (0,36) width 779: "successful, the result should have two lines, and the insertion point should be on the second line, at the end of the editable"
text run at (0,54) width 31: "area."
LayoutBlockFlow {DIV} at (0,88) size 784x68
LayoutBlockFlow {DIV} at (0,0) size 784x18
LayoutText {#text} at (0,0) size 8x18
text run at (0,0) width 8: "a"
LayoutBlockFlow {DIV} at (0,18) size 784x50
LayoutBR {BR} at (0,0) size 0x18
caret: position 0 of child 0 {BR} of child 2 {DIV} of child 3 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584
LayoutBlockFlow {P} at (0,0) size 784x60
LayoutText {#text} at (0,0) size 758x59
text run at (0,0) width 753: "This tests deletion of an empty line starting inside a <div> element, but ending outside that element (just before a <br>). In this"
text run at (0,20) width 758: "case, the <div> has no content inside it, but a min-height style prevents it from collapsing. If the deletion is successful, the result"
text run at (0,40) width 632: "should have two lines, and the insertion point should be on the second line, at the end of the editable area."
LayoutBlockFlow {DIV} at (0,76) size 784x70
LayoutBlockFlow {DIV} at (0,0) size 784x20
LayoutText {#text} at (0,0) size 7x19
text run at (0,0) width 7: "a"
LayoutBlockFlow {DIV} at (0,20) size 784x50
LayoutBR {BR} at (0,0) size 0x19
caret: position 0 of child 0 {BR} of child 2 {DIV} of child 3 {DIV} of body
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