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

Unified Diff: third_party/WebKit/LayoutTests/editing/deleting/paragraph-in-preserveNewline.html

Issue 2297103002: Convert editing/deleting/paragraph-in-preserveNewline.html to use w3c test harness (Closed)
Patch Set: 2016-08-31T13:31:55 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/deleting/paragraph-in-preserveNewline-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/deleting/paragraph-in-preserveNewline.html
diff --git a/third_party/WebKit/LayoutTests/editing/deleting/paragraph-in-preserveNewline.html b/third_party/WebKit/LayoutTests/editing/deleting/paragraph-in-preserveNewline.html
index ee7465f79fe86445154a79e3dce91a63b1512ac6..ee28d8a37faa94549c0ecd658e8f1ceefda1acdd 100644
--- a/third_party/WebKit/LayoutTests/editing/deleting/paragraph-in-preserveNewline.html
+++ b/third_party/WebKit/LayoutTests/editing/deleting/paragraph-in-preserveNewline.html
@@ -1,37 +1,27 @@
-<!DOCTYPE html>
-<html>
-<body>
-<p id="description">This tests for a bug where deleting a paragraph in preserveNewline text would introduce an extra line. You should see '\nbar' below.</p>
-<div id="test" contenteditable="true"><pre>foo
-bar</pre></div>
-
-<script src="../../resources/dump-as-markup.js"></script>
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
-function runTestsOn(platform) {
- var sel = window.getSelection();
- var e = document.getElementById("test");
-
- if (window.internals)
- internals.settings.setEditingBehavior(platform);
-
- sel.collapse(e, 0);
- sel.modify("extend", "forward", "character");
- sel.modify("extend", "forward", "character");
- sel.modify("extend", "forward", "character");
- document.execCommand("Delete");
- Markup.dump("test", "on " + platform);
- document.execCommand("undo");
- Markup.dump("test", "after undo on " + platform);
-}
+ test(() => {
+ assert_not_equals(window.internals, undefined,
+ 'This test requires window.internals');
+ ['mac', 'win', 'unix', 'android'].forEach(platform => {
+ internals.settings.setEditingBehavior(platform);
+ assert_selection(
+ '<div contenteditable><pre>^foo|\n</pre></div>',
+ 'delete',
+ '<div contenteditable><pre>|\n</pre></div>',
+ `${platform}: Delete a paragraph in preserving newline`);
-if (window.testRunner)
- testRunner.dumpEditingCallbacks();
-Markup.description(description.textContent);
-Markup.dump("test", "initial state");
-runTestsOn("mac");
-runTestsOn("win");
-runTestsOn("unix");
-runTestsOn("android");
+ assert_selection(
+ '<div contenteditable><pre>^foo|\n</pre></div>',
+ selection => {
+ selection.document.execCommand('delete');
+ selection.document.execCommand('undo');
+ },
+ '<div contenteditable><pre>^foo|\n</pre></div>',
+ '${platform}: Undo after delete a paragraph in preserving newline');
+ });
+ });
</script>
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/deleting/paragraph-in-preserveNewline-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698