Commit 7ae09b46 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Rewrite editing/pasteboard/5032095.html to use selection_test()

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

Note: Following patch will rename this file to
"insert_html_at_end_of_paragraph.html".

This patch is a preparation for the patch[1].

[1] http://crrev.com/c/737981 Introduce TextOffsetMapping to simplify
word/paragraph selection

Bug: 679977
Change-Id: Ie25f8ffc08c581a52ecab0ab7f3cb715f95021a6
Reviewed-on: https://chromium-review.googlesource.com/892552Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533120}
parent 0ca8e1ee
<p>This tests for a bug where content pasted at the end of a paragraph would be inserted into the next paragraph. You should see 'helloworld' below.</p> <!doctype html>
<div id="div" contenteditable="true">hello</div> <script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script> <script>
var div = document.getElementById("div"); // This tests for a bug where content pasted at the end of a paragraph would be
var sel = window.getSelection(); // inserted into the next paragraph. You should see 'helloworld' below.
sel.collapse(div, 0); selection_test(
sel.modify("move", "forward", "word"); '<div contenteditable>hello|</div>',
document.execCommand("InsertHTML", false, "<span><div>world</div></span>"); 'InsertHTML <span><div>world</div></span>',
'<div contenteditable>helloworld|</div>',
'InsertHTML at end of a paragraph');
</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 784x584
LayoutBlockFlow {P} at (0,0) size 784x40
LayoutText {#text} at (0,0) size 763x39
text run at (0,0) width 690: "This tests for a bug where content pasted at the end of a paragraph would be inserted into the next paragraph. "
text run at (690,0) width 73: "You should"
text run at (0,20) width 144: "see 'helloworld' below."
LayoutBlockFlow {DIV} at (0,56) size 784x20
LayoutText {#text} at (0,0) size 68x19
text run at (0,0) width 68: "helloworld"
caret: position 10 of child 0 {#text} 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 775x36
text run at (0,0) width 702: "This tests for a bug where content pasted at the end of a paragraph would be inserted into the next paragraph. "
text run at (701,0) width 74: "You should"
text run at (0,18) width 146: "see 'helloworld' below."
LayoutBlockFlow {DIV} at (0,52) size 784x18
LayoutText {#text} at (0,0) size 70x18
text run at (0,0) width 70: "helloworld"
caret: position 10 of child 0 {#text} 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 755x39
text run at (0,0) width 663: "This tests for a bug where content pasted at the end of a paragraph would be inserted into the next paragraph. "
text run at (663,0) width 92: "You should see"
text run at (0,20) width 113: "'helloworld' below."
LayoutBlockFlow {DIV} at (0,56) size 784x20
LayoutText {#text} at (0,0) size 63x19
text run at (0,0) width 63: "helloworld"
caret: position 10 of child 0 {#text} 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