Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / input-field-1.html
blob6e1247230ca75563a3a5a9a236dd4675b78b7277
1 <script>
2 if (window.testRunner)
3 testRunner.dumpEditingCallbacks();
4 </script>
5 <script>
6 function log(str) {
7 var li = document.createElement("li");
8 li.appendChild(document.createTextNode(str));
9 var console = document.getElementById("console");
10 console.appendChild(li);
12 function shouldBe(expected, actual) {
13 if (expected != actual)
14 log("Failure. Expected: " + expected + ", Actual: " + actual);
15 else
16 log("Passed");
18 </script>
20 <p>This tests Copy/Paste of a input field.</p>
21 <div id="div" contenteditable="true"><input type="text"></div>
22 <ul id="console"></ul>
23 <script>
24 var div = document.getElementById("div");
25 div.focus();
26 document.execCommand("SelectAll");
28 document.execCommand("Copy");
29 var sel = window.getSelection();
30 sel.modify("move", "forward", "character");
31 document.execCommand("Paste");
33 shouldBe(document.getElementsByTagName("input").length, 2);
34 </script>