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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/execCommand/paste-1.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');
9 var frame = frames[0];
10 var selection = frame.getSelection();
11 var doc = frame.document;
4 12
5 function foo() { 13 selection.collapse(doc.body, 0);
6 var frame = frames[0]; 14 doc.execCommand('InsertText', false, 'foo bar baz');
7 var sel = frame.getSelection(); 15 selection.modify('extend', 'backward', 'word');
8 var doc = frame.document; 16 doc.execCommand('Cut');
9 17 doc.execCommand('Paste');
10 sel.collapse(doc.body, 0); 18
11 doc.execCommand("InsertText", false, "foo bar baz"); 19 tester.step(function() { assert_equals(doc.body.innerHTML.replace(/&nbsp;/, ' ', 'g'), 'foo bar baz'); });
12 sel.modify("extend", "backward", "word"); 20 tester.done();
13 doc.execCommand("Cut");
14 doc.execCommand("Paste");
15 if (window.testRunner)
16 window.testRunner.notifyDone();
17 } 21 }
18 if (window.testRunner)
19 window.testRunner.waitUntilDone();
20 </script> 22 </script>
21
22 <p>This tests cut/paste inside an editable iframe. You should see 'foo bar baz' below.</p> 23 <p>This tests cut/paste inside an editable iframe. You should see 'foo bar baz' below.</p>
23 <iframe src="../resources/contenteditable-iframe-src.html" onload="foo();"></ifr ame> 24 <iframe srcdoc="<body contenteditable></body>" onload="runTest()"></iframe>
25 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698