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

Convert editing/execCommand/format-block-with-braces.html to use w3c test harness

This patch converts "editing/execCommand/format-block-with-braces.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/2277683002
Cr-Commit-Position: refs/heads/master@{#414247}
parent 9a670d48
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
This test uses FormatBlock with html brackets in the tag string passed to execCommand.
Before FormatBlock with <h1>:
| "
Format Me
"
After FormatBlock with <h1>:
| <h1>
| "
<#selection-caret>Format Me
"
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/dump-as-markup.js"></script>
<div style="display:inline" contenteditable="true" id="item1">
Format Me
</div>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
if (window.testRunner)
testRunner.dumpEditingCallbacks();
Markup.description("This test uses FormatBlock with html brackets in the tag string passed to execCommand.");
Markup.dump("item1", "Before FormatBlock with <h1>");
var s = window.getSelection();
var r = document.createRange();
var p1 = document.getElementById("item1");
s.collapse(p1, 0);
document.execCommand("FormatBlock", false, "<h1>");
Markup.dump("item1", "After FormatBlock with <h1>");
test(() => assert_selection(
'<div contenteditable>|Format Me</div>',
'formatBlock <h1>',
'<div contenteditable><h1>|Format Me</h1></div>'),
'foramtBlcok accept tag name with html brackets');
</script>
</body>
</html>
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