Commit 251fc8a0 authored by yosin's avatar yosin Committed by Commit bot

Convert editing/deleting/delete-at-paragraph-boundaries-009.html to use w3c test harness

This patch converts "editing/deleting/delete-at-paragraph-boundaries-009.html"
to use w3c test harness to simplify test script and consolidates into
"delete_at_paragraph_boundaries.html", since there are similar test cases,
for improving readability.

BUG=n/a
TEST=n/a; no behavior changes

Review-Url: https://codereview.chromium.org/2297553002
Cr-Commit-Position: refs/heads/master@{#415584}
parent 0eb9a171
<html>
<head>
<style>
.editing {
border: 2px solid red;
font-size: 24px;
}
.explanation {
border: 2px solid blue;
padding: 12px;
font-size: 24px;
margin-bottom: 24px;
}
.scenario { margin-bottom: 16px;}
.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
.expected-results:first-line { font-weight: bold }
</style>
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script>
function editingTest() {
moveSelectionForwardByLineCommand();
extendSelectionForwardByLineCommand();
for (i = 0; i < 3; i++)
extendSelectionForwardByCharacterCommand();
deleteCommand();
}
</script>
<title>Editing Test</title>
</head>
<body>
<div class="explanation">
<div class="scenario">
Tests:
<br>
Deleting when a selection starts at the beginning of a
paragraph preceded by a text element and extends into the middle of a following paragraph.
</div>
<div class="expected-results">
Expected Results:
<br>
Should see the three lines in the red box. First line should be "one". Next one should be "ee". Next one should be "four". Insertion point should be blinking at the start of the second line.
</div>
</div>
<div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
<div id="test" class="editing">
one
<p style="margin-top: 0; margin-bottom: 0">two</p>
<p style="margin-top: 0; margin-bottom: 0">three</p>
<p style="margin-top: 0; margin-bottom: 0">four</p>
</div>
</div>
<script>
runEditingTest();
</script>
</body>
</html>
...@@ -137,4 +137,22 @@ ...@@ -137,4 +137,22 @@
'</div>', '</div>',
].join('')), ].join('')),
'Deleting when a selection starts in the middle of the last paragraph and extends to the end of that paragraph'); 'Deleting when a selection starts in the middle of the last paragraph and extends to the end of that paragraph');
test(() => assert_selection(
[
'<div contenteditable>',
'<div>',
'one<p>^two</p><p>thr|ee</p><p>four</p>',
'</div>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
// TODO(yosin): We should revise "delete" command not have BR
// after "four".
'one<p>|ee</p><p>four<br></p>',
'</div>',
].join('')),
'Deleting when a selection starts at the beginning of a paragraph preceded by a text element and extends into the middle of a following paragraph.');
</script> </script>
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
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 {DIV} at (0,0) size 784x238 [border: (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (14,14) size 756x83
LayoutText {#text} at (0,0) size 64x26
text run at (0,0) width 64: "Tests: "
LayoutBR {BR} at (0,0) size 0x0
LayoutText {#text} at (0,27) size 749x55
text run at (0,27) width 749: "Deleting when a selection starts at the beginning of a paragraph preceded by a"
text run at (0,55) width 637: "text element and extends into the middle of a following paragraph."
LayoutBlockFlow {DIV} at (14,113) size 756x111
LayoutText {#text} at (0,0) size 189x26
text run at (0,0) width 189: "Expected Results: "
LayoutBR {BR} at (189,21) size 0x0
LayoutText {#text} at (0,27) size 738x83
text run at (0,27) width 738: "Should see the three lines in the red box. First line should be \"one\". Next one"
text run at (0,55) width 152: "should be \"ee\". "
text run at (152,55) width 585: "Next one should be \"four\". Insertion point should be blinking"
text run at (0,83) width 284: "at the start of the second line."
LayoutBlockFlow {DIV} at (0,262) size 784x88
LayoutBlockFlow {DIV} at (0,0) size 784x88 [border: (2px solid #FF0000)]
LayoutBlockFlow (anonymous) at (2,2) size 780x28
LayoutText {#text} at (0,0) size 35x27
text run at (0,0) width 35: "one"
LayoutBlockFlow {P} at (2,30) size 780x28
LayoutText {#text} at (0,0) size 22x27
text run at (0,0) width 22: "ee"
LayoutBlockFlow {P} at (2,58) size 780x28
LayoutText {#text} at (0,0) size 40x27
text run at (0,0) width 40: "four"
caret: position 0 of child 0 {#text} of child 1 {P} of child 1 {DIV} of child 3 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
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 {DIV} at (0,0) size 784x240 [border: (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (14,14) size 756x84
LayoutText {#text} at (0,0) size 66x28
text run at (0,0) width 66: "Tests: "
LayoutBR {BR} at (0,0) size 0x0
LayoutText {#text} at (0,28) size 750x56
text run at (0,28) width 750: "Deleting when a selection starts at the beginning of a paragraph preceded by a"
text run at (0,56) width 640: "text element and extends into the middle of a following paragraph."
LayoutBlockFlow {DIV} at (14,114) size 756x112
LayoutText {#text} at (0,0) size 190x28
text run at (0,0) width 190: "Expected Results: "
LayoutBR {BR} at (189,22) size 1x0
LayoutText {#text} at (0,28) size 741x84
text run at (0,28) width 741: "Should see the three lines in the red box. First line should be \"one\". Next one"
text run at (0,56) width 152: "should be \"ee\". "
text run at (151,56) width 590: "Next one should be \"four\". Insertion point should be blinking"
text run at (0,84) width 282: "at the start of the second line."
LayoutBlockFlow {DIV} at (0,264) size 784x88
LayoutBlockFlow {DIV} at (0,0) size 784x88 [border: (2px solid #FF0000)]
LayoutBlockFlow (anonymous) at (2,2) size 780x28
LayoutText {#text} at (0,0) size 35x28
text run at (0,0) width 35: "one"
LayoutBlockFlow {P} at (2,30) size 780x28
LayoutText {#text} at (0,0) size 22x28
text run at (0,0) width 22: "ee"
LayoutBlockFlow {P} at (2,58) size 780x28
LayoutText {#text} at (0,0) size 40x28
text run at (0,0) width 40: "four"
caret: position 0 of child 0 {#text} of child 1 {P} of child 1 {DIV} of child 3 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
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 {DIV} at (0,0) size 784x233 [border: (2px solid #0000FF)]
LayoutBlockFlow {DIV} at (14,14) size 756x81
LayoutText {#text} at (0,0) size 66x26
text run at (0,0) width 66: "Tests: "
LayoutBR {BR} at (0,0) size 0x0
LayoutText {#text} at (0,27) size 750x53
text run at (0,27) width 750: "Deleting when a selection starts at the beginning of a paragraph preceded by a"
text run at (0,54) width 640: "text element and extends into the middle of a following paragraph."
LayoutBlockFlow {DIV} at (14,111) size 756x108
LayoutText {#text} at (0,0) size 190x26
text run at (0,0) width 190: "Expected Results: "
LayoutBR {BR} at (189,21) size 1x0
LayoutText {#text} at (0,27) size 741x80
text run at (0,27) width 741: "Should see the three lines in the red box. First line should be \"one\". Next one"
text run at (0,54) width 152: "should be \"ee\". "
text run at (151,54) width 590: "Next one should be \"four\". Insertion point should be blinking"
text run at (0,81) width 282: "at the start of the second line."
LayoutBlockFlow {DIV} at (0,257) size 784x85
LayoutBlockFlow {DIV} at (0,0) size 784x85 [border: (2px solid #FF0000)]
LayoutBlockFlow (anonymous) at (2,2) size 780x27
LayoutText {#text} at (0,0) size 35x26
text run at (0,0) width 35: "one"
LayoutBlockFlow {P} at (2,29) size 780x27
LayoutText {#text} at (0,0) size 22x26
text run at (0,0) width 22: "ee"
LayoutBlockFlow {P} at (2,56) size 780x27
LayoutText {#text} at (0,0) size 40x26
text run at (0,0) width 40: "four"
caret: position 0 of child 0 {#text} of child 1 {P} of child 1 {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