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

Unified Diff: third_party/WebKit/LayoutTests/editing/execCommand/format-block-contenteditable-false.html

Issue 2550633002: Convert editing/execCommand/format-block-contenteditable-false.html to utilize w3c test harness (Closed)
Patch Set: 2016-12-02T15:40:50 Created 4 years 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-contenteditable-false-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-contenteditable-false.html
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/format-block-contenteditable-false.html b/third_party/WebKit/LayoutTests/editing/execCommand/format-block-contenteditable-false.html
index deae85af85c049b0f653a188cc0ade2ead1d83bf..85dc9f85ee00accb0ebc360791e03369e34e2aaa 100644
--- a/third_party/WebKit/LayoutTests/editing/execCommand/format-block-contenteditable-false.html
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/format-block-contenteditable-false.html
@@ -1,32 +1,30 @@
-<!DOCTYPE html>
-<html>
-<head>
- <script src="../../resources/dump-as-markup.js"></script>
-</head>
-<body>
- <div id="editorcontainer" contenteditable="true">
- Will select from here
- <div contenteditable="false">
- over this contenteditable=false div
- </div>
- until here.
- </div>
-</body>
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
- Markup.description('formatblock on selection with a contenteditable="false" child.');
-
- var selection = window.getSelection();
- selection.removeAllRanges();
-
- var container = document.getElementById('editorcontainer');
- var range = document.createRange()
- range.setStartBefore(container.firstChild);
- range.setEndAfter(container.lastChild);
- selection.addRange(range);
-
- document.execCommand('italic', false, "");
- document.execCommand('formatblock', false, "<h1>");
-
- Markup.dump(container);
+test(() => assert_selection(
+ [
+ '<div contenteditable>',
+ ' ^Will select from here',
+ ' <div contenteditable="false">',
+ ' over this contenteditable=false div',
+ ' </div>',
+ ' until here.|',
+ '</div>',
+ ].join('\n'),
+ selection => {
+ selection.document.execCommand('italic');
+ selection.document.execCommand('formatblock', false, '<h1>');
+ },
+ [
+ '<div contenteditable><h1><i>',
+ ' ^Will select from here',
+ ' </i><br><i>',
+ ' until here.|',
+ '</i></h1><div contenteditable="false">',
+ ' over this contenteditable=false div',
+ ' </div></div>',
+ ].join('\n')),
+ 'formatBlock with uneditable');
</script>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/execCommand/format-block-contenteditable-false-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698