2008-07-15 16:37:48 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
2009-03-14 21:03:21 -07:00
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=478911
|
2008-07-15 16:37:48 -07:00
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for many windows </title>
|
2009-05-06 13:46:04 -07:00
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
2008-07-15 16:37:48 -07:00
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="text/javascript" src="geolocation_common.js"></script>
|
|
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank"
|
2009-03-14 21:03:21 -07:00
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=478911">Crash in Multiple Windows</a>
|
2008-07-15 16:37:48 -07:00
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
|
|
|
/** Test for Bug **/
|
|
|
|
|
2009-06-11 17:46:46 -07:00
|
|
|
var numberOfWindows = 5; // 20 seems to be the default max popups during the mochitest run
|
2008-07-15 16:37:48 -07:00
|
|
|
var totalWindows = numberOfWindows;
|
|
|
|
|
|
|
|
var windows = new Array(numberOfWindows);
|
|
|
|
|
|
|
|
for(var i = 0; i < numberOfWindows; i++) {
|
2008-08-14 09:35:49 -07:00
|
|
|
windows[i] = window.open("geolocation.html", "_blank", "width=700,height=400");
|
2008-07-15 16:37:48 -07:00
|
|
|
}
|
|
|
|
|
2009-06-11 17:46:46 -07:00
|
|
|
function closeWindows()
|
|
|
|
{
|
|
|
|
for(var i = 0; i < numberOfWindows; i++) {
|
|
|
|
windows[i].close();
|
|
|
|
totalWindows --;
|
|
|
|
}
|
2008-07-15 16:37:48 -07:00
|
|
|
}
|
|
|
|
|
2009-03-17 07:22:54 -07:00
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
2008-07-15 16:37:48 -07:00
|
|
|
function checkDone()
|
|
|
|
{
|
|
|
|
if (totalWindows == 0)
|
|
|
|
{
|
2008-08-14 09:35:49 -07:00
|
|
|
ok(navigator.geolocation, "Opened a bunch of windows and didn't crash.");
|
2008-07-15 16:37:48 -07:00
|
|
|
clearInterval(timer);
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var timer = setInterval(checkDone, 1000);
|
|
|
|
|
2009-06-11 17:46:46 -07:00
|
|
|
setTimeout(closeWindows, 5000);
|
|
|
|
|
2008-07-15 16:37:48 -07:00
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|