blob: 9e9601230deb61e5b7e0c511269b9be02a5e65f3 [file] [log] [blame]
ap@apple.com8d15a822013-08-09 23:25:11 +00001<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>
6if (window.testRunner) {
7 testRunner.waitUntilDone();
8 testRunner.dumpAsText();
ap@apple.com8d15a822013-08-09 23:25:11 +00009}
10
11var result = document.getElementById("result");
12
13window.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
28window.open("data:text/html,<script>opener.postMessage('[' + window.innerWidth + ',' + window.innerHeight + ']', '*'); window.close();<" + "/script>", "", "height=0,width=0");
29</script>
30</body>
31</html>