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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/4242293-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/4242293-1.html
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/4242293-1.html b/third_party/WebKit/LayoutTests/editing/pasteboard/4242293-1.html
index d6f2bfa54e815aead26849da078832d347c3326f..7e2c4f87d2206f0458b8a039eb61428345fbf357 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/4242293-1.html
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/4242293-1.html
@@ -1,26 +1,32 @@
-<script src="../../resources/dump-as-markup.js"></script>
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+This test ensures that createMarkup puts an interchange newline on the
+pasteboard for a selection ending at the end of a block.
+
<div id="copy" contenteditable="true"><div><div>foo</div>bar</div>baz</div>
-<div id="paste" contenteditable="true">foo</div>
+<div id="sample" contenteditable="true">foo</div>
+<div id="log"></div>
<script>
-if (window.testRunner)
- testRunner.dumpEditingCallbacks();
-if (window.internals)
- internals.settings.setEditingBehavior('mac');
+test(function() {
+ if (window.internals)
+ internals.settings.setEditingBehavior('win');
-var sel = window.getSelection();
-var e = document.getElementById("copy");
-sel.collapse(e, 0);
-sel.modify("move", "forward", "word");
-sel.modify("extend", "forward", "line");
-sel.modify("extend", "forward", "line");
-document.execCommand("Copy");
+ var selection = window.getSelection();
+ selection.collapse(document.getElementById('copy'), 0);
+ selection.modify('move', 'forward', 'word');
+ selection.modify('extend', 'forward', 'line');
+ selection.modify('extend', 'forward', 'line');
+ document.execCommand('copy');
-e = document.getElementById("paste");
-sel.collapse(e, 0);
-sel.modify("move", "forward", "word");
-document.execCommand("Paste");
+ var sample = document.getElementById('sample');
+ selection.collapse(sample, 0);
+ selection.modify('move', 'forward', 'word');
+ document.execCommand('paste');
-Markup.description('This test ensures that createMarkup puts an interchange newline on the pasteboard for a selection ending at the end of a block. Both regions below should be visually identical.')
-Markup.dump('copy', 'first region (bar and baz are copied)');
-Markup.dump('paste', 'second region (bar and baz are pasted)');
+ assert_equals(sample.innerHTML, 'foobar<br>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