OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
Julien - ping for review
2014/04/21 17:46:46
We prefer to use the HTML5 doctype (easier to read
harpreet.sk
2014/04/24 15:28:27
Changed to HTML5 doctype.
| |
3 <html> | |
4 <head> | |
5 <script> | |
6 function log(msg) | |
7 { | |
8 document.getElementById('console').appendChild(document.createTextNode(msg + '\n')); | |
9 } | |
10 | |
11 function updateSize() | |
Julien - ping for review
2014/04/21 17:46:46
I am not a huge fan of bundling several tests into
harpreet.sk
2014/04/24 15:28:27
This layout test is removed and 3 new layout test
| |
12 { | |
13 var textAreaElement = document.getElementById("textInputID"); | |
14 textAreaElement.style.minWidth="10%"; | |
15 textAreaElement.style.minHeight="10%"; | |
16 test(); | |
17 } | |
18 | |
19 function test() | |
20 { | |
21 if (window.testRunner) { | |
22 testRunner.waitUntilDone(); | |
Julien - ping for review
2014/04/21 17:46:46
You don't need to make the test asynchronous as we
harpreet.sk
2014/04/24 15:28:27
Done.
| |
23 testRunner.dumpAsText(); | |
24 testDragAndMove(); | |
25 } else | |
26 log("testRunner is not available"); | |
Julien - ping for review
2014/04/21 17:46:46
That's not an helpful and actionable message. Some
harpreet.sk
2014/04/24 15:28:27
Action message is modified.
| |
27 } | |
28 | |
29 function testDragAndMove() | |
30 { | |
31 var draggable = document.getElementById("textInputID"); | |
32 var startX = draggable.offsetLeft + 400; | |
33 var startY = draggable.offsetTop + 400; | |
34 | |
35 log("TextArea initial width is " + draggable.style.width); | |
36 log("TextArea initial height is " + draggable.style.height); | |
37 log("Dragging textarea to reduce it's width by 250px and height by 340px"); | |
38 | |
39 eventSender.dragMode = false; | |
40 eventSender.mouseMoveTo(startX,startY); | |
41 eventSender.mouseDown(); | |
42 // Then drag it. OK not to crash. | |
43 eventSender.mouseMoveTo(startX - 250, startY - 340); | |
44 //eventSender.mouseMoveTo(startX + 20, startY + 20); | |
45 eventSender.mouseUp(); | |
46 | |
47 log("After dragging textarea new width is " + draggable.style.width); | |
48 log("After dragging textarea new height is " + draggable.style.height); | |
49 log("You will see a PASS message below if new width is 150px and new height is 60px"); | |
50 | |
51 if ((draggable.style.width == "150px") && (draggable.style.height == "60px") ) | |
52 log("PASS"); | |
53 | |
54 testRunner.notifyDone(); | |
55 } | |
56 </script> | |
57 </head> | |
58 <body onload="updateSize()"> | |
59 <textarea style="width:400px; height:400px; min-width:200px; min-height:200px" i d="textInputID"> | |
60 Some text | |
61 </textarea> | |
62 <pre id="console"></pre> | |
63 </body> | |
64 </html> | |
OLD | NEW |