OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script> | |
5 function log(msg) | |
tkent
2014/04/29 23:36:09
Please remove this function, include ../../resourc
deepak.sa
2014/05/02 06:18:46
Done.
| |
6 { | |
7 document.getElementById('console').appendChild(document.createTextNode(msg + '\n')); | |
8 } | |
9 | |
10 function testWithDoubleClick(element) | |
11 { | |
12 eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop); | |
13 eventSender.mouseDown(); | |
14 eventSender.mouseUp(); | |
15 eventSender.mouseDown(); | |
16 eventSender.mouseUp(); | |
17 } | |
18 | |
19 function checkSelection() | |
20 { | |
21 if ((window.getSelection().toString() == "Some")) | |
22 log("PASS selected text is :\"" + window.getSelection().toString() + "\" "); | |
tkent
2014/04/29 23:36:09
Please use shouldBeEqualToString() defined in js-t
deepak.sa
2014/05/02 06:18:46
Done.
| |
23 else | |
24 log("FAIL selected text is :\"" + window.getSelection().toString() + "\" "); | |
25 } | |
26 | |
27 function test() | |
28 { | |
29 if (window.testRunner) { | |
30 var labelElement = document.getElementById("labelWithInput"); | |
31 testRunner.dumpAsText(); | |
32 testWithDoubleClick(labelElement); | |
33 checkSelection(); | |
34 | |
35 document.getElementById('labelWithInput').style.display = "none"; | |
36 } else | |
37 log("This test needs window.testRunner and window.eventSender to work.") ; | |
38 } | |
39 | |
40 </script> | |
41 </head> | |
42 <body onload="test()"> | |
43 <label id="labelWithInput" for="inputText">Some Text associated with input</labe l> | |
44 <input id="inputText" type='text'></input> | |
keishi
2014/04/30 01:13:14
nit: input should not have an end tag.
deepak.sa
2014/05/02 06:18:46
Done.
| |
45 <pre id="console"></pre> | |
46 </body> | |
47 </html> | |
OLD | NEW |