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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/paste-text-014.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/paste-text-014.html
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/paste-text-014.html b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-text-014.html
index ce1bb308e30609f1cd94d1fbda06c61e5bff42f7..2bba2dc7b444be34c1ac431aa0b6a9e6f2a0de07 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/paste-text-014.html
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-text-014.html
@@ -1,43 +1,29 @@
-<html>
-<head>
-
-<style>
-.editing {
- border: 2px solid red;
- padding: 12px;
- font-size: 24px;
-}
-</style>
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
-<script>
-
-function editingTest() {
- for (i = 0; i < 4; i++)
- extendSelectionForwardByCharacterCommand();
- copyCommand();
- moveSelectionForwardByCharacterCommand();
- typeCharacterCommand();
- moveSelectionBackwardByCharacterCommand();
- pasteCommand();
-}
-
-</script>
-
-<title>Editing Test</title>
-</head>
-<body contenteditable id="root">
-
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
See this bug: <a href="rdar://problem/3918712">&lt;rdar://problem/3918712&gt;</a> "Paste as Quotation" in Mail just pastes (&lt;blockquote&gt; tag seems to be lost).
Should see two boxes with blockquoted "foo" text, followed by a box with an unquoted "x".
-<div style="height: 24px"></div>
-<div id="test" class="editing"><div><blockquote>foo</blockquote></div></div>
-<div class="editing"></div>
+<div id="sample" contenteditable><div><blockquote>foo</blockquote></div></div>
+<div id="log"></div>
<script>
-runEditingTest();
-</script>
+test(function() {
+ var selection = window.getSelection();
+ var sample = document.getElementById('sample');
-</body>
-</html>
+ selection.collapse(sample, 0);
+ for (i = 0; i < 4; i++)
+ selection.modify('extend', 'forward', 'character');
+ document.execCommand('copy');
+ selection.modify('move', 'forward', 'character');
+ document.execCommand('insertText', false, 'x');
+ selection.modify('move', 'backward', 'character');
+ document.execCommand('paste');
+
+ assert_equals(sample.innerHTML, '<blockquote>foofoox</blockquote>');
+ assert_true(selection.isCollapsed);
+ assert_equals(selection.anchorNode, sample.querySelector('blockquote').firstChild);
+ assert_equals(selection.anchorOffset, 6);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698