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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/4944770-1.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/4944770-1.html
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/4944770-1.html b/third_party/WebKit/LayoutTests/editing/pasteboard/4944770-1.html
index 63f1f52c0e584b3f2ae6d8153a73db4663e65c96..183f100350b8d2882f965640b49379e84e3f2fc4 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/4944770-1.html
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/4944770-1.html
@@ -1,17 +1,30 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<p>This tests smart paste of a fragment that ends in a select element. There should be no spaces added because the paste is performed in an empty paragraph.</p>
<div contenteditable="true" id="copy">foo<select><option>1</option><option>2</option><option>3</option></select></div>
-<div contenteditable="true" id="paste"></div>
-
+<div contenteditable="true" id="sample"></div>
+<div id="log"></div>
<script>
-var copy = document.getElementById("copy");
-var paste = document.getElementById("paste");
-var sel = window.getSelection();
+test(function() {
+ if (window.internals)
+ internals.settings.setEditingBehavior('win');
+
+ var copy = document.getElementById('copy');
+ var paste = document.getElementById('sample');
+ var selection = window.getSelection();
+
+ selection.collapse(copy, 0);
+ selection.modify('extend', 'forward', 'word');
+ selection.modify('extend', 'forward', 'word');
+ document.execCommand('copy');
-sel.collapse(copy, 0);
-sel.modify("extend", "forward", "word");
-sel.modify("extend", "forward", "word");
-document.execCommand("Copy");
+ selection.collapse(paste, 0);
+ document.execCommand('paste');
-sel.collapse(paste, 0);
-document.execCommand("Paste");
+ assert_equals(sample.innerHTML, 'foo<select><option>1</option><option>2</option><option>3</option></select>');
+ assert_true(selection.isCollapsed);
+ assert_equals(selection.anchorNode, sample);
+ assert_equals(selection.anchorOffset, 2);
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698