chromium/third_party/blink/web_tests/external/wpt/permissions/feature-policy-permissions-query.html

<script>
'use strict';

Promise.resolve().then(() => navigator.permissions.query({name:'geolocation'}))
  .then(permissionStatus => {
  window.parent.postMessage({ state: permissionStatus.state }, '*');
}, error => {
  window.parent.postMessage({ state: null }, '*');
});
</script>