Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: third_party/WebKit/LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability.html

Issue 2453723002: Convert editing/style/toggle-style-bold-italic-mixed-editability.html to utilize w3c test harness (Closed)
Patch Set: 2016-10-26T18:09:23 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability.html
diff --git a/third_party/WebKit/LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability.html b/third_party/WebKit/LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability.html
index 224b1360ad744cd8980d169b6aca84e052aed9d3..bedeba12734505beddf0441309d7c379671548ff 100644
--- a/third_party/WebKit/LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability.html
+++ b/third_party/WebKit/LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability.html
@@ -1,30 +1,77 @@
-<!DOCTYPE html>
-<html>
-<body>
-<p id="description">This tests bold/italic style toggling for a content with mixed editability</p>
-<div contenteditable id="root">
-<div id="test">
-Editable <span contenteditable=false>Non-editable</span> Editable
-</div>
-</div>
-<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>
-test('mac');
-test('win');
-test('unix');
-function test(platform) {
- if (window.internals)
- internals.settings.setEditingBehavior(platform);
- startNewMarkupGroup('Test for '+platform);
- runDumpAsTextEditingTest(true);
-}
-function editingTest() {
- execSelectAllCommand();
- execBoldCommand();
- execItalicCommand();
- execBoldCommand();
- execItalicCommand();
-}
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '^abc <span contenteditable="false">def</span> ghi|',
+ '</div>',
+ ].join(''),
+ 'bold',
+ [
+ '<div contenteditable>',
+ '<b>^abc </b><span contenteditable="false">def</span><b> ghi|</b>',
+ '</div>',
+ ].join('')),
+ 'bold');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '^abc <span contenteditable="false">def</span> ghi|',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.document.execCommand('bold');
+ selection.document.execCommand('italic');
+ },
+ [
+ '<div contenteditable>',
+ '<b><i>^abc </i></b>',
+ '<span contenteditable="false">def</span>',
+ '<b><i> ghi|</i></b>',
+ '</div>',
+ ].join('')),
+ 'bold+italic');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '^abc <span contenteditable="false">def</span> ghi|',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.document.execCommand('bold');
+ selection.document.execCommand('italic');
+ selection.document.execCommand('bold');
+ },
+ [
+ '<div contenteditable>',
+ '<i>^abc </i>',
+ '<span contenteditable="false">def</span>',
+ '<i> ghi|</i>',
+ '</div>',
+ ].join('')),
+ 'bold+italic+bold');
+
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '^abc <span contenteditable="false">def</span> ghi|',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.document.execCommand('bold');
+ selection.document.execCommand('italic');
+ selection.document.execCommand('bold');
+ selection.document.execCommand('italic');
+ },
+ [
+ '<div contenteditable>',
+ '^abc <span contenteditable="false">def</span> ghi|',
+ '</div>',
+ ].join('')),
+ 'bold+italic+bold+italic');
</script>
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/style/toggle-style-bold-italic-mixed-editability-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698