49 lines
2 KiB
HTML
49 lines
2 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 =
|
|
"/permissions-policy/resources/digital-credentials-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([]))
|
|
);
|
|
}, "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>
|