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

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

This patch converts "editing/deleting/delete-at-paragraph-boundaries-008.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/2280473004
Cr-Commit-Position: refs/heads/master@{#414345}
parent 34ee7e00
<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();
moveSelectionForwardByLineCommand();
moveSelectionForwardByLineCommand();
for (i = 0; i < 2; i++)
moveSelectionForwardByCharacterCommand();
for (i = 0; i < 2; i++)
extendSelectionForwardByCharacterCommand();
deleteCommand();
}
</script>
<title>Editing Test</title>
</head>
<body>
<div class="explanation">
<div class="scenario">
Tests:
<br>
Deleting when a selection starts in the middle of the last paragraph and extends to the end of that paragraph
</div>
<div class="expected-results">
Expected Results:
<br>
Should see the four lines in the red box. First line should be "one". Next one should be "two". Next one should be "three". Last one should be "fo". Insertion point should be blinking at the start of the fourth (last) 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>
...@@ -118,4 +118,23 @@ ...@@ -118,4 +118,23 @@
'</div>', '</div>',
].join('')), ].join('')),
'Deleting when a selection starts at the beginning of a paragraph preceded by another block and extends into the middle of a following paragraph.'); 'Deleting when a selection starts at the beginning of a paragraph preceded by another block and extends into the middle of a following paragraph.');
test(() => assert_selection(
[
'<div contenteditable>',
'<div>',
'one<p>two</p><p>three</p><p>fo^ur|</p>',
'</div>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<div>',
'one<p>two</p><p>three</p><p>fo|</p>',
'</div>',
'</div>',
].join('')),
'Deleting when a selection starts in the middle of the last paragraph and extends to the end of that 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: 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 679x55
text run at (0,27) width 679: "Deleting when a selection starts in the middle of the last paragraph and"
text run at (0,55) width 347: "extends to the end of that 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 729x83
text run at (0,27) width 729: "Should see the four lines in the red box. First line should be \"one\". Next one"
text run at (0,55) width 166: "should be \"two\". "
text run at (166,55) width 506: "Next one should be \"three\". Last one should be \"fo\"."
text run at (0,83) width 658: "Insertion point should be blinking at the start of the fourth (last) line."
LayoutBlockFlow {DIV} at (0,262) size 784x116
LayoutBlockFlow {DIV} at (0,0) size 784x116 [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 36x27
text run at (0,0) width 36: "two"
LayoutBlockFlow {P} at (2,58) size 780x28
LayoutText {#text} at (0,0) size 49x27
text run at (0,0) width 49: "three"
LayoutBlockFlow {P} at (2,86) size 780x28
LayoutText {#text} at (0,0) size 20x27
text run at (0,0) width 20: "fo"
caret: position 2 of child 0 {#text} of child 5 {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: 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 682x56
text run at (0,28) width 682: "Deleting when a selection starts in the middle of the last paragraph and"
text run at (0,56) width 344: "extends to the end of that 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 733x84
text run at (0,28) width 733: "Should see the four lines in the red box. First line should be \"one\". Next one"
text run at (0,56) width 167: "should be \"two\". "
text run at (166,56) width 504: "Next one should be \"three\". Last one should be \"fo\"."
text run at (0,84) width 661: "Insertion point should be blinking at the start of the fourth (last) line."
LayoutBlockFlow {DIV} at (0,264) size 784x116
LayoutBlockFlow {DIV} at (0,0) size 784x116 [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 36x28
text run at (0,0) width 36: "two"
LayoutBlockFlow {P} at (2,58) size 780x28
LayoutText {#text} at (0,0) size 48x28
text run at (0,0) width 48: "three"
LayoutBlockFlow {P} at (2,86) size 780x28
LayoutText {#text} at (0,0) size 20x28
text run at (0,0) width 20: "fo"
caret: position 2 of child 0 {#text} of child 5 {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: 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 682x53
text run at (0,27) width 682: "Deleting when a selection starts in the middle of the last paragraph and"
text run at (0,54) width 344: "extends to the end of that 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 733x80
text run at (0,27) width 733: "Should see the four lines in the red box. First line should be \"one\". Next one"
text run at (0,54) width 167: "should be \"two\". "
text run at (166,54) width 504: "Next one should be \"three\". Last one should be \"fo\"."
text run at (0,81) width 661: "Insertion point should be blinking at the start of the fourth (last) line."
LayoutBlockFlow {DIV} at (0,257) size 784x112
LayoutBlockFlow {DIV} at (0,0) size 784x112 [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 36x26
text run at (0,0) width 36: "two"
LayoutBlockFlow {P} at (2,56) size 780x27
LayoutText {#text} at (0,0) size 48x26
text run at (0,0) width 48: "three"
LayoutBlockFlow {P} at (2,83) size 780x27
LayoutText {#text} at (0,0) size 20x26
text run at (0,0) width 20: "fo"
caret: position 2 of child 0 {#text} of child 5 {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