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

Convert editing/inserting/typing-around-image-001.html to use w3c test harness

This patch converts "editing/inserting/typing-around-image-001.html" to use w3c
test harness to simplify test script for improving readability.

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

Review-Url: https://codereview.chromium.org/2291973002
Cr-Commit-Position: refs/heads/master@{#415258}
parent c7f4868a
<html>
<head>
<style>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
</style>
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script>
function moveNSpacesAndType(n) {
for (i = 0; i < n; i++) {
moveSelectionForwardByCharacterCommand();
}
for (i = 0; i < 3; i++) {
typeCharacterCommand();
}
}
function editingTest() {
typeCharacterCommand();
moveNSpacesAndType(1);
moveNSpacesAndType(1);
moveNSpacesAndType(1);
moveNSpacesAndType(1);
}
</script>
<title>Editing Test</title>
</head>
<body>
<div contenteditable id="root" class="editing">
<span id="test"><img src="../resources/abe.png"><img src="../resources/abe.png"> <img src="../resources/abe.png"></span>
</div>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
runEditingTest();
test(() => assert_selection(
[
'<div contenteditable>',
'|<img src="../resources/abe.png">',
'<img src="../resources/abe.png">',
' <img src="../resources/abe.png">',
'</div>',
].join(''),
selection => {
selection.document.execCommand('insertText', false, 'a');
selection.modify('move', 'forward', 'character');
selection.document.execCommand('insertText', false, 'bcd');
selection.modify('move', 'forward', 'character');
selection.document.execCommand('insertText', false, 'efg');
selection.modify('move', 'forward', 'character');
selection.document.execCommand('insertText', false, 'hij');
selection.modify('move', 'forward', 'character');
selection.document.execCommand('insertText', false, 'klm');
},
[
'<div contenteditable>',
'a<img src="../resources/abe.png">',
'bcd<img src="../resources/abe.png">',
'efg\u{00A0}hij<img src="../resources/abe.png">',
'klm|',
'</div>',
].join('')),
'insertText around image');
</script>
</body>
</html>
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 784x584
LayoutBlockFlow {DIV} at (0,0) size 784x138 [border: (2px solid #FF0000)]
LayoutInline {SPAN} at (0,0) size 390x27
LayoutText {#text} at (14,96) size 12x27
text run at (14,96) width 12: "x"
LayoutImage {IMG} at (26,14) size 76x103
LayoutText {#text} at (102,96) size 36x27
text run at (102,96) width 36: "xxx"
LayoutImage {IMG} at (138,14) size 76x103
LayoutText {#text} at (214,96) size 36x27
text run at (214,96) width 36: "xxx"
LayoutText {#text} at (250,96) size 42x27
text run at (250,96) width 42: " xxx"
LayoutImage {IMG} at (292,14) size 76x103
LayoutText {#text} at (368,96) size 36x27
text run at (368,96) width 36: "xxx"
caret: position 3 of child 7 {#text} of child 1 {SPAN} of child 1 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 784x584
LayoutBlockFlow {DIV} at (0,0) size 784x137 [border: (2px solid #FF0000)]
LayoutInline {SPAN} at (0,0) size 390x28
LayoutText {#text} at (14,95) size 12x28
text run at (14,95) width 12: "x"
LayoutImage {IMG} at (26,14) size 76x103
LayoutText {#text} at (102,95) size 36x28
text run at (102,95) width 36: "xxx"
LayoutImage {IMG} at (138,14) size 76x103
LayoutText {#text} at (214,95) size 36x28
text run at (214,95) width 36: "xxx"
LayoutText {#text} at (250,95) size 42x28
text run at (250,95) width 42: " xxx"
LayoutImage {IMG} at (292,14) size 76x103
LayoutText {#text} at (368,95) size 36x28
text run at (368,95) width 36: "xxx"
caret: position 3 of child 7 {#text} of child 1 {SPAN} of child 1 {DIV} of body
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
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 784x584
LayoutBlockFlow {DIV} at (0,0) size 784x137 [border: (2px solid #FF0000)]
LayoutInline {SPAN} at (0,0) size 390x26
LayoutText {#text} at (14,96) size 12x26
text run at (14,96) width 12: "x"
LayoutImage {IMG} at (26,14) size 76x103
LayoutText {#text} at (102,96) size 36x26
text run at (102,96) width 36: "xxx"
LayoutImage {IMG} at (138,14) size 76x103
LayoutText {#text} at (214,96) size 36x26
text run at (214,96) width 36: "xxx"
LayoutText {#text} at (250,96) size 42x26
text run at (250,96) width 42: " xxx"
LayoutImage {IMG} at (292,14) size 76x103
LayoutText {#text} at (368,96) size 36x26
text run at (368,96) width 36: "xxx"
caret: position 3 of child 7 {#text} of child 1 {SPAN} 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