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

Unified Diff: third_party/WebKit/LayoutTests/editing/execCommand/format-block-multiple-paragraphs-in-pre.html

Issue 2277673002: Convert editing/execCommand/format-block-multiple-paragraphs-in-pre.html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-08-25T13:22:15 Created 4 years, 4 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/execCommand/format-block-multiple-paragraphs-in-pre-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/execCommand/format-block-multiple-paragraphs-in-pre.html
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/format-block-multiple-paragraphs-in-pre.html b/third_party/WebKit/LayoutTests/editing/execCommand/format-block-multiple-paragraphs-in-pre.html
index 6c7750bd9fd9332c7581a614d84397ea80a048f5..d6647cfbd4b8b8852416922a35d7cabe1f88a972 100644
--- a/third_party/WebKit/LayoutTests/editing/execCommand/format-block-multiple-paragraphs-in-pre.html
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/format-block-multiple-paragraphs-in-pre.html
@@ -1,47 +1,59 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="../../resources/dump-as-markup.js"></script>
-<div id="test" contenteditable>
-<pre>
-hello
-
-world
-
-webkit
-</pre>
-</div>
+<!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>',
+ '<pre>',
+ '^hello\n\nworld\n\nwebkit\n|',
+ '</pre>',
+ '</div>',
+ ].join(''),
+ 'formatBlock h3',
+ [
+ '<div contenteditable>',
+ '<h3>',
+ 'hello<br>\nworld<br>\nwebkit',
+ '</h3>|',
+ '</div>',
+ ].join('')),
+ 'formatBlock on all contents with H3');
-Markup.description('This tests ensures formatBlock removes a pre when formatting multiple paragraphs inside the pre.');
-
-var test = document.getElementById('test');
-var original = test.innerHTML;
-window.getSelection().selectAllChildren(test);
-document.execCommand('formatBlock', false, 'h3');
-Markup.dump(test, 'Formatting all paragraphs by h3 yields');
-
-document.execCommand('undo', false, null);
-Markup.dump(test, 'Undo yields');
-window.getSelection().collapse(test, 0);
-window.getSelection().modify('extend', 'forward', 'line');
-window.getSelection().modify('extend', 'forward', 'line');
-window.getSelection().modify('extend', 'forward', 'line');
-window.getSelection().modify('extend', 'forward', 'line');
-document.execCommand('formatBlock', false, 'h3');
-Markup.dump(test, 'Formatting all but the last paragraph by h3 yields');
-
-document.execCommand('undo', false, null);
-Markup.dump(test, 'Undo yields');
-window.getSelection().collapse(test, 0);
-window.getSelection().modify('move', 'forward', 'line');
-window.getSelection().modify('extend', 'forward', 'line');
-window.getSelection().modify('extend', 'forward', 'line');
-window.getSelection().modify('extend', 'forward', 'line');
-window.getSelection().modify('extend', 'forward', 'line');
-document.execCommand('formatBlock', false, 'h3');
-Markup.dump(test, 'Formatting all but the first paragraph by h3 yields');
+ test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<pre>',
+ '^hello\n\nworld\n\n|webkit\n',
+ '</pre>',
+ '</div>',
+ ].join(''),
+ 'formatBlock h3',
+ [
+ '<div contenteditable>',
+ '<pre>',
+ '<h3>^hello\nworld\n</h3>|webkit\n',
+ '</pre>',
+ '</div>',
+ ].join('')),
+ 'formatBlock on last paragraph with H3');
Xiaocheng 2016/08/25 05:38:30 nit: all but the last paragraph
+ test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ '<pre>',
+ 'hello\n^\nworld\n\nwebkit\n|',
+ '</pre>',
+ '</div>',
+ ].join(''),
+ 'formatBlock h3',
+ [
+ '<div contenteditable>',
+ '<pre>',
+ 'hello\n<h3>\nworld\nwebkit</h3>|',
+ '</pre>',
+ '</div>',
+ ].join('')),
+ 'formatBlock all but the first paragraph with H3');
</script>
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/execCommand/format-block-multiple-paragraphs-in-pre-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698