mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
30
tests/wpt/web-platform-tests/geolocation-API/support.js
Normal file
30
tests/wpt/web-platform-tests/geolocation-API/support.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
var geo;
|
||||
|
||||
setup(function() {
|
||||
geo = navigator.geolocation;
|
||||
}, {explicit_done: true});
|
||||
|
||||
// The spec states that an implementation SHOULD acquire user permission before
|
||||
// beggining the position acquisition steps. If an implementation follows this
|
||||
// advice, set the following flag to aid debugging.
|
||||
var isUsingPreemptivePermission = false;
|
||||
|
||||
|
||||
var dummyFunction = function() {};
|
||||
|
||||
var positionToString = function(pos) {
|
||||
var c = pos.coords;
|
||||
return '[lat: ' + c.latitude + ', lon: ' + c.longitude + ', acc: ' + c.accuracy + ']';
|
||||
};
|
||||
|
||||
var errorToString = function(err) {
|
||||
var codeString;
|
||||
switch(err.code) {
|
||||
case err.UNKNOWN_ERROR: codeString = 'UNKNOWN_ERROR'; break;
|
||||
case err.PERMISSION_DENIED: codeString = 'PERMISSION_DENIED'; break;
|
||||
case err.POSITION_UNAVAILABLE: codeString = 'POSITION_UNAVAILABLE'; break;
|
||||
case err.TIMEOUT: codeString = 'TIMEOUT'; break;
|
||||
default: codeString = 'undefined error code'; break;
|
||||
}
|
||||
return '[code: ' + codeString + ' (' + err.code + '), message: ' + (err.message ? err.message : '(empty)') + ']';
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue