Bug 482260 Bustage Fix r=ctalbert

This commit is contained in:
Clint Talbert 2009-08-14 16:34:40 -07:00
Родитель 560c3d2d1e
Коммит c1de92622b
5 изменённых файлов: 295 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,55 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=482260
-->
<head>
<title>Test for garbage data returned from location provider </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=455327">Mozilla Bug 482260</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug **/
SimpleTest.waitForExplicitFinish();
start_sending_garbage();
function successCallback(pos){
ok(false, "success should have never been called.");
stop_sending_garbage();
SimpleTest.finish();
}
function errorCallback(err) {
ok(err.code == err.TIMEOUT, "ensure error is a timeout.");
stop_sending_garbage();
SimpleTest.finish();
}
var options = {
maximumAge: 0,
timeout: 1000,
};
navigator.geolocation.watchPosition(successCallback,
errorCallback,
options);
setTimeout(clickNotificationButton, 10, kAcceptButton);
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -0,0 +1,62 @@
<!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 = 100;
var hasAccepted = false;
function successCallback(position) {
check_geolocation(position);
}
function accept() {
hasAccepted = true;
clickNotificationButton(kAcceptButton);
}
SimpleTest.waitForExplicitFinish();
// one-shot position requests
var options = {
maximumAge: 0,
};
var y = completeCount;
for (var x=0; x< y; x++)
navigator.geolocation.getCurrentPosition(successCallback, null, options);
setTimeout(accept, 50);
setTimeout(done, 1000);
function done() {
completeCount--;
ok(1, "Saw all successCallbacks");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -0,0 +1,55 @@
<!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>

Просмотреть файл

@ -0,0 +1,61 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=482260
-->
<head>
<title>Test for watchPosition </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 = 100;
var hasAccepted = false;
function successCallback(position) {
check_geolocation(position);
}
function accept() {
hasAccepted = true;
clickNotificationButton(kAcceptButton);
}
SimpleTest.waitForExplicitFinish();
// one-shot position requests
var options = {
maximumAge: 0,
};
var y = completeCount;
for (var x=0; x< y; x++)
navigator.geolocation.watchPosition(successCallback, null, options);
setTimeout(accept, 50);
setTimeout(done, 1000);
function done() {
completeCount--;
ok(1, "Saw all successCallbacks");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -0,0 +1,62 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=482260
-->
<head>
<title>Test for watchPosition </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 hasAccepted = false;
var watchID = 0;
var completeCount = 10;
var options = {
maximumAge: 0,
};
function successCallback(position) {
check_geolocation(position);
navigator.geolocation.clearWatch(watchID);
completeCount--;
if (completeCount==0) {
ok(1, "all watchPosition successCallbacks called");
SimpleTest.finish();
} else {
watchID = navigator.geolocation.watchPosition(successCallback, null, options);
setTimeout(accept, 50);
}
}
function accept() {
hasAccepted = true;
clickNotificationButton(kAcceptButton);
}
SimpleTest.waitForExplicitFinish();
// one-shot position requests
watchID = navigator.geolocation.watchPosition(successCallback, null, options);
setTimeout(accept, 50);
</script>
</pre>
</body>
</html>