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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/pasteboard/4242293-1.html

Issue 2752593006: Utilize assert_selection() in editing/pasteboard/4242293-1.html (Closed)
Patch Set: 2017-03-16T19:19:34 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/copy_ending_at_end_of_block.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 This test ensures that createMarkup puts an interchange newline on the
5 pasteboard for a selection ending at the end of a block.
6
7 <div id="copy" contenteditable="true"><div><div>foo</div>bar</div>baz</div>
8 <div id="sample" contenteditable="true">foo</div>
9 <div id="log"></div>
10 <script>
11 test(function() {
12 if (window.internals)
13 internals.settings.setEditingBehavior('win');
14
15 var selection = window.getSelection();
16 selection.collapse(document.getElementById('copy'), 0);
17 selection.modify('move', 'forward', 'word');
18 selection.modify('extend', 'forward', 'line');
19 selection.modify('extend', 'forward', 'line');
20 document.execCommand('copy');
21
22 var sample = document.getElementById('sample');
23 selection.collapse(sample, 0);
24 selection.modify('move', 'forward', 'word');
25 document.execCommand('paste');
26
27 assert_equals(sample.innerHTML, 'foobar<br>baz');
28 assert_true(selection.isCollapsed);
29 assert_equals(selection.anchorNode, sample.lastChild);
30 assert_equals(selection.anchorOffset, 3);
31 });
32 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/pasteboard/copy_ending_at_end_of_block.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698