mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
95
tests/wpt/web-platform-tests/geolocation-API/interfaces.html
Normal file
95
tests/wpt/web-platform-tests/geolocation-API/interfaces.html
Normal file
|
@ -0,0 +1,95 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Geolocation API IDL tests</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/geolocation-API/">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/WebIDLParser.js"></script>
|
||||
<script src="/resources/idlharness.js"></script>
|
||||
|
||||
<h1>Geolocation API IDL tests</h1>
|
||||
<div id="log"></div>
|
||||
|
||||
<script type=text/plain class=untested>
|
||||
interface Navigator {
|
||||
};
|
||||
|
||||
typedef unsigned long long DOMTimeStamp;
|
||||
</script>
|
||||
|
||||
<script type=text/plain>
|
||||
partial interface Navigator {
|
||||
readonly attribute Geolocation geolocation;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface Geolocation {
|
||||
void getCurrentPosition(PositionCallback successCallback,
|
||||
optional PositionErrorCallback errorCallback,
|
||||
optional PositionOptions options);
|
||||
|
||||
long watchPosition(PositionCallback successCallback,
|
||||
optional PositionErrorCallback errorCallback,
|
||||
optional PositionOptions options);
|
||||
|
||||
void clearWatch(long watchId);
|
||||
};
|
||||
|
||||
callback PositionCallback = void (Position position);
|
||||
|
||||
callback PositionErrorCallback = void (PositionError positionError);
|
||||
|
||||
dictionary PositionOptions {
|
||||
boolean enableHighAccuracy = false;
|
||||
[Clamp] unsigned long timeout = 0xFFFFFFFF;
|
||||
[Clamp] unsigned long maximumAge = 0;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface Position {
|
||||
readonly attribute Coordinates coords;
|
||||
readonly attribute DOMTimeStamp timestamp;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface Coordinates {
|
||||
readonly attribute double latitude;
|
||||
readonly attribute double longitude;
|
||||
readonly attribute double? altitude;
|
||||
readonly attribute double accuracy;
|
||||
readonly attribute double? altitudeAccuracy;
|
||||
readonly attribute double? heading;
|
||||
readonly attribute double? speed;
|
||||
};
|
||||
|
||||
[NoInterfaceObject]
|
||||
interface PositionError {
|
||||
const unsigned short PERMISSION_DENIED = 1;
|
||||
const unsigned short POSITION_UNAVAILABLE = 2;
|
||||
const unsigned short TIMEOUT = 3;
|
||||
readonly attribute unsigned short code;
|
||||
readonly attribute DOMString message;
|
||||
};
|
||||
</script>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
var idlArray;
|
||||
setup(function() {
|
||||
idlArray = new IdlArray();
|
||||
[].forEach.call(document.querySelectorAll("script[type=text\\/plain]"), function(node) {
|
||||
if (node.className == "untested") {
|
||||
idlArray.add_untested_idls(node.textContent);
|
||||
} else {
|
||||
idlArray.add_idls(node.textContent);
|
||||
}
|
||||
});
|
||||
idlArray.add_objects({
|
||||
Navigator: ["navigator"],
|
||||
Geolocation: ["navigator.geolocation"]
|
||||
});
|
||||
});
|
||||
idlArray.test();
|
||||
</script>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue