-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore geolocation permission for wpt geolocation policy tests and m…
…ake attribute tests more similar Permission was removed from permissions-policy-geolocation.html upstream but not re-added to the individual tests. These two tests need it. They were incorrectly passing in CI due to the tests that run before them (disabled-by-permissions-policy.https.sub.html) granting the permission -- they would fail when run individually. This also does some cosmetic cleanup to make it clear that the tests are very similar. This includes renaming the tests from "Geolocation API" to "Geolocation", as the name was changed in Bug 1902628 [wpt PR 46750]. Additionally, enabled-by-permission-policy-attribute fails in test-verify mode as an async_test -- the async setup function is not compatible with that. enabled-by-permission-policy-attribute-redirect-on-load is the same test but with a redirect -- it is a promise_test. This switches enabled-by-permission-policy-attribute to work as a promise_test, which fixes the test-verify issue. Differential Revision: https://phabricator.services.mozilla.com/D232772 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1937188 gecko-commit: 2ad450615824e0e0ba0d95e928a8d3e0d59c2f9e gecko-reviewers: saschanaz, jgraham
- Loading branch information
1 parent
b4b2ff9
commit 85b330f
Showing
2 changed files
with
45 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 35 additions & 28 deletions
63
geolocation/enabled-by-permission-policy-attribute.https.sub.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,41 @@ | ||
<!DOCTYPE html> | ||
<body> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/permissions-policy/resources/permissions-policy.js"></script> | ||
<script> | ||
"use strict"; | ||
<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="/permissions-policy/resources/permissions-policy.js"></script> | ||
<script> | ||
"use strict"; | ||
|
||
const same_origin_src = | ||
"/permissions-policy/resources/permissions-policy-geolocation.html"; | ||
const cross_origin_src = | ||
"https://{{hosts[alt][]}}:{{ports[https][0]}}" + same_origin_src; | ||
const same_origin_src = | ||
"/permissions-policy/resources/permissions-policy-geolocation.html"; | ||
const cross_origin_src = | ||
"https://{{hosts[alt][]}}:{{ports[https][0]}}" + same_origin_src; | ||
|
||
async_test(t => { | ||
test_feature_availability( | ||
"geolocation", | ||
t, | ||
same_origin_src, | ||
expect_feature_available_default, | ||
"geolocation" | ||
); | ||
}, 'Permissions policy "geolocation" can be enabled in same-origin iframe using allow="geolocation" attribute'); | ||
// Grant permission to outer frame | ||
promise_setup(async () => { | ||
await test_driver.set_permission({ name: "geolocation" }, "granted"); | ||
}); | ||
|
||
async_test(t => { | ||
test_feature_availability( | ||
"geolocation", | ||
t, | ||
cross_origin_src, | ||
expect_feature_available_default, | ||
"geolocation" | ||
); | ||
}, 'Permissions policy "geolocation" can be enabled in cross-origin iframe using allow="geolocation" attribute'); | ||
</script> | ||
promise_test(async (test) => { | ||
await test_feature_availability( | ||
"Geolocation", | ||
test, | ||
same_origin_src, | ||
expect_feature_available_default, | ||
"geolocation" | ||
); | ||
}, 'Permissions policy "geolocation" can be enabled in same-origin iframe using allow="geolocation" attribute'); | ||
|
||
promise_test(async (test) => { | ||
await test_feature_availability( | ||
"Geolocation", | ||
test, | ||
cross_origin_src, | ||
expect_feature_available_default, | ||
"geolocation" | ||
); | ||
}, 'Permissions policy "geolocation" can be enabled in cross-origin iframe using allow="geolocation" attribute'); | ||
</script> | ||
</body> |