fune/testing/web-platform/tests/geolocation-sensor/GeolocationSensor-disabled-by-feature-policy.https.html
Boris Zbarsky 745b772897 Bug 1613394 [wpt PR 21600] - Replace some "promise_rejects(t, 'SomeDOMError', stuff)" calls with p…, a=testonly
Automatic update from web-platform-tests
Replace some "promise_rejects(t, 'SomeDOMError', stuff)" calls with promise_rejects_dom.

This diff was generated by running:

  find . -type f -print0 | xargs -0 perl -pi -e "BEGIN { \$/ = undef; } s/promise_rejects\(([ \n]*[a-zA-Z_]+[ \n]*,[ \n]*)([\"'][A-Za-z_]*[\"']) *(, *.)/promise_rejects_dom(\1\2\3/gs"

in bash (doesn't work in tcsh, due to the $ inside "").

--

wpt-commits: b7f2dd315a8d84ce786f6336510ee51423011009
wpt-pr: 21600
2020-02-14 19:09:14 +00:00

25 lines
893 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_dom(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_dom(t, 'AbortError', GeolocationSensor.read({ signal }));
}, "GeolocationSensor.read(): 'AbortError' takes priority");
</script>
</body>