2008-09-04 16:31:09 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
2009-03-14 21:03:21 -07:00
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=478911
|
2008-09-04 16:31:09 -07:00
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for getCurrentPosition </title>
|
2009-05-06 13:46:04 -07:00
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
2008-09-04 16:31:09 -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>
|
2009-03-14 21:03:21 -07:00
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478911">Mozilla Bug 478911</a>
|
2008-09-04 16:31:09 -07:00
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
2009-03-14 21:03:21 -07:00
|
|
|
var hasAccepted = false;
|
2008-09-04 16:31:09 -07:00
|
|
|
|
2009-03-14 21:03:21 -07:00
|
|
|
function successCallback(position) {
|
|
|
|
ok(hasAccepted, "Ensure that accept was pressed");
|
|
|
|
check_geolocation(position);
|
2008-09-04 16:31:09 -07:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
2009-03-14 21:03:21 -07:00
|
|
|
function accept() {
|
|
|
|
hasAccepted = true;
|
2009-03-31 09:35:55 -07:00
|
|
|
clickNotificationButton(kAcceptButton);
|
2009-03-14 21:03:21 -07:00
|
|
|
}
|
2008-09-04 16:31:09 -07:00
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
2009-08-14 16:12:09 -07:00
|
|
|
var options = {
|
|
|
|
maximumAge: 0,
|
|
|
|
};
|
|
|
|
|
2008-09-04 16:31:09 -07:00
|
|
|
// one-shot position requests
|
2009-08-14 16:12:09 -07:00
|
|
|
navigator.geolocation.getCurrentPosition(successCallback, null, options);
|
2008-09-04 16:31:09 -07:00
|
|
|
|
2009-03-14 21:03:21 -07:00
|
|
|
setTimeout(accept, 50);
|
2008-09-04 16:31:09 -07:00
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|