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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/4944770-2.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-2.html
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/4944770-2.html b/third_party/WebKit/LayoutTests/editing/pasteboard/4944770-2.html
index 5a01df08f34f86ac7af1fbfcc8e0d95391f74af9..efd37ceca7f6d39762ac9b515bfa83b86993a8e5 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/4944770-2.html
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/4944770-2.html
@@ -1,17 +1,28 @@
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
-<p>This tests smart paste of a fragment that ends in a select element. There should be spaces added before and after the inserted content.</p>
+<!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 spaces added before and after the inserted content.</p>
<div contenteditable="true" id="copy"><select><option>1</option><option>2</option><option>3</option></select></div>
-<div contenteditable="true" id="paste">xx</div>
-
+<div contenteditable="true" id="sample">xx</div>
+<div id="log"></div>
<script>
-var copy = document.getElementById("copy");
-doubleClick(copy.offsetLeft, copy.offsetTop);
-document.execCommand("Copy");
+test(function() {
+ if (window.internals)
+ internals.settings.setEditingBehavior('win');
+
+ var selection = window.getSelection();
+ var sample= document.getElementById('sample');
+
+ selection.selectAllChildren(document.getElementById('copy'));
+ document.execCommand('copy');
+
+ selection.collapse(sample.firstChild, 1);
+ document.execCommand('paste');
-var paste = document.getElementById("paste");
-var sel = window.getSelection();
-sel.collapse(paste, 0);
-sel.modify("move", "forward", "character");
-document.execCommand("Paste");
+ assert_equals(sample.innerHTML, 'x<select><option>1</option><option>2</option><option>3</option></select>x', 'innerHHTML');
+ assert_true(selection.isCollapsed);
+ assert_equals(selection.anchorNode, sample);
+ assert_equals(selection.anchorOffset, 2);
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698