Editing tests should use testRunner instead of layoutTestController
[WebKit-https.git] / LayoutTests / editing / pasteboard / paste-visible-script.html
1 <body>
2 <div id="test1" >
3 Hello
4 <script style="display: block">
5 function sayHello()
6 {
7     alert("Hello");
8 }
9 </script>
10 <script>
11 function foo() {
12     var i = 10;
13     if (i >= 10)
14         alert('foo');
15 }
16 </script>
17 <script style="display: block" src="../editing.js">
18 </script>
19 <div id="test2">
20 World
21 </div>
22 <div id="pastehere" contenteditable="true"></div>
23 <ul id="console"></ul>
24 <script>
25 if (window.testRunner)
26      testRunner.dumpAsText();
27
28 var s = window.getSelection();
29 var p1 = document.getElementById("test1");
30 s.setPosition(p1, 0);
31 s.setBaseAndExtent(p1, 0, document.getElementById("test2"), 2);
32 document.execCommand("Copy");
33 p1 = document.getElementById("pastehere");
34 s.setPosition(p1, 0);
35 document.execCommand("Paste");
36
37 log(document.getElementById("pastehere").outerHTML);
38
39 function log(str) {
40     var li = document.createElement("li");
41     li.appendChild(document.createTextNode(str));
42     var console = document.getElementById("console");
43     console.appendChild(li);
44 }
45 </script>
46 </body>