mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 21:28:04 +02:00
Automatic update from web-platform-testsFix partial issues from #10198 (#10962) - `if (testRunner)` should be `if (window.testRunner)` - Use String to pass sensor object param to avoid undefined error -- wpt-commits: 7cbefa75635b6ec86d99bb06abc8a68ffc624b68 wpt-pr: 10962
25 lines
885 B
HTML
25 lines
885 B
HTML
<!DOCTYPE html>
|
|
<body>
|
|
<title>GeolocationSensor Feature Policy Test: Disabled</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/feature-policy/resources/featurepolicy.js"></script>
|
|
<script src="/generic-sensor/generic-sensor-feature-policy-test.sub.js"></script>
|
|
<script>
|
|
"use strict";
|
|
|
|
run_fp_tests_disabled('GeolocationSensor');
|
|
|
|
promise_test(async t => {
|
|
await promise_rejects(t, 'SecurityError', GeolocationSensor.read());
|
|
}, "GeolocationSensor.read(): 'SecurityError' is thrown when disabled by Feature Policy");
|
|
|
|
promise_test(async t => {
|
|
const controller = new AbortController();
|
|
const signal = controller.signal;
|
|
controller.abort();
|
|
|
|
await promise_rejects(t, 'AbortError', GeolocationSensor.read({ signal }));
|
|
}, "GeolocationSensor.read(): 'AbortError' takes priority");
|
|
</script>
|
|
</body>
|