Index: third_party/WebKit/LayoutTests/editing/selection/extend-by-character-002.html |
diff --git a/third_party/WebKit/LayoutTests/editing/selection/extend-by-character-002.html b/third_party/WebKit/LayoutTests/editing/selection/extend-by-character-002.html |
index e2c56ff70f4b5cc94ba9ec89782d809bcd30ea44..d5267aef323b7516190c47befd482735e213000f 100644 |
--- a/third_party/WebKit/LayoutTests/editing/selection/extend-by-character-002.html |
+++ b/third_party/WebKit/LayoutTests/editing/selection/extend-by-character-002.html |
@@ -1,40 +1,28 @@ |
-<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 < 33; i++) { |
- extendSelectionForwardByCharacterCommand(); |
- } |
-} |
- |
-</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">a<img src="../resources/abe.png">new |
+<span id="span">a<img src="../resources/abe.png">new |
<br>nation <i> </i> <img src="../resources/abe.png"> |
conceived |
<br>nation<img src="../resources/abe.png"></span> |
</div> |
- |
+<div id="log"></div> |
<script> |
-runEditingTest(); |
+test(function () { |
+ var selection = getSelection(); |
+ selection.collapse(span.firstChild, 0); |
+ for (i = 0; i < 33; i++) { |
+ selection.modify("extend", "forward", "character"); |
+ } |
+ assert_equals(selection.anchorNode, span.firstChild); |
+ assert_equals(selection.anchorOffset, 0); |
+ assert_equals(selection.focusNode, span.childNodes[10]); // "nation" text |
+ assert_equals(selection.focusOffset, 6); |
+}); |
</script> |
</body> |
-</html> |