Commit 98fc2a89 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() for "editing/inserting/5418891.html"

This patch changes "5418891.html" to utilize |selection_test()| for ease of
maintenance.

Following patch will rename "5418891.html" to
"break_blockquote_at_end_of_content.html".

Bug: 679977

Change-Id: I753287bf7be767e48f3547a2ecc319930a57a9a0
Reviewed-on: https://chromium-review.googlesource.com/999223Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548727}
parent bb6b1ac7
<style>
blockquote {
color: blue;
border-left: 2px solid blue;
padding-left: 5px;
margin: 0px;
}
</style>
<p>This tests for a crash when attempting to break a blockquote at the end of its content. The caret should be in the first of two empty paragraphs between two pieces of quoted content.</p>
<div contenteditable="true">
<blockquote type="cite"><div id="dv">foo</div></blockquote>
<br>
<blockquote type="cite"><div>bar</div></blockquote>
</div>
<!doctype HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
dv = document.getElementById("dv");
text = dv.firstChild;
s = window.getSelection();
s.collapse(text, 3);
document.execCommand("InsertNewlineInQuotedContent");
// This tests for a crash when attempting to break a blockquote at the end of
// its content.
selection_test(
[
'<div contenteditable>',
'<blockquote type="cite"><div>foo|</div></blockquote><br>',
'<blockquote type="cite"><div>bar</div></blockquote>',
'</div>',
],
'InsertNewlineInQuotedContent',
[
'<div contenteditable>',
'<blockquote type="cite"><div>foo</div></blockquote>|<br>',
'<br>',
'<blockquote type="cite"><div>bar</div></blockquote>',
'</div>',
],
'Break BLOCKQUOTE at the end of its content');
</script>
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutNGBlockFlow {HTML} at (0,0) size 800x600
LayoutNGBlockFlow {BODY} at (8,8) size 784x584
LayoutNGBlockFlow {P} at (0,0) size 784x40
LayoutText {#text} at (0,0) size 772x39
text run at (0,0) width 772: "This tests for a crash when attempting to break a blockquote at the end of its content. The caret should be in the first of two"
text run at (0,20) width 358: "empty paragraphs between two pieces of quoted content."
LayoutBlockFlow {DIV} at (0,56) size 784x80
LayoutBlockFlow {BLOCKQUOTE} at (0,0) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (7,0) size 777x20
LayoutText {#text} at (0,0) size 21x19
text run at (0,0) width 21: "foo"
LayoutNGBlockFlow (anonymous) at (0,20) size 769x40
LayoutBR {BR} at (0,0) size 0x19
LayoutBR {BR} at (0,20) size 0x19
LayoutBlockFlow {BLOCKQUOTE} at (0,60) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (7,0) size 777x20
LayoutText {#text} at (0,0) size 20x19
text run at (0,0) width 20: "bar"
caret: position 0 of child 2 {BR} 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 784x584
LayoutBlockFlow {P} at (0,0) size 784x40
LayoutText {#text} at (0,0) size 772x39
text run at (0,0) width 536: "This tests for a crash when attempting to break a blockquote at the end of its content. "
text run at (536,0) width 236: "The caret should be in the first of two"
text run at (0,20) width 358: "empty paragraphs between two pieces of quoted content."
LayoutBlockFlow {DIV} at (0,56) size 784x80
LayoutBlockFlow {BLOCKQUOTE} at (0,0) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (7,0) size 777x20
LayoutText {#text} at (0,0) size 21x19
text run at (0,0) width 21: "foo"
LayoutBlockFlow (anonymous) at (0,20) size 784x40
LayoutBR {BR} at (0,0) size 0x19
LayoutBR {BR} at (0,20) size 0x19
LayoutBlockFlow {BLOCKQUOTE} at (0,60) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (7,0) size 777x20
LayoutText {#text} at (0,0) size 20x19
text run at (0,0) width 20: "bar"
caret: position 0 of child 2 {BR} 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 784x584
LayoutBlockFlow {P} at (0,0) size 784x36
LayoutText {#text} at (0,0) size 760x36
text run at (0,0) width 548: "This tests for a crash when attempting to break a blockquote at the end of its content. "
text run at (547,0) width 213: "The caret should be in the first of"
text run at (0,18) width 392: "two empty paragraphs between two pieces of quoted content."
LayoutBlockFlow {DIV} at (0,52) size 784x72
LayoutBlockFlow {BLOCKQUOTE} at (0,0) size 784x18 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (7,0) size 777x18
LayoutText {#text} at (0,0) size 22x18
text run at (0,0) width 22: "foo"
LayoutBlockFlow (anonymous) at (0,18) size 784x36
LayoutBR {BR} at (0,0) size 0x18
LayoutBR {BR} at (0,18) size 0x18
LayoutBlockFlow {BLOCKQUOTE} at (0,54) size 784x18 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (7,0) size 777x18
LayoutText {#text} at (0,0) size 21x18
text run at (0,0) width 21: "bar"
caret: position 0 of child 2 {BR} 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 784x584
LayoutBlockFlow {P} at (0,0) size 784x40
LayoutText {#text} at (0,0) size 781x39
text run at (0,0) width 516: "This tests for a crash when attempting to break a blockquote at the end of its content. "
text run at (516,0) width 265: "The caret should be in the first of two empty"
text run at (0,20) width 305: "paragraphs between two pieces of quoted content."
LayoutBlockFlow {DIV} at (0,56) size 784x80
LayoutBlockFlow {BLOCKQUOTE} at (0,0) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (7,0) size 777x20
LayoutText {#text} at (0,0) size 20x19
text run at (0,0) width 20: "foo"
LayoutBlockFlow (anonymous) at (0,20) size 784x40
LayoutBR {BR} at (0,0) size 0x19
LayoutBR {BR} at (0,20) size 0x19
LayoutBlockFlow {BLOCKQUOTE} at (0,60) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (7,0) size 777x20
LayoutText {#text} at (0,0) size 20x19
text run at (0,0) width 20: "bar"
caret: position 0 of child 2 {BR} 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