Index: third_party/WebKit/LayoutTests/editing/pasteboard/4242293.html |
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/4242293.html b/third_party/WebKit/LayoutTests/editing/pasteboard/4242293.html |
index 237735606ffd910c538f9fbcfa54876f949547ed..12aadba625e71f0e0dc11f39ffa18b8384e27e0c 100644 |
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/4242293.html |
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/4242293.html |
@@ -1,17 +1,25 @@ |
-<script> |
-if (window.testRunner) |
- testRunner.dumpEditingCallbacks(); |
-</script> |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
<p>This tests for a bug in createMarkup (markup for ancestors of the start of the selection wasn't being added to the pasteboard). You should see the same thing in both regions below.</p> |
<p><b>This demonstrates a bug: 'foo' is pulled out of its bordered block.</b></p> |
<div id="copy" contenteditable="true"><div style="margin: 5px; border: 1px solid red;">foo<div style="margin: 5px; border: 1px solid blue;">bar</div></div>baz</div> |
-<div id="paste" contenteditable="true"></div> |
- |
+<div id="sample" contenteditable="true"></div> |
+<div id="log"></div> |
<script> |
-window.getSelection().collapse(document.getElementById("copy")); |
-document.execCommand("SelectAll"); |
-document.execCommand("Copy"); |
-window.getSelection().collapse(document.getElementById("paste")); |
-document.execCommand("Paste"); |
+test(function() { |
+ var selection = window.getSelection(); |
+ selection.collapse(document.getElementById('copy')); |
+ document.execCommand('SelectAll'); |
+ document.execCommand('Copy'); |
+ var sample = document.getElementById('sample'); |
+ selection.collapse(sample); |
+ document.execCommand('Paste'); |
+ |
+ assert_equals(sample.innerHTML, '<div style="margin: 5px; border: 1px solid red;">foo<div style="margin: 5px; border: 1px solid blue;">bar</div></div>baz'); |
+ assert_true(selection.isCollapsed); |
+ assert_equals(selection.anchorNode, sample.lastChild); |
+ assert_equals(selection.anchorOffset, 3); |
+}); |
</script> |