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

Side by Side 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 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 moveSelectionBackwardByCharacterCommand();
22 pasteCommand();
23 }
24
25 </script>
26
27 <title>Editing Test</title>
28 </head>
29 <body contenteditable id="root">
30
31 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).
32 Should see two boxes with blockquoted "foo" text, followed by a box with an unqu oted "x". 5 Should see two boxes with blockquoted "foo" text, followed by a box with an unqu oted "x".
33 <div style="height: 24px"></div>
34 6
35 <div id="test" class="editing"><div><blockquote>foo</blockquote></div></div> 7 <div id="sample" contenteditable><div><blockquote>foo</blockquote></div></div>
36 <div class="editing"></div> 8 <div id="log"></div>
37 9
38 <script> 10 <script>
39 runEditingTest(); 11 test(function() {
12 var selection = window.getSelection();
13 var sample = document.getElementById('sample');
14
15 selection.collapse(sample, 0);
16 for (i = 0; i < 4; i++)
17 selection.modify('extend', 'forward', 'character');
18 document.execCommand('copy');
19 selection.modify('move', 'forward', 'character');
20 document.execCommand('insertText', false, 'x');
21 selection.modify('move', 'backward', 'character');
22 document.execCommand('paste');
23
24 assert_equals(sample.innerHTML, '<blockquote>foofoox</blockquote>');
25 assert_true(selection.isCollapsed);
26 assert_equals(selection.anchorNode, sample.querySelector('blockquote').first Child);
27 assert_equals(selection.anchorOffset, 6);
28 });
40 </script> 29 </script>
41
42 </body>
43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698