Index: third_party/WebKit/LayoutTests/editing/selection/extend-by-word-001.html |
diff --git a/third_party/WebKit/LayoutTests/editing/selection/extend-by-word-001.html b/third_party/WebKit/LayoutTests/editing/selection/extend-by-word-001.html |
index 90ff185c65c77c4941fa7baf327f12afe1f18992..3ad8a42ad8cd28ccf087afb17fd8906a8d40afed 100644 |
--- a/third_party/WebKit/LayoutTests/editing/selection/extend-by-word-001.html |
+++ b/third_party/WebKit/LayoutTests/editing/selection/extend-by-word-001.html |
@@ -1,45 +1,26 @@ |
-<html> |
-<head> |
- |
-<style> |
-.editing { |
- border: 2px solid red; |
- padding: 12px; |
- font-size: 24px; |
-} |
-.cell { |
- padding: 12px; |
- font-size: 24px; |
- height: 48px; |
-} |
-</style> |
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> |
- |
-<script> |
- |
-function editingTest() { |
- for (i = 0; i < 4; i++) |
- moveSelectionForwardByCharacterCommand(); |
- extendSelectionForwardByWordCommand(); |
-} |
- |
-</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"> |
-<div id="test">foo<span class="Apple-tab-span" style="white-space:pre"> </span>bar</div> |
+<div id="span">foo<span class="Apple-tab-span" style="white-space:pre"> </span>bar</div> |
</div> |
- |
-<!-- |
- Specifically checks test case in bug: |
- <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps |
---> |
+<div id="log"></div> |
<script> |
-runEditingTest(); |
+test(function () { |
+ var selection = getSelection(); |
+ selection.collapse(span.firstChild, 0); |
+ for (i = 0; i < 4; i++) { |
+ selection.modify("move", "forward", "character"); |
+ } |
+ selection.modify("extend", "forward", "word"); |
+ assert_equals(selection.anchorNode, span.childNodes[2]); |
+ assert_equals(selection.anchorOffset, 0); |
+ assert_equals(selection.focusNode, span.childNodes[2]); |
+ assert_equals(selection.focusOffset, 3); |
+}); |
</script> |
</body> |
-</html> |
+ |