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

Convert editing/inserting/insert-div-010.html to use w3c test harness

This patch converts "editing/inserting/insert-div-010.html" to use w3c test
harness to simplify test script for improving code health.

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

Review-Url: https://codereview.chromium.org/2338223002
Cr-Commit-Position: refs/heads/master@{#418764}
parent e4bb1b4b
<html>
<head>
<style>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
</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>
function editingTest() {
typeCharacterCommand();
moveSelectionBackwardByCharacterCommand();
insertParagraphCommand();
}
test(() => assert_selection(
[
'<div contenteditable>',
'<div>|x</div>',
'</div>',
].join(''),
'insertParagraph',
[
'<div contenteditable>',
'<div><br></div>',
'<div>|x</div>',
'</div>',
].join('')),
'insert BR before a character');
</script>
<title>Editing Test</title>
</head>
<body contenteditable id="root" class="editing">
<div id="test"><br class="webkit-block-placeholder"></div>
<!-- Test fix for <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return
before first char of line leaves insertion point in wrong place -->
<script>
runEditingTest();
</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
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)]
LayoutBlockFlow {DIV} at (14,14) size 756x28
LayoutBR {BR} at (0,0) size 0x27
LayoutBlockFlow {DIV} at (14,42) size 756x28
LayoutText {#text} at (0,0) size 12x27
text run at (0,0) width 12: "x"
caret: position 0 of child 0 {#text} of child 2 {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
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)]
LayoutBlockFlow {DIV} at (14,14) size 756x28
LayoutBR {BR} at (0,0) size 0x28
LayoutBlockFlow {DIV} at (14,42) size 756x28
LayoutText {#text} at (0,0) size 12x28
text run at (0,0) width 12: "x"
caret: position 0 of child 0 {#text} of child 2 {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
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)]
LayoutBlockFlow {DIV} at (14,14) size 756x27
LayoutBR {BR} at (0,0) size 0x26
LayoutBlockFlow {DIV} at (14,41) size 756x27
LayoutText {#text} at (0,0) size 12x26
text run at (0,0) width 12: "x"
caret: position 0 of child 0 {#text} of child 2 {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