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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/paste-xml.xhtml

Issue 2720123002: Convert editing/pasteboard/paste-xml.xhtml with w3c testharness (Closed)
Patch Set: Use plain testharness Created 3 years, 10 months 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/pasteboard/paste-xml-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/pasteboard/paste-xml.xhtml
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/paste-xml.xhtml b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-xml.xhtml
index e815c47d5406d4e05d1e201d74d0dac7954ffd22..5a28c253f16ce9389df03a23bca5fe7ee8d2a96a 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/paste-xml.xhtml
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-xml.xhtml
@@ -1,43 +1,33 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
-<head>
-
-<style>
-.editing {
- border: 2px solid red;
- padding: 12px;
- font-size: 24px;
-}
-</style>
-
-<script src="../editing.js" language="JavaScript" type="text/JavaScript" />
-
-<script>
-
-function editingTest() {
- for (i = 0; i != 4; i++)
- moveSelectionForwardByCharacterCommand();
- for (i = 0; i != 3; i++)
- extendSelectionForwardByCharacterCommand();
- copyCommand();
- moveSelectionForwardByCharacterCommand();
- pasteCommand();
-}
-
-</script>
-
-</head>
-
-<body>
-<div contenteditable="" id="root" class="editing">
+<div contenteditable="" id="root">
<span id="test">foo bar baz</span>
</div>
<script>
-runDumpAsTextEditingTest(true);
+test(() => {
+ assert_not_equals(window.internals, undefined,
+ 'This test requires clipboard access');
+
+ const selection = window.getSelection();
+ const root = document.getElementById('root');
+ const test = document.getElementById('test');
+
+ selection.setBaseAndExtent(test.firstChild, 4, test.firstChild, 7); // foo ^bar| baz
+ document.execCommand('copy');
+ selection.collapse(test.firstChild, 7); // foo bar| baz
+ document.execCommand('paste');
+
+ const expectedText = '\n&lt;span xmlns=\"http://www.w3.org/1999/xhtml\" id=\"test\"&gt;foo barbar baz&lt;/span&gt;\n';
yosin_UTC9 2017/03/01 01:17:24 :-)
+ assert_equals(root.innerHTML, expectedText);
+ assert_equals(selection.anchorNode, test.firstChild);
+ assert_equals(selection.anchorOffset, 10);
+ assert_equals(selection.type, 'Caret');
+}, 'Paste in XML');
</script>
-</body>
</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/pasteboard/paste-xml-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698