Commit 5d070ad7 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() for "editing/deleting/merge-whitespace-pre.html"

This patch changes "merge-whitespace-pre.html" to utilize |selection_test()| for
ease of maintenance.

Note: "merge-whitespace-pre.html" is failed on layout_ng bot due by pixel test.

Bug: 679977, 636993
Change-Id: Idb0840579c0c915d221aa242969518e18f62cbd5
Reviewed-on: https://chromium-review.googlesource.com/991494Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547891}
parent 816a2baf
<p>This test places the caret before the 'b' in 'bar' and Delete. Afterword, 'foobar' should be in the first paragraph and 'baz' should be in the second.</p> <!doctype HTML>
<div contenteditable="true"> <script src="../../resources/testharness.js"></script>
<div>foo</div> <script src="../../resources/testharnessreport.js"></script>
<pre id="test">bar <script src="../assert_selection.js"></script>
baz</pre>
</div>
<script> <script>
var s = window.getSelection(); selection_test(
var e = document.getElementById("test"); [
s.collapse(e, 0); '<div contenteditable>',
document.execCommand("Delete"); '<div>foo</div>',
'<pre>|bar\nbaz</pre>',
'</div>',
],
'Delete',
[
'<div contenteditable>',
'<div>foo|bar</div>',
'<pre>baz</pre>',
'</div>',
],
'Delete to merge whitespaces');
</script> </script>
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 784x579
LayoutBlockFlow {P} at (0,0) size 784x40
LayoutText {#text} at (0,0) size 743x39
text run at (0,0) width 364: "This test places the caret before the 'b' in 'bar' and Delete. "
text run at (364,0) width 379: "Afterword, 'foobar' should be in the first paragraph and 'baz'"
text run at (0,20) width 152: "should be in the second."
LayoutBlockFlow {DIV} at (0,56) size 784x49
LayoutBlockFlow {DIV} at (0,0) size 784x20
LayoutText {#text} at (0,0) size 41x19
text run at (0,0) width 41: "foobar"
LayoutBlockFlow {PRE} at (0,33) size 784x16
LayoutText {#text} at (0,0) size 24x16
text run at (0,0) width 24: "baz"
caret: position 3 of child 0 {#text} of child 1 {DIV} of child 2 {DIV} of body
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 784x579
LayoutBlockFlow {P} at (0,0) size 784x36
LayoutText {#text} at (0,0) size 755x36
text run at (0,0) width 371: "This test places the caret before the 'b' in 'bar' and Delete. "
text run at (370,0) width 385: "Afterword, 'foobar' should be in the first paragraph and 'baz'"
text run at (0,18) width 155: "should be in the second."
LayoutBlockFlow {DIV} at (0,52) size 784x46
LayoutBlockFlow {DIV} at (0,0) size 784x18
LayoutText {#text} at (0,0) size 42x18
text run at (0,0) width 42: "foobar"
LayoutBlockFlow {PRE} at (0,31) size 784x15
LayoutText {#text} at (0,0) size 24x15
text run at (0,0) width 24: "baz"
caret: position 3 of child 0 {#text} of child 1 {DIV} of child 2 {DIV} of body
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 784x579
LayoutBlockFlow {P} at (0,0) size 784x40
LayoutText {#text} at (0,0) size 777x39
text run at (0,0) width 352: "This test places the caret before the 'b' in 'bar' and Delete. "
text run at (352,0) width 425: "Afterword, 'foobar' should be in the first paragraph and 'baz' should be"
text run at (0,20) width 83: "in the second."
LayoutBlockFlow {DIV} at (0,56) size 784x49
LayoutBlockFlow {DIV} at (0,0) size 784x20
LayoutText {#text} at (0,0) size 40x19
text run at (0,0) width 40: "foobar"
LayoutBlockFlow {PRE} at (0,33) size 784x16
LayoutText {#text} at (0,0) size 24x16
text run at (0,0) width 24: "baz"
caret: position 3 of child 0 {#text} of child 1 {DIV} of child 2 {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