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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/4242293.html

Issue 1462823002: Make layout tests in editing/pasteboard to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-20T10:44:42 Created 5 years, 1 month 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/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>

Powered by Google App Engine
This is Rietveld 408576698