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

Side by Side 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, 9 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
4 6
5 <head> 7 <div contenteditable="" id="root">
6
7 <style>
8 .editing {
9 border: 2px solid red;
10 padding: 12px;
11 font-size: 24px;
12 }
13 </style>
14
15 <script src="../editing.js" language="JavaScript" type="text/JavaScript" />
16
17 <script>
18
19 function editingTest() {
20 for (i = 0; i != 4; i++)
21 moveSelectionForwardByCharacterCommand();
22 for (i = 0; i != 3; i++)
23 extendSelectionForwardByCharacterCommand();
24 copyCommand();
25 moveSelectionForwardByCharacterCommand();
26 pasteCommand();
27 }
28
29 </script>
30
31 </head>
32
33 <body>
34 <div contenteditable="" id="root" class="editing">
35 <span id="test">foo bar baz</span> 8 <span id="test">foo bar baz</span>
36 </div> 9 </div>
37 10
38 <script> 11 <script>
39 runDumpAsTextEditingTest(true); 12 test(() => {
13 assert_not_equals(window.internals, undefined,
14 'This test requires clipboard access');
15
16 const selection = window.getSelection();
17 const root = document.getElementById('root');
18 const test = document.getElementById('test');
19
20 selection.setBaseAndExtent(test.firstChild, 4, test.firstChild, 7); // foo ^ba r| baz
21 document.execCommand('copy');
22 selection.collapse(test.firstChild, 7); // foo bar| baz
23 document.execCommand('paste');
24
25 const expectedText = '\n&lt;span xmlns=\"http://www.w3.org/1999/xhtml\" id=\"t est\"&gt;foo barbar baz&lt;/span&gt;\n';
yosin_UTC9 2017/03/01 01:17:24 :-)
26 assert_equals(root.innerHTML, expectedText);
27 assert_equals(selection.anchorNode, test.firstChild);
28 assert_equals(selection.anchorOffset, 10);
29 assert_equals(selection.type, 'Caret');
30 }, 'Paste in XML');
40 </script> 31 </script>
41 32
42 </body>
43 </html> 33 </html>
OLDNEW
« 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