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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/extend-by-character-005.html

Issue 1798413003: [Editing][CodeHealth] Use w3c testharness in editing/seletion/extend-by-* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 9 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
Index: third_party/WebKit/LayoutTests/editing/selection/extend-by-character-005.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/extend-by-character-005.html b/third_party/WebKit/LayoutTests/editing/selection/extend-by-character-005.html
index 4b12949f4714eccd69983d38bcfbe8762d82cc2a..ec43e7849e8712bac7e46ff10cc497d0c756e8b8 100644
--- a/third_party/WebKit/LayoutTests/editing/selection/extend-by-character-005.html
+++ b/third_party/WebKit/LayoutTests/editing/selection/extend-by-character-005.html
@@ -1,41 +1,30 @@
-<html>
-<head>
-
-<style>
-.editing {
- border: 2px solid red;
- padding: 12px;
- font-size: 24px;
-}
-</style>
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
-<script>
-
-function editingTest() {
- for (i = 0; i < 159; i++) {
- extendSelectionForwardByCharacterCommand();
- }
- for (i = 0; i < 158; i++) {
- extendSelectionBackwardByCharacterCommand();
- }
-}
-
-</script>
-
-<title>Editing Test</title>
-</head>
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<body>
<div contenteditable id="root" class="editing">
-<span id="test"><i>F and seven</i> years <b> as </b>our fathers f upon this
+<span id="span"><i>F and seven</i> years <b> as </b>our fathers f upon this
continent, a new nation, conceived &nbsp;&nbsp; in Liberty, and dedicated to the
proposition that all
<br>men are created equal.</span>
</div>
-
+<div id="log"></div>
<script>
-runEditingTest();
+test(function () {
+ var selection = getSelection();
+ selection.collapse(span.firstChild.firstChild, 0);
+ for (i = 0; i < 159; i++) {
+ selection.modify("extend", "forward", "character");
+ }
+ for (i = 0; i < 158; i++) {
+ selection.modify("extend", "backward", "character");
+ }
+ assert_equals(selection.anchorNode, span.firstChild.firstChild);
+ assert_equals(selection.anchorOffset, 0);
+ assert_equals(selection.focusNode, span.firstChild.firstChild);
+ assert_equals(selection.focusOffset, 1);
+});
</script>
</body>
-</html>
+

Powered by Google App Engine
This is Rietveld 408576698