Change log level: info -> debug
[framework/web/webkit-efl.git] / LayoutTests / editing / pasteboard / drop-inputtext-acquires-style.html
1 <html>
2 <script>
3 if (window.testRunner)
4      testRunner.dumpAsText();
5 </script>
6 <div>This test checks that the plain text dropped into a styled text region will acquire the appropriate style.</div>
7 <p>To run this test manually, drag the text in the input element below into the bold text region.  The dropped text should be bold.
8 Click the verify button to check.</p>
9 <input type="button" value="Verify" onClick="verifier()">
10 <br />
11 <input id="grabme" value="Drag this text" >
12 <br />
13 <b contenteditable="true" id="destination">Drag the text from the above input element into this bold text</b>
14 <ul id="console"></ul>
15
16 <script>
17 function log(message) {
18     var console = document.getElementById("console");
19     var li = document.createElement("li");
20     var pre = document.createElement("pre");
21     pre.appendChild(document.createTextNode(message));
22     li.appendChild(pre);
23     console.appendChild(li);
24 }
25
26 function runTest() {
27     var textToDrag = document.getElementById("grabme");
28     textToDrag.focus();
29
30     if (!window.testRunner)
31         return;
32     
33     var x = textToDrag.offsetLeft + textToDrag.offsetWidth / 2;
34     var y = textToDrag.offsetTop + textToDrag.offsetHeight / 2;
35
36     eventSender.mouseMoveTo(x, y);
37
38     eventSender.mouseDown();
39     // Wait a moment so that the mouseDown will kick off a drag
40     eventSender.leapForward(400);
41     
42     var destinationObject = document.getElementById("destination");
43     var x = destinationObject.offsetLeft + destinationObject.offsetWidth / 2;
44     var y = destinationObject.offsetTop + destinationObject.offsetHeight / 2;
45
46
47     eventSender.mouseMoveTo(x, y);
48     eventSender.mouseUp();
49
50     verifier();
51 }
52
53 function verifier() {
54     log(document.getElementById("destination").outerHTML);
55     if (document.getElementById("destination").childNodes.length == 1)
56         log("SUCCESS");
57     else
58         log("FAILURE");
59 }
60
61 runTest();
62 </script>
63 </html>