OLD | NEW |
---|---|
(Empty) | |
1 <script> | |
2 var newwindow; | |
3 if (window.testRunner) { | |
4 testRunner.dumpAsText(); | |
5 testRunner.setCanOpenWindows(); | |
6 testRunner.setPopupBlockingEnabled(false); | |
7 testRunner.setCloseRemainingWindowsWhenComplete(true); | |
8 testRunner.waitUntilDone(); | |
9 } | |
10 | |
11 function loadImageInNewWindow() | |
12 { | |
13 newwindow = window.open('resources/jpeg-height-exif-orientation.jpg'); | |
14 if (window.testRunner) | |
15 testRunner.useUnfortunateSynchronousResizeMode(); | |
16 | |
17 newwindow.onload = function() { | |
18 newwindow.onresize = function() { | |
19 var image = newwindow.document.querySelector('img'); | |
20 if (image.clientWidth == 0) { | |
21 // On GTK+, sometimes the resize callback fires before the GTK | |
22 // window has finished resizing. If that happens, try to resize | |
23 // again. | |
24 setTimeout(function() { | |
25 newwindow.resizeTo(360, 360); | |
26 }, 0); | |
27 return; | |
28 } else { | |
29 newwindow.location.reload(); | |
30 setTimeout(function() { | |
31 document.write(newwindow.document.title); | |
Noel Gordon
2014/02/21 05:26:45
Can you think of a way to write this test that avo
| |
32 testRunner.notifyDone(); | |
33 }, 1000); | |
34 } | |
35 }; | |
36 newwindow.resizeTo(360, 360); | |
37 }; | |
38 } | |
39 | |
40 loadImageInNewWindow(); | |
41 </script> | |
OLD | NEW |