ap@apple.com | 8d15a82 | 2013-08-09 23:25:11 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <body> |
| 3 | <p>Test that passing "height=0,width=0" to window.open() results in default window size.</p> |
| 4 | <div id=result></div> |
| 5 | <script> |
| 6 | if (window.testRunner) { |
| 7 | testRunner.waitUntilDone(); |
| 8 | testRunner.dumpAsText(); |
ap@apple.com | 8d15a82 | 2013-08-09 23:25:11 +0000 | [diff] [blame] | 9 | } |
| 10 | |
| 11 | var result = document.getElementById("result"); |
| 12 | |
| 13 | window.addEventListener("message", function (e) { |
| 14 | try { |
| 15 | var dimensions = JSON.parse(e.data); |
| 16 | if (dimensions[0] > 100 && dimensions[1] > 100) |
| 17 | result.innerHTML = "PASS"; |
| 18 | else |
| 19 | result.innerHTML = "FAIL: " + e.data; |
| 20 | } catch (ex) { |
| 21 | alert("FAIL: " + ex + " (" + e.data + ")"); |
| 22 | } |
| 23 | |
| 24 | if (window.testRunner) |
| 25 | testRunner.notifyDone(); |
| 26 | }, false); |
| 27 | |
| 28 | window.open("data:text/html,<script>opener.postMessage('[' + window.innerWidth + ',' + window.innerHeight + ']', '*'); window.close();<" + "/script>", "", "height=0,width=0"); |
| 29 | </script> |
| 30 | </body> |
| 31 | </html> |