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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/execCommand/paste-2.html

Issue 1459783003: Make layout tests in editing/deleting and editing/execCommand to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 <script> 4 <script>
2 if (window.testRunner) 5 var tester = async_test('iframe');
3 testRunner.dumpEditingCallbacks(); 6 function runTest() {
7 if (window.internals)
8 internals.settings.setEditingBehavior('win');
4 9
5 function runTest() {
6 var frame = frames[0]; 10 var frame = frames[0];
7 var sel = frame.getSelection(); 11 var selection = frame.getSelection();
8 var doc = frame.document; 12 var doc = frame.document;
9 13
10 sel.collapse(doc.body, 0); 14 selection.collapse(doc.body, 0);
11 doc.execCommand("InsertText", false, "foo bar baz"); 15 doc.execCommand('InsertText', false, 'foo bar baz');
12 sel.modify("extend", "backward", "word"); 16 selection.modify('extend', 'backward', 'word');
13 doc.execCommand("Copy"); 17 doc.execCommand('Copy');
14 doc.execCommand("Delete"); 18 doc.execCommand('Delete');
15 doc.execCommand("Paste"); 19 doc.execCommand('Paste');
16 if (window.testRunner) 20
17 window.testRunner.notifyDone(); 21 tester.step(function() { assert_equals(doc.body.innerHTML.replace(/&nbsp;/, ' ', 'g'), 'foo bar baz'); });
22 tester.done();
18 } 23 }
19
20 if (window.testRunner)
21 window.testRunner.waitUntilDone();
22 </script> 24 </script>
23 <p>This tests copy/delete/paste inside an editable iframe. You should see 'foo bar baz' below.</p> 25 <p>This tests copy/delete/paste inside an editable iframe. You should see 'foo bar baz' below.</p>
24 <iframe src="../resources/contenteditable-iframe-src.html" onload="runTest();">< /iframe> 26 <iframe srcdoc="<body contenteditable></body>" onload="runTest()"></iframe>
27 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698