pjs/dom/tests/mochitest/geolocation/test_manyCurrentSerial.html

56 строки
1.3 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=482260
-->
<head>
<title>Test for getCurrentPosition </title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<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" href="https://bugzilla.mozilla.org/show_bug.cgi?id=482260">Mozilla Bug 482260</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
var completeCount = 1000;
var hasAccepted = false;
function successCallback(position) {
check_geolocation(position);
completeCount--;
if (completeCount > 0)
navigator.geolocation.getCurrentPosition(successCallback, null, null);
SimpleTest.finish();
}
function accept() {
hasAccepted = true;
clickNotificationButton(kAcceptButton);
}
SimpleTest.waitForExplicitFinish();
var options = {
maximumAge: 0,
};
// one-shot position requests
navigator.geolocation.getCurrentPosition(successCallback, null, options);
setTimeout(accept, 50);
</script>
</pre>
</body>
</html>