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

Add Web Platform Tests for Digital Credentials Issuance API #51492

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mohamedamir
Copy link
Contributor

@mohamedamir mohamedamir commented Mar 20, 2025

This PR adds web platform tests for Digital Credentials Issuance API (.create()) that are aligned with the set of test we have for the presentation API (.get())

tests for WICG/digital-credentials#204

Comment on lines +45 to +71
}, "Permissions-Policy is by default 'self' for get().");

promise_test(async (test) => {
await test_driver.bless("user activation");
await promise_rejects_js(
test,
TypeError,
navigator.credentials.create(makeCreateOptions([]))
);

await test_feature_availability({
feature_description: "Digital Credential API",
test,
src: create_same_origin_src,
expect_feature_available: expect_feature_available_default,
is_promise_test: true,
});

await test_feature_availability({
feature_description: "Digital Credential API",
test,
src: create_cross_origin_src,
expect_feature_available: expect_feature_unavailable_default,
feature_name: "digital-credentials-create",
is_promise_test: true,
});
}, "Permissions-Policy is by default 'self' for create().");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to introduce a permission policy for issuance too?
I assumed yes in this PR.
Can also come at a later point if this isn't the case!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, exactly... it's the "digital-credentials-create".

policy: `digital-credentials-get ${hostInfo.HTTPS_REMOTE_ORIGIN}`,
crossOrigin: true,
expectIsAllowed: true,
},
{
Copy link
Contributor

@marcoscaceres marcoscaceres Mar 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I feel we should split this into two tests... I like the addition of action. That's a good idea.

const { HTTPS_REMOTE_ORIGIN } = get_host_info();
const same_origin_src =
const get_same_origin_src =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should split this into two files, tbh... otherwise it's going to get confusing if the file continues to grow.

Copy link
Contributor

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from splitting the files, the rest all looks great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants