2 if (window.testRunner) {
3 testRunner.dumpEditingCallbacks();
4 testRunner.dumpAsText();
8 var li = document.createElement("li");
9 li.appendChild(document.createTextNode(str));
10 var console = document.getElementById("console");
11 console.appendChild(li);
13 function shouldBe(expected, actual) {
14 if (expected != actual)
15 log("Failure. Expected: " + expected + ", Actual: " + actual);
20 <p>This tests copy/paste of select elements. All the options should be included.</p>
21 <div id="copy" contenteditable="true">
25 <option>Three</option>
29 <div id="paste" contenteditable="true"></div>
30 <ul id="console"></ul>
32 var copy = document.getElementById("copy");
34 document.execCommand("SelectAll");
35 document.execCommand("Cut");
37 shouldBe(document.getElementById("select"), null);
39 var paste = document.getElementById("paste");
41 document.execCommand("Paste");
43 var select = document.getElementById("select");
44 shouldBe(select.options[0].value, "One");
45 shouldBe(select.options[1].value, "Two");
46 shouldBe(select.options[2].value, "Three");