diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/geolocation-API/interfaces.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/geolocation-API/interfaces.html')
-rw-r--r-- | testing/web-platform/tests/geolocation-API/interfaces.html | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/testing/web-platform/tests/geolocation-API/interfaces.html b/testing/web-platform/tests/geolocation-API/interfaces.html new file mode 100644 index 000000000..0db420465 --- /dev/null +++ b/testing/web-platform/tests/geolocation-API/interfaces.html @@ -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> + |