Commit 52e039ba authored by yosin's avatar yosin Committed by Commit bot

Convert editing/inserting/typing-00[1-3].html to use w3c test harness

This patch converts "editing/inserting/typing-00[1-3].html" to use w3c
test harness and consolidates into "typing.html" to simplify test case
for ease of maintenance.

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/2184503003
Cr-Commit-Position: refs/heads/master@{#407732}
parent 9fd091a1
<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 editingTest() {
for (i = 0; i < 3; i++) {
typeCharacterCommand();
}
for (i = 0; i < 2; i++) {
moveSelectionForwardByCharacterCommand();
}
for (i = 0; i < 3; i++) {
typeCharacterCommand();
}
for (i = 0; i < 2; i++) {
moveSelectionForwardByCharacterCommand();
}
for (i = 0; i < 3; i++) {
typeCharacterCommand();
}
}
</script>
<title>Editing Test</title>
</head>
<body>
<div contenteditable id="root" class="editing">
<span id="test">XXXX</span>
</div>
<script>
runEditingTest();
</script>
</body>
</html>
<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() {
moveNSpacesAndType(4);
}
</script>
<title>Editing Test</title>
</head>
<body>
<div contenteditable id="root" class="editing">
<span id="test">Foo <i> bar</i></span>
</div>
<script>
runEditingTest();
</script>
</body>
</html>
<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 typeWord(n) {
for (i = 0; i < n; i++)
typeCharacterCommand();
typeCharacterCommand(' ');
}
function editingTest() {
typeWord(4);
typeWord(1);
typeWord(2);
typeWord(4);
typeWord(6);
typeWord(5);
typeWord(6);
typeWord(3);
typeWord(2);
typeWord(4);
typeWord(3);
typeWord(3);
typeWord(2);
typeWord(1);
typeWord(5);
typeWord(12);
typeWord(8);
typeWord(3);
typeWord(4);
typeWord(5);
typeWord(2);
typeWord(3);
typeWord(4);
typeWord(4);
typeWord(5);
typeWord(6);
typeWord(3);
typeWord(2);
typeWord(4);
typeWord(3);
typeWord(3);
typeWord(2);
typeWord(6);
typeWord(5);
typeWord(6);
typeWord(3);
typeWord(2);
typeWord(4);
typeWord(3);
typeWord(3);
typeWord(2);
typeWord(1);
typeWord(5);
typeWord(12);
typeWord(8);
typeWord(3);
}
</script>
<title>Editing Test</title>
</head>
<body>
<div contenteditable id="root" class="editing">
<span id="test"></span>
</div>
<script>
runEditingTest();
</script>
</body>
</html>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() => assert_selection(
'<div contenteditable><span>|XXXX</span></div>',
selection => {
for (var i = 0; i < 3; ++i)
selection.document.execCommand('insertText', false, 'a');
for (var i = 0; i < 2; ++i)
selection.modify('move', 'forward', 'character');
for (var i = 0; i < 3; ++i)
selection.document.execCommand('insertText', false, 'b');
for (var i = 0; i < 2; ++i)
selection.modify('move', 'forward', 'character');
for (var i = 0; i < 3; ++i)
selection.document.execCommand('insertText', false, 'c');
},
'<div contenteditable><span>aaaXXbbbXXccc|</span></div>'),
'Typing simulation 1');
test(() => assert_selection(
'<div contenteditable>|Foo <i> bar</i></div>',
selection => {
for (var i = 0; i < 4; ++i)
selection.modify('move', 'forward', 'character');
for (var i = 0; i < 3; ++i)
selection.document.execCommand('insertText', false, 'x');
},
'<div contenteditable>Foo xxx|<i>bar</i></div>'),
'Typing simulation 2');
test(() => assert_selection(
'<div contenteditable><span>|</span></div>',
selection => {
function typeWord(n) {
for (var i = 0; i < n; ++i)
selection.document.execCommand('insertText', false, 'x');
selection.document.execCommand('insertText', false, ' ');
}
typeWord(4);
typeWord(1);
typeWord(2);
},
'<div contenteditable>xxxx x xx\u{00A0}|<span></span></div>'),
'Typing simulation 3');
</script>
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: 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 784x56 [border: (2px solid #FF0000)]
LayoutInline {SPAN} at (0,0) size 176x27
LayoutText {#text} at (14,14) size 176x27
text run at (14,14) width 176: "xxxXXxxxXXxxx"
caret: position 13 of child 0 {#text} of child 1 {SPAN} 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
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 784x56 [border: (2px solid #FF0000)]
LayoutInline {SPAN} at (0,0) size 113x27
LayoutText {#text} at (14,14) size 79x27
text run at (14,14) width 79: "Foo xxx"
LayoutInline {I} at (0,0) size 34x27
LayoutText {#text} at (93,14) size 34x27
text run at (93,14) width 34: "bar"
LayoutText {#text} at (0,0) size 0x0
caret: position 7 of child 0 {#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: 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: 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 784x56 [border: (2px solid #FF0000)]
LayoutInline {SPAN} at (0,0) size 178x28
LayoutText {#text} at (14,14) size 178x28
text run at (14,14) width 178: "xxxXXxxxXXxxx"
caret: position 13 of child 0 {#text} of child 1 {SPAN} 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
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 784x56 [border: (2px solid #FF0000)]
LayoutInline {SPAN} at (0,0) size 113x28
LayoutText {#text} at (14,14) size 80x28
text run at (14,14) width 80: "Foo xxx"
LayoutInline {I} at (0,0) size 34x28
LayoutText {#text} at (93,14) size 34x28
text run at (93,14) width 34: "bar"
LayoutText {#text} at (0,0) size 0x0
caret: position 7 of child 0 {#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: 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: 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 784x55 [border: (2px solid #FF0000)]
LayoutInline {SPAN} at (0,0) size 178x26
LayoutText {#text} at (14,14) size 178x26
text run at (14,14) width 178: "xxxXXxxxXXxxx"
caret: position 13 of child 0 {#text} of child 1 {SPAN} 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
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 784x55 [border: (2px solid #FF0000)]
LayoutInline {SPAN} at (0,0) size 113x26
LayoutText {#text} at (14,14) size 80x26
text run at (14,14) width 80: "Foo xxx"
LayoutInline {I} at (0,0) size 34x26
LayoutText {#text} at (93,14) size 34x26
text run at (93,14) width 34: "bar"
LayoutText {#text} at (0,0) size 0x0
caret: position 7 of child 0 {#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