Change log level: info -> debug
[framework/web/webkit-efl.git] / LayoutTests / editing / pasteboard / select-element-1.html
1 <script>
2 if (window.testRunner) {
3     testRunner.dumpEditingCallbacks();
4     testRunner.dumpAsText();
5 }
6
7 function log(str) {
8     var li = document.createElement("li");
9     li.appendChild(document.createTextNode(str));
10     var console = document.getElementById("console");
11     console.appendChild(li);
12 }
13 function shouldBe(expected, actual) {
14     if (expected != actual)
15         log("Failure. Expected: " + expected + ", Actual: " + actual);
16     else
17         log("Passed");
18 }
19 </script>
20 <p>This tests copy/paste of select elements.  All the options should be included.</p>
21 <div id="copy" contenteditable="true">
22     <select id="select">
23         <option>One</option>
24         <option>Two</option>
25         <option>Three</option>
26     </select>
27 </div>
28
29 <div id="paste" contenteditable="true"></div>
30 <ul id="console"></ul>
31 <script>
32 var copy = document.getElementById("copy");
33 copy.focus();
34 document.execCommand("SelectAll");
35 document.execCommand("Cut");
36
37 shouldBe(document.getElementById("select"), null);
38
39 var paste = document.getElementById("paste");
40 paste.focus();
41 document.execCommand("Paste");
42
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");
47 </script>