Commit 879adbf5 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() in "editing/selection/extend-by-sentence-001.html"

This patch changes "extend-by-sentence-001.html" to utilize |selection_test()|
for ease of maintenance.

Bug: 679977
Change-Id: Ia7035dc7d2deb476e75d62e71f33942a0ecff124
Reviewed-on: https://chromium-review.googlesource.com/989458Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547602}
parent 6f18e1f5
<html>
<head>
<style>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
.cell {
padding: 12px;
font-size: 24px;
height: 48px;
}
</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>
selection_test(
[
'<div contenteditable>',
'<frijole style="display:block;">one two three</frijole>',
'<doodad style="display:block;">four| five six</doodad>',
'</div>',
],
selection => selection.modify('move', 'backward', 'sentence'),
[
'<div contenteditable>',
'<frijole style="display:block;">one two three</frijole>',
'<doodad style="display:block;">|four five six</doodad>',
'</div>',
],
'1 move backward sentence');
function editingTest() {
moveSelectionForwardByLineCommand();
moveSelectionForwardByWordCommand();
moveSelectionBackwardBySentenceCommand();
extendSelectionForwardBySentenceCommand();
}
</script>
<title>Editing Test</title>
</head>
<body>
<div contenteditable id="root" class="editing">
<frijole style="display:block;" id="test">one two three<frijole>
<doodad style="display:block;">four five six</doodad>
<script>
runEditingTest();
selection_test(
[
'<div contenteditable>',
'<frijole style="display:block;">one two three</frijole>',
'<doodad style="display:block;">|four five six</doodad>',
'</div>',
],
selection => selection.modify('extend', 'forward', 'sentence'),
[
'<div contenteditable>',
'<frijole style="display:block;">one two three</frijole>',
'<doodad style="display:block;">^four five six|</doodad>',
'</div>',
],
'2 extend forkward sentence');
</script>
</body>
</html>
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
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 784x84 [border: (2px solid #FF0000)]
LayoutBlockFlow {FRIJOLE} at (14,14) size 756x56
LayoutBlockFlow (anonymous) at (0,0) size 756x28
LayoutText {#text} at (0,0) size 132x27
text run at (0,0) width 132: "one two three"
LayoutInline {FRIJOLE} at (0,0) size 0x27
LayoutText {#text} at (0,0) size 0x0
LayoutBlockFlow (anonymous) at (0,28) size 756x28
LayoutBlockFlow {DOODAD} at (0,0) size 756x28
LayoutText {#text} at (0,0) size 118x27
text run at (0,0) width 118: "four five six"
LayoutBlockFlow (anonymous) at (0,56) size 756x0
LayoutInline {FRIJOLE} at (0,0) size 0x0
selection start: position 0 of child 0 {#text} of child 1 {DOODAD} of child 1 {FRIJOLE} of child 1 {FRIJOLE} of child 1 {DIV} of body
selection end: position 13 of child 0 {#text} of child 1 {DOODAD} of child 1 {FRIJOLE} of child 1 {FRIJOLE} of child 1 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
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 784x84 [border: (2px solid #FF0000)]
LayoutBlockFlow {FRIJOLE} at (14,14) size 756x56
LayoutBlockFlow (anonymous) at (0,0) size 756x28
LayoutText {#text} at (0,0) size 131x28
text run at (0,0) width 131: "one two three"
LayoutInline {FRIJOLE} at (0,0) size 1x28
LayoutText {#text} at (0,0) size 0x0
LayoutBlockFlow (anonymous) at (0,28) size 756x28
LayoutBlockFlow {DOODAD} at (0,0) size 756x28
LayoutText {#text} at (0,0) size 116x28
text run at (0,0) width 116: "four five six"
LayoutBlockFlow (anonymous) at (0,56) size 756x0
LayoutInline {FRIJOLE} at (0,0) size 0x0
selection start: position 0 of child 0 {#text} of child 1 {DOODAD} of child 1 {FRIJOLE} of child 1 {FRIJOLE} of child 1 {DIV} of body
selection end: position 13 of child 0 {#text} of child 1 {DOODAD} of child 1 {FRIJOLE} of child 1 {FRIJOLE} of child 1 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
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 784x84 [border: (2px solid #FF0000)]
LayoutBlockFlow {FRIJOLE} at (14,14) size 756x56
LayoutBlockFlow (anonymous) at (0,0) size 756x28
LayoutText {#text} at (0,0) size 132x27
text run at (0,0) width 132: "one two three"
LayoutInline {FRIJOLE} at (0,0) size 0x27
LayoutText {#text} at (0,0) size 0x0
LayoutBlockFlow (anonymous) at (0,28) size 756x28
LayoutBlockFlow {DOODAD} at (0,0) size 756x28
LayoutText {#text} at (0,0) size 116x27
text run at (0,0) width 116: "four five six"
LayoutBlockFlow (anonymous) at (0,56) size 756x0
LayoutInline {FRIJOLE} at (0,0) size 0x0
selection start: position 0 of child 0 {#text} of child 1 {DOODAD} of child 1 {FRIJOLE} of child 1 {FRIJOLE} of child 1 {DIV} of body
selection end: position 13 of child 0 {#text} of child 1 {DOODAD} of child 1 {FRIJOLE} of child 1 {FRIJOLE} of child 1 {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