Change log level: info -> debug
[framework/web/webkit-efl.git] / LayoutTests / editing / pasteboard / text-selection.html
1 <!DOCTYPE html>
2 <html>
3 <body oncopy="copy(event)" onpaste="paste(event)">
4 <div id="text">This file tests if text selection is causing oncopy event to get fired. This test requires DRT.</div>
5 <div id="console"></div>
6
7 <script src="../editing.js"></script>
8 <script>
9
10 var oncopyCounter = 0;
11
12 function log(text)
13 {
14     var console = document.getElementById('console');
15     console.appendChild(document.createTextNode(text));
16     console.appendChild(document.createElement('br'));
17 }
18
19 function copy(ev)
20 {
21     ++oncopyCounter;
22 }
23
24 function runTest() {
25     if (!window.testRunner)
26         return;
27     testRunner.dumpAsText();
28
29     log("Selecting text with mouse, no copy events should occur:");
30     log("Event count: " + oncopyCounter)
31
32     var text = document.getElementById("text")
33     eventSender.mouseMoveTo(text.offsetLeft, text.offsetTop);
34     eventSender.mouseDown();
35     eventSender.mouseMoveTo(text.offsetLeft + text.offsetWidth, text.offsetTop);
36     eventSender.mouseUp();
37
38     log("Copying text, 1 copy event should occur:");
39     
40     copyCommand();
41     log("Event count: " + oncopyCounter);
42 }
43
44 runTest();
45
46 </script>
47 </body>
48 </html>