Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1937188] Restore geolocation permission for wpt geolocation policy tests and make attribute tests more similar #50150

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<body>
<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";
Expand All @@ -12,19 +14,25 @@
const same_origin_src = base_src + relative_path;
const cross_origin_src = `${base_src}https://{{hosts[alt][]}}:{{ports[https][0]}}${relative_path}`;

// Grant permission to outer frame
promise_setup(async () => {
await test_driver.set_permission({ name: "geolocation" }, "granted");
});

promise_test(async (test) => {
await test_feature_availability({
feature_description: "Geolocation API",
feature_description: "Geolocation",
test,
src: same_origin_src,
expect_feature_available: expect_feature_available_default,
is_promise_test: true,
feature_name: "geolocation",
});
}, 'Permissions-Policy allow="geolocation" allows same-origin redirection');

promise_test(async (test) => {
await test_feature_availability({
feature_description: "Geolocation API",
feature_description: "Geolocation",
test,
src: cross_origin_src,
expect_feature_available: expect_feature_available_default,
Expand Down
63 changes: 35 additions & 28 deletions geolocation/enabled-by-permission-policy-attribute.https.sub.html
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>
Loading