Automatic update from web-platform-tests Refactor makeGetOptions/makeCreateOptions to use property bag (#56349) - Convert function signatures from positional parameters to property bag objects - Add MakeGetOptionsConfig and MakeCreateOptionsConfig interfaces - Update all test files to use new {protocol: ...} syntax - Maintain backward compatibility: makeGetOptions() still defaults to 'default' protocol -- wpt-commits: e57f6118fbcc894871f8a1bacb429bf09eb24e44 wpt-pr: 56349
50 lines
2.0 KiB
HTML
50 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8" />
|
|
<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 src="/common/get-host-info.sub.js"></script>
|
|
<body></body>
|
|
<script type="module">
|
|
import { makeCreateOptions } from "/digital-credentials/support/helper.js";
|
|
const { HTTPS_REMOTE_ORIGIN } = get_host_info();
|
|
const same_origin_src =
|
|
"/digital-credentials/permissions-policy/create.html";
|
|
const cross_origin_src = new URL(same_origin_src, HTTPS_REMOTE_ORIGIN).href;
|
|
|
|
promise_test(async (test) => {
|
|
await test_driver.bless("user activation");
|
|
await promise_rejects_dom(
|
|
test,
|
|
"NotAllowedError",
|
|
navigator.credentials.create(makeCreateOptions({protocol: []}))
|
|
);
|
|
}, "Permissions-Policy header digital-credentials-create=() disallows the top-level document.");
|
|
|
|
promise_test(async (test) => {
|
|
await test_feature_availability({
|
|
feature_description: "Digital Credential API",
|
|
test,
|
|
src: same_origin_src,
|
|
expect_feature_available: expect_feature_unavailable_default,
|
|
is_promise_test: true,
|
|
needs_focus: true,
|
|
});
|
|
}, "Permissions-Policy header digital-credentials-create=() disallows same-origin iframes.");
|
|
|
|
promise_test(async (test) => {
|
|
await test_feature_availability({
|
|
feature_description: "Digital Credential API",
|
|
test,
|
|
src: cross_origin_src,
|
|
expect_feature_available: expect_feature_unavailable_default,
|
|
feature_name: "digital-credentials-create",
|
|
is_promise_test: true,
|
|
needs_focus: true,
|
|
});
|
|
}, "Permissions-Policy header digital-credentials-create=() cannot be overridden using the allow attribute.");
|
|
|
|
</script>
|