mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005'
This commit is contained in:
parent
ace9b32b1c
commit
df68c4e5d1
15632 changed files with 514865 additions and 155000 deletions
|
@ -1,17 +1,28 @@
|
|||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
// META: script=/resources/testdriver.js
|
||||
// META: script=/resources/testdriver-vendor.js
|
||||
|
||||
// https://www.w3.org/TR/geolocation-API/
|
||||
|
||||
idl_test(
|
||||
['geolocation'],
|
||||
['hr-time', 'html'],
|
||||
idl_array => {
|
||||
self.audio = document.createElement('audio');
|
||||
self.video = document.createElement('video');
|
||||
window.onload = async () => {
|
||||
await test_driver.set_permission({ name: "geolocation" }, "denied");
|
||||
const positionError = await new Promise((resolve, reject) => {
|
||||
navigator.geolocation.getCurrentPosition(reject, resolve);
|
||||
});
|
||||
|
||||
await test_driver.set_permission({ name: "geolocation" }, "granted");
|
||||
const position = await new Promise((resolve, reject) => {
|
||||
navigator.geolocation.getCurrentPosition(resolve, reject);
|
||||
});
|
||||
|
||||
idl_test(["geolocation"], ["hr-time", "html"], (idl_array) => {
|
||||
idl_array.add_objects({
|
||||
Navigator: ['navigator'],
|
||||
Geolocation: ['navigator.geolocation'],
|
||||
Navigator: ["navigator"],
|
||||
Geolocation: ["navigator.geolocation"],
|
||||
GeolocationPositionError: [positionError],
|
||||
GeolocationPosition: [position],
|
||||
GeolocationCoordinates: [position.coords],
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue