6 if (window
.testRunner
) {
7 testRunner
.dumpAsText();
8 testRunner
.setCanOpenWindows();
9 testRunner
.waitUntilDone();
14 var console
= document
.getElementById("console");
15 console
.appendChild(document
.createTextNode(message
+ "\n"));
20 var newwindow
= window
.open("resources/dice.png");
21 if (window
.testRunner
)
22 testRunner
.useUnfortunateSynchronousResizeMode();
23 newwindow
.onload = function() {
25 newwindow
.onresize = function() {
26 var image
= newwindow
.document
.querySelector("img");
27 if (image
.clientWidth
== 0) {
28 // On GTK+, sometimes the resize callback fires before the GTK
29 // window has finished resizing. If that happens, try to resize
31 setTimeout(function() {
32 newwindow
.resizeTo(200, 200);
37 if (window
.eventSender
) {
38 eventSender
.zoomPageOut();
39 var w
= Math
.round(image
.clientWidth
);
40 var h
= Math
.round(image
.clientHeight
);
41 log("Size at zoom level" + (count
) + " : " + w
+ " x " + h
);
43 testRunner
.notifyDone();
47 newwindow
.resizeTo(200, 200);
51 <body onload=
"zoomPage()">
52 <p>This tests that page zoom and image auto-sizing interact well together. This test requires testRunner to run. To test manually, open
<a href=
"resources/dice.png">this image
</a> in a browser window, resize the window to
200px tall and zoom out
6 times. The image should get smaller at each step.
</p>
53 <pre id=
"console"></pre>