Chromium Code Reviews| 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..73d1a296e275da6cf92b4e898c6af111640bc158 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|', |
|
Xiaocheng
2016/08/25 01:48:39
The original test formats all but the last paragra
yosin_UTC9
2016/08/25 05:15:43
Done.
|
| + '</pre>', |
| + '</div>', |
| + ].join(''), |
| + 'formatBlock h3', |
| + [ |
| + '<div contenteditable>', |
| + '<pre>', |
| + 'hello\n\nworld\n\n<h3>^webkit|</h3>', |
| + '</pre>', |
| + '</div>', |
| + ].join('')), |
| + 'formatBlock on last paragraph with H3'); |
| + test(() => assert_selection( |
| + [ |
| + '<div contenteditable>', |
| + '<pre>', |
| + 'hello\n\n^world\n\nwebkit\n|', |
|
Xiaocheng
2016/08/25 01:48:39
Should be 'hello\n^\nworld\n\nwebkit\n|'
yosin_UTC9
2016/08/25 05:15:43
Done.
|
| + '</pre>', |
| + '</div>', |
| + ].join(''), |
| + 'formatBlock h3', |
| + [ |
| + '<div contenteditable>', |
| + '<pre>', |
| + 'hello\n\n<h3>world\nwebkit</h3>|', |
| + '</pre>', |
| + '</div>', |
| + ].join('')), |
| + 'formatBlock all but the first paragraph with H3'); |
| </script> |
| -</body> |
| -</html> |