/*
The request cache vs. the PositionOptions cache is confusing to the reader, to explain:
Testing uses mochitest httpd, so the network cache must be disabled in order for requests
to propagate to mochitest httpd. Otherwise, every request looks like a geoip request,
and the network request cache sees no reason to make a web request for location for geoip
if it has already made geoip (or better) requests.
We should investigate providing fake wifi and cell scans to the
network location provider, then the network cache does not need to be shut off
AND it will get testing coverage.
function errorCallback(_err) {
ok(false, "error callback should not have been called");
done();
}
function test_cachedPosition() { var cached = null;
navigator.geolocation.getCurrentPosition(function(pos) {
// first call is just to warm up the cache
check_geolocation(pos);
navigator.geolocation.getCurrentPosition(function(pos3) {
check_geolocation(pos3);
is(pos3.timestamp, cached.timestamp, "position should be equal to cached position");
navigator.geolocation.getCurrentPosition(function(pos4) {
// force new position, can't be the one we have
check_geolocation(pos4);
isnot(pos4.timestamp, cached.timestamp, "position should not be equal to cached position");
done();
}, errorCallback, {maximumAge: 0});
}, errorCallback, {maximumAge: 21600000});
}, errorCallback, {maximumAge: 21600000});
}, errorCallback, {maximumAge: 21600000});
}
</script>
</pre>
</body>
</html>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.