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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/pasteboard/paste-text-013.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 unified diff | Download patch
OLDNEW
1 <html> 1 <!DOCTYPE html>
2 <head> 2 <script src="../../resources/testharness.js"></script>
3 3 <script src="../../resources/testharnessreport.js"></script>
4 <style>
5 .editing {
6 border: 2px solid red;
7 padding: 12px;
8 font-size: 24px;
9 }
10 </style>
11 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script >
12
13 <script>
14
15 function editingTest() {
16 for (i = 0; i < 4; i++)
17 extendSelectionForwardByCharacterCommand();
18 copyCommand();
19 moveSelectionForwardByCharacterCommand();
20 typeCharacterCommand();
21 pasteCommand();
22 }
23
24 </script>
25
26 <title>Editing Test</title>
27 </head>
28 <body contenteditable id="root">
29
30 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 l ost). 4 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 l ost).
31 Should see one box with blockquoted "foo" text, followed by another box with an "x" (not in a blockquote) and "foo" (in a blockquote). 5 Should see one box with blockquoted "foo" text, followed by another box with an "x" (not in a blockquote) and "foo" (in a blockquote).
32 <div style="height: 24px"></div>
33 6
34 <div id="test" class="editing"><div><blockquote class="Apple-paste-as-quotation" >foo</blockquote></div></div> 7 <div id="sample" contenteditable><div><blockquote class="Apple-paste-as-quotatio n">foo</blockquote></div></div>
35 <div class="editing"></div> 8 <div id="log"></div>
36
37 <script> 9 <script>
38 runEditingTest(); 10 test(function() {
11 var selection = window.getSelection();
12 var sample = document.getElementById('sample');
13
14 selection.collapse(sample, 0);
15 for (i = 0; i < 4; i++)
16 selection.modify('extend', 'forward', 'character');
17 document.execCommand('copy');
18 selection.modify('move', 'forward', 'character');
19 document.execCommand('insertText', false, 'x');
20 document.execCommand('paste');
21
22 assert_equals(sample.innerHTML, '<div><blockquote>fooxfoo</blockquote></div> ');
23 assert_true(selection.isCollapsed);
24 assert_equals(selection.anchorNode, sample.querySelector('blockquote').first Child);
25 assert_equals(selection.anchorOffset, 7);
26 });
39 </script> 27 </script>
40
41 </body>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698