summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fenced-frame/resources/permission-geolocation-test-runner.html
blob: 724a35ce9a568b7c8bd00d9042271b920e23698f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<title>Fenced frame content to report the result of navigator.geolocation.getCurrentPosition()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="utils.js"></script>

<body>
<script>

window.runTest = async (fenced_frame_url) => {
  const [permission_geolocation_key] = parseKeylist();
  await test_driver.set_permission({name: 'geolocation'}, 'granted', true);

  attachFencedFrame(generateURL(fenced_frame_url, [permission_geolocation_key]));
  const actual_result = await nextValueFromServer(permission_geolocation_key);

  assert_equals(
      actual_result, 'result: denied',
      'geolocation permission is not permitted for fenced frames.');
};
</script>
</body>