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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/pasteboard/4944770-2.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 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script > 1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <p>This tests smart paste of a fragment that ends in a select element.
5 There should be spaces added before and after the inserted content.</p>
6 <div contenteditable="true" id="copy"><select><option>1</option><option>2</optio n><option>3</option></select></div>
7 <div contenteditable="true" id="sample">xx</div>
8 <div id="log"></div>
9 <script>
10 test(function() {
11 if (window.internals)
12 internals.settings.setEditingBehavior('win');
2 13
3 <p>This tests smart paste of a fragment that ends in a select element. There sh ould be spaces added before and after the inserted content.</p> 14 var selection = window.getSelection();
4 <div contenteditable="true" id="copy"><select><option>1</option><option>2</optio n><option>3</option></select></div> 15 var sample= document.getElementById('sample');
5 <div contenteditable="true" id="paste">xx</div>
6 16
7 <script> 17 selection.selectAllChildren(document.getElementById('copy'));
8 var copy = document.getElementById("copy"); 18 document.execCommand('copy');
9 doubleClick(copy.offsetLeft, copy.offsetTop);
10 document.execCommand("Copy");
11 19
12 var paste = document.getElementById("paste"); 20 selection.collapse(sample.firstChild, 1);
13 var sel = window.getSelection(); 21 document.execCommand('paste');
14 sel.collapse(paste, 0); 22
15 sel.modify("move", "forward", "character"); 23 assert_equals(sample.innerHTML, 'x<select><option>1</option><option>2</optio n><option>3</option></select>x', 'innerHHTML');
16 document.execCommand("Paste"); 24 assert_true(selection.isCollapsed);
25 assert_equals(selection.anchorNode, sample);
26 assert_equals(selection.anchorOffset, 2);
27 });
17 </script> 28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698