OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script> | |
5 function log(msg) | |
6 { | |
7 document.getElementById('console').appendChild(document.createTextNode(msg + '\n')); | |
8 } | |
9 | |
10 function test() | |
11 { | |
12 if (window.testRunner) { | |
13 testRunner.dumpAsText(); | |
14 testDragAndMove(); | |
15 } else | |
16 log("This test needs window.testRunner and window.eventSender to work. T o manually test it, drag the textarea above. \nFor test to pass the width and he ight of textarea should not go below min-width and min-height"); | |
17 } | |
18 | |
19 function testDragAndMove() | |
20 { | |
21 var draggable = document.getElementById("textInputID"); | |
22 var startX = draggable.offsetLeft + 400; | |
23 var startY = draggable.offsetTop + 400; | |
24 | |
25 eventSender.dragMode = false; | |
26 eventSender.mouseMoveTo(startX,startY); | |
27 eventSender.mouseDown(); | |
28 // Then drag it. | |
29 eventSender.mouseMoveTo(startX - 395, startY - 395); | |
30 eventSender.mouseUp(); | |
31 | |
32 if ((draggable.style.width == "9px") && (draggable.style.height == "9px")) | |
harpreet.sk
2014/04/24 15:28:27
The condition check here for 9px and not 15px as m
| |
33 log("PASS textAreaElement width is " + draggable.style.width + " and hei ght is " + draggable.style.height); | |
34 else | |
35 log("FAIL textAreaElement width is " + draggable.style.width + " and hei ght is " + draggable.style.height); | |
36 } | |
37 </script> | |
38 </head> | |
39 <body onload="test()"> | |
40 <textarea style="width:400px; height:400px" id="textInputID"> | |
41 Some text | |
42 </textarea> | |
43 <pre id="console"></pre> | |
44 </body> | |
45 </html> | |
OLD | NEW |