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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/pasteboard/4242293.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> 1 <!DOCTYPE html>
2 if (window.testRunner) 2 <script src="../../resources/testharness.js"></script>
3 testRunner.dumpEditingCallbacks(); 3 <script src="../../resources/testharnessreport.js"></script>
4 </script>
5 <p>This tests for a bug in createMarkup (markup for ancestors of the start of th e selection wasn't being added to the pasteboard). You should see the same thin g in both regions below.</p> 4 <p>This tests for a bug in createMarkup (markup for ancestors of the start of th e selection wasn't being added to the pasteboard). You should see the same thin g in both regions below.</p>
6 <p><b>This demonstrates a bug: 'foo' is pulled out of its bordered block.</b></p > 5 <p><b>This demonstrates a bug: 'foo' is pulled out of its bordered block.</b></p >
7 <div id="copy" contenteditable="true"><div style="margin: 5px; border: 1px solid red;">foo<div style="margin: 5px; border: 1px solid blue;">bar</div></div>baz</ div> 6 <div id="copy" contenteditable="true"><div style="margin: 5px; border: 1px solid red;">foo<div style="margin: 5px; border: 1px solid blue;">bar</div></div>baz</ div>
8 7
9 <div id="paste" contenteditable="true"></div> 8 <div id="sample" contenteditable="true"></div>
9 <div id="log"></div>
10 <script>
11 test(function() {
12 var selection = window.getSelection();
13 selection.collapse(document.getElementById('copy'));
14 document.execCommand('SelectAll');
15 document.execCommand('Copy');
16 var sample = document.getElementById('sample');
17 selection.collapse(sample);
18 document.execCommand('Paste');
10 19
11 <script> 20 assert_equals(sample.innerHTML, '<div style="margin: 5px; border: 1px solid red;">foo<div style="margin: 5px; border: 1px solid blue;">bar</div></div>baz');
12 window.getSelection().collapse(document.getElementById("copy")); 21 assert_true(selection.isCollapsed);
13 document.execCommand("SelectAll"); 22 assert_equals(selection.anchorNode, sample.lastChild);
14 document.execCommand("Copy"); 23 assert_equals(selection.anchorOffset, 3);
15 window.getSelection().collapse(document.getElementById("paste")); 24 });
16 document.execCommand("Paste");
17 </script> 25 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698