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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/pasteboard/4944770-1.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 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
1 <p>This tests smart paste of a fragment that ends in a select element. There sh ould be no spaces added because the paste is performed in an empty paragraph.</p > 4 <p>This tests smart paste of a fragment that ends in a select element. There sh ould be no spaces added because the paste is performed in an empty paragraph.</p >
2 <div contenteditable="true" id="copy">foo<select><option>1</option><option>2</op tion><option>3</option></select></div> 5 <div contenteditable="true" id="copy">foo<select><option>1</option><option>2</op tion><option>3</option></select></div>
3 <div contenteditable="true" id="paste"></div> 6 <div contenteditable="true" id="sample"></div>
7 <div id="log"></div>
8 <script>
9 test(function() {
10 if (window.internals)
11 internals.settings.setEditingBehavior('win');
4 12
5 <script> 13 var copy = document.getElementById('copy');
6 var copy = document.getElementById("copy"); 14 var paste = document.getElementById('sample');
7 var paste = document.getElementById("paste"); 15 var selection = window.getSelection();
8 var sel = window.getSelection();
9 16
10 sel.collapse(copy, 0); 17 selection.collapse(copy, 0);
11 sel.modify("extend", "forward", "word"); 18 selection.modify('extend', 'forward', 'word');
12 sel.modify("extend", "forward", "word"); 19 selection.modify('extend', 'forward', 'word');
13 document.execCommand("Copy"); 20 document.execCommand('copy');
14 21
15 sel.collapse(paste, 0); 22 selection.collapse(paste, 0);
16 document.execCommand("Paste"); 23 document.execCommand('paste');
24
25 assert_equals(sample.innerHTML, 'foo<select><option>1</option><option>2</opt ion><option>3</option></select>');
26 assert_true(selection.isCollapsed);
27 assert_equals(selection.anchorNode, sample);
28 assert_equals(selection.anchorOffset, 2);
29 });
17 </script> 30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698