From 85b330f39296dbba4f54a189cbb4e4701e3966ce Mon Sep 17 00:00:00 2001 From: David P Date: Fri, 17 Jan 2025 18:19:46 +0000 Subject: [PATCH] Restore geolocation permission for wpt geolocation policy tests and make 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 --- ...-attribute-redirect-on-load.https.sub.html | 12 +++- ...permission-policy-attribute.https.sub.html | 63 ++++++++++--------- 2 files changed, 45 insertions(+), 30 deletions(-) diff --git a/geolocation/enabled-by-permission-policy-attribute-redirect-on-load.https.sub.html b/geolocation/enabled-by-permission-policy-attribute-redirect-on-load.https.sub.html index d25afa52bb7146..f3cf0bc97e107e 100644 --- a/geolocation/enabled-by-permission-policy-attribute-redirect-on-load.https.sub.html +++ b/geolocation/enabled-by-permission-policy-attribute-redirect-on-load.https.sub.html @@ -2,6 +2,8 @@ + + - - - + + + + + + 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'); +