Commit ba49be21 authored by yosin's avatar yosin Committed by Commit bot

Convert editing/insert-div-22.html to use w3c test harness

This patch converts "editing/insert-div-22.html" to use w3c test harness to
simplify test files.

This patch is a preparation of getting rid of grammar checking feature.

BUG=619452
TEST=n/a; this patch changes a test file

Review-Url: https://codereview.chromium.org/2178863002
Cr-Commit-Position: refs/heads/master@{#407670}
parent be517ca4
<html>
<head>
<style>
body {
font-size: 24px;
}
.editing {
border: 2px solid red;
padding: 12px;
}
p {
border: 2px solid blue;
padding: 12px;
}
br {
background-color: green;
}
</style>
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
function editingTest() {
for (i = 0; i < 3; i++)
moveSelectionForwardByCharacterCommand();
insertParagraphCommand();
typeCharacterCommand();
}
test(() => assert_selection(
[
'<div contenteditable>',
'<p id="test"><b>foo|</b><br>bar</p>',
'</div>',
].join(''),
selection => {
selection.document.execCommand('insertParagraph');
selection.document.execCommand('insertText', false, 'x');
},
[
'<div contenteditable>',
'<p id="test"><b>foo</b></p>',
'<p id="test"><b>x|<br></b>bar</p>',
'</div>',
].join('')),
'Insert "x" before BR, since insertParagraph puts caret before BR');
</script>
<title>Editing Test</title>
</head>
<body contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
Test inserting paragraphs: should see "foo" in a blue box, then a blue box with with two lines in it: First line a bold "x"; second line a non-bold "bar". Fix for this bug:
<a href="rdar://problem/3924579">&lt;rdar://problem/3927554&gt;</a> Style info applied to remainder of document after a newline is entered
<div style="height: 12px"></div>
<p id="test"><b>foo</b><br>bar</p>
<script>
runEditingTest();
</script>
</body>
</html>
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 784x568
LayoutBlockFlow (anonymous) at (0,0) size 784x112
LayoutText {#text} at (0,0) size 784x83
text run at (0,0) width 747: "Test inserting paragraphs: should see \"foo\" in a blue box, then a blue box with"
text run at (746,0) width 7: " "
text run at (0,28) width 780: "with two lines in it: First line a bold \"x\"; second line a non-bold \"bar\". Fix for this"
text run at (780,28) width 4: " "
text run at (0,56) width 47: "bug: "
LayoutInline {A} at (0,0) size 257x27 [color=#0000EE]
LayoutText {#text} at (47,56) size 257x27
text run at (47,56) width 257: "<rdar://problem/3927554>"
LayoutText {#text} at (304,56) size 784x55
text run at (304,56) width 480: " Style info applied to remainder of document after"
text run at (784,56) width 0: " "
text run at (0,84) width 191: "a newline is entered"
LayoutBlockFlow {DIV} at (0,112) size 784x12
LayoutBlockFlow {P} at (0,148) size 784x55 [border: (2px solid #0000FF)]
LayoutInline {B} at (0,0) size 31x26
LayoutText {#text} at (14,14) size 31x26
text run at (14,14) width 31: "foo"
LayoutBlockFlow {P} at (0,227) size 784x83 [border: (2px solid #0000FF)]
LayoutInline {B} at (0,0) size 12x26
LayoutText {#text} at (14,14) size 12x26
text run at (14,14) width 12: "x"
LayoutBR {BR} at (26,35) size 0x0 [bgcolor=#008000]
LayoutText {#text} at (14,41) size 31x27
text run at (14,41) width 31: "bar"
caret: position 1 of child 0 {#text} of child 0 {B} of child 6 {P} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 784x568
LayoutBlockFlow (anonymous) at (0,0) size 784x112
LayoutText {#text} at (0,0) size 757x84
text run at (0,0) width 751: "Test inserting paragraphs: should see \"foo\" in a blue box, then a blue box with"
text run at (750,0) width 7: " "
text run at (0,28) width 747: "with two lines in it: First line a bold \"x\"; second line a non-bold \"bar\". Fix for"
text run at (746,28) width 7: " "
text run at (0,56) width 90: "this bug: "
LayoutInline {A} at (0,0) size 257x28 [color=#0000EE]
LayoutText {#text} at (89,56) size 257x28
text run at (89,56) width 257: "<rdar://problem/3927554>"
LayoutText {#text} at (345,56) size 783x56
text run at (345,56) width 432: " Style info applied to remainder of document"
text run at (776,56) width 7: " "
text run at (0,84) width 242: "after a newline is entered"
LayoutBlockFlow {DIV} at (0,112) size 784x12
LayoutBlockFlow {P} at (0,148) size 784x56 [border: (2px solid #0000FF)]
LayoutInline {B} at (0,0) size 32x28
LayoutText {#text} at (14,14) size 32x28
text run at (14,14) width 32: "foo"
LayoutBlockFlow {P} at (0,228) size 784x84 [border: (2px solid #0000FF)]
LayoutInline {B} at (0,0) size 12x28
LayoutText {#text} at (14,14) size 12x28
text run at (14,14) width 12: "x"
LayoutBR {BR} at (26,36) size 0x0 [bgcolor=#008000]
LayoutText {#text} at (14,42) size 31x28
text run at (14,42) width 31: "bar"
caret: position 1 of child 0 {#text} of child 0 {B} of child 6 {P} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 784x568
LayoutBlockFlow (anonymous) at (0,0) size 784x108
LayoutText {#text} at (0,0) size 757x80
text run at (0,0) width 751: "Test inserting paragraphs: should see \"foo\" in a blue box, then a blue box with"
text run at (750,0) width 7: " "
text run at (0,27) width 747: "with two lines in it: First line a bold \"x\"; second line a non-bold \"bar\". Fix for"
text run at (746,27) width 7: " "
text run at (0,54) width 90: "this bug: "
LayoutInline {A} at (0,0) size 257x26 [color=#0000EE]
LayoutText {#text} at (89,54) size 257x26
text run at (89,54) width 257: "<rdar://problem/3927554>"
LayoutText {#text} at (345,54) size 783x53
text run at (345,54) width 432: " Style info applied to remainder of document"
text run at (776,54) width 7: " "
text run at (0,81) width 242: "after a newline is entered"
LayoutBlockFlow {DIV} at (0,108) size 784x12
LayoutBlockFlow {P} at (0,144) size 784x55 [border: (2px solid #0000FF)]
LayoutInline {B} at (0,0) size 32x26
LayoutText {#text} at (14,14) size 32x26
text run at (14,14) width 32: "foo"
LayoutBlockFlow {P} at (0,223) size 784x82 [border: (2px solid #0000FF)]
LayoutInline {B} at (0,0) size 12x26
LayoutText {#text} at (14,14) size 12x26
text run at (14,14) width 12: "x"
LayoutBR {BR} at (26,35) size 0x0 [bgcolor=#008000]
LayoutText {#text} at (14,41) size 31x26
text run at (14,41) width 31: "bar"
caret: position 1 of child 0 {#text} of child 0 {B} of child 6 {P} 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