Index: third_party/WebKit/LayoutTests/editing/inserting/insert-div-026.html |
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert-div-026.html b/third_party/WebKit/LayoutTests/editing/inserting/insert-div-026.html |
index d9d69b0ed5507b78e452c5087063bfe6500500b9..398d75ce3a75463a5fff22c0c7eb6a80b4505aa3 100644 |
--- a/third_party/WebKit/LayoutTests/editing/inserting/insert-div-026.html |
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert-div-026.html |
@@ -1,42 +1,6 @@ |
-<html> |
-<head> |
- |
-<style> |
-.editing { |
- border: 2px solid red; |
- font-size: 24px; |
-} |
-.explanation { |
- border: 2px solid blue; |
- padding: 12px; |
- font-size: 24px; |
- margin-bottom: 24px; |
-} |
-.scenario { margin-bottom: 16px;} |
-.scenario:first-line { font-weight: bold; margin-bottom: 16px;} |
-.expected-results:first-line { font-weight: bold } |
-</style> |
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> |
- |
-<script> |
- |
-function editingTest() { |
- extendSelectionForwardByLineCommand(); |
- boldCommand(); |
- moveSelectionForwardByCharacterCommand(); |
- insertParagraphCommand(); |
- boldCommand(); |
- typeCharacterCommand(); |
- moveSelectionBackwardByCharacterCommand(); |
- deleteCommand(); |
-} |
- |
-</script> |
- |
-<title>Editing Test</title> |
-</head> |
-<body> |
- |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
<div class="explanation"> |
<div class="scenario"> |
Tests: |
@@ -52,13 +16,23 @@ Should see this content in the red box below: <b>fo</b>x |
</div> |
<div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;"> |
-<div id="test" class="editing"> |
-fo |
-</div> |
- |
+<div id="sample" class="editing">fo</div> |
+<div id="log"></div> |
<script> |
-runEditingTest(); |
+test(function() { |
+ var selection = window.getSelection(); |
+ var sample = document.getElementById('sample'); |
+ |
+ selection.collapse(sample.firstChild, 0); |
+ selection.modify('extend', 'forward', 'line'); |
+ document.execCommand('bold'); |
+ selection.modify('move', 'forward', 'character'); |
+ document.execCommand('insertParagraph'); |
+ document.execCommand('bold'); |
+ document.execCommand('InsertText', false, 'x') |
+ selection.modify('move', 'backward', 'character'); |
+ document.execCommand('delete'); |
+ |
+ assert_equals(sample.innerHTML, '<b>fo</b>x'); |
+}); |
</script> |
- |
-</body> |
-</html> |