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

Unified Diff: third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html

Issue 2172163003: Convert editing/inserting/editing-empty-divs.html to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-22T18:02:20 Created 4 years, 5 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/platform/linux/editing/inserting/editing-empty-divs-expected.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html b/third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html
index eea2c18fcc16f745fd1ab64973d7271fd1e1d857..55aa59c524661ca36b1d341ab73aafec239394d8 100644
--- a/third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html
+++ b/third_party/WebKit/LayoutTests/editing/inserting/editing-empty-divs.html
@@ -1,56 +1,35 @@
-<html>
-
-<head>
-<script>
-if (window.testRunner)
- testRunner.dumpEditingCallbacks();
-</script>
-
-<script>
-</script>
-</head>
-<style>
-div {
- border: 1px dotted blue;
- min-height: 20px;
- width: 90%;
-}
-</style>
-
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
-function foo() {
- var selection = window.getSelection();
- var bar = 1;
- var divs = document.getElementsByTagName("div");
- for (var i = 0; divs[i]; i++) {
- selection.collapse(divs[i], 0);
- document.execCommand("InsertText", false, 'c');
- }
-}
+test(() => assert_selection(
+ '<div contenteditable>|hello</div>',
+ 'insertText c',
+ '<div contenteditable>c|hello</div>'),
+ 'insert text into DIV with some text');
+
+test(() => assert_selection(
+ '<div contenteditable>|</div>',
+ 'insertText c',
+ '<div contenteditable>c|</div>'),
+ 'insert text into completely empty DIV');
+
+test(() => assert_selection(
+ '<div contenteditable>|\n</div>',
+ 'insertText c',
+ '<div contenteditable>c|\n</div>'),
+ 'insert text into DIV with collapsable whitespace');
+
+test(() => assert_selection(
+ '<div contenteditable style="min-height: 20px">|<p></p></div>',
+ 'insertText c',
+ '<div contenteditable style="min-height: 20px">c|<p></p></div>'),
+ 'insert text into DIV with empty P');
+
+test(() => assert_selection(
+ '<div contenteditable style="min-height: 20px">|\n<p></p>\n</div>',
+ 'insertText c',
+ '<div contenteditable style="min-height: 20px">c|\n<p></p>\n</div>'),
+ 'insert text into DIV with empty P with collapsable whitespace');
</script>
-<body onload="foo()">
-
-<p>This tests the ability to start editing in blocks that are visible, but have little or no content. Each of the divs below should be able to accept a caret.</p>
-
-<p>This div contains some text.</p>
-<div contentEditable="true">
-hello
-</div>
-
-<p>This div is completely empty.</p>
-<div contentEditable="true"></div>
-
-<p>This div contains some collapsable whitespace (a '\n').</p>
-<div contentEditable="true">
-</div>
-
-<p>This div contains a self-closing p tag.</p>
-<div contentEditable="true"><p /></div>
-
-<p>This div contains a self-closing p tag and some collapsable whitespace (two '\n's before and after the self closing p.</p>
-<div contentEditable="true">
-<p />
-</div>
-
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/inserting/editing-empty-divs-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698