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

Convert editing/inserting/insert-3654864-fix.html to use w3c test harness

This patch converts "editing/inserting/insert-3654864-fix.html" to use w3c test
harness to simplify test script, and renames to "replace_text_with_br.html" to
provide a hint what this test script verifies, for improving code health.

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

Review-Url: https://codereview.chromium.org/2332423004
Cr-Commit-Position: refs/heads/master@{#418526}
parent 0359b136
<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() {
selectAllCommand();
insertLineBreakCommand();
for (i = 0; i < 3; i++) {
typeCharacterCommand();
}
}
</script>
<title>Editing Test</title>
</head>
<body contenteditable id="root" class="editing">
<span id="test">Foo <i> bar</i></span>
<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>^foo bar|</div>',
'insertLineBreak',
'<div contenteditable><br>|<br></div>'),
'replace text with BR');
test(() => assert_selection(
'<div contenteditable>^foo <i> bar|</i></div>',
'insertLineBreak',
'<div contenteditable><br>|<br></div>'),
'replace text and I with BR');
</script>
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: 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 [border: (2px solid #FF0000)]
LayoutBR {BR} at (14,14) size 0x27
LayoutText {#text} at (14,42) size 36x27
text run at (14,42) width 36: "xxx"
LayoutText {#text} at (0,0) size 0x0
caret: position 3 of child 1 {#text} of body
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: 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 [border: (2px solid #FF0000)]
LayoutBR {BR} at (14,14) size 0x28
LayoutText {#text} at (14,42) size 36x28
text run at (14,42) width 36: "xxx"
LayoutText {#text} at (0,0) size 0x0
caret: position 3 of child 1 {#text} of body
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: 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 [border: (2px solid #FF0000)]
LayoutBR {BR} at (14,14) size 0x26
LayoutText {#text} at (14,41) size 36x26
text run at (14,41) width 36: "xxx"
LayoutText {#text} at (0,0) size 0x0
caret: position 3 of child 1 {#text} 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