Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed Aug 20, 2024
1 parent 39c10d1 commit 78e53b6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 64 deletions.
52 changes: 26 additions & 26 deletions digital-credentials/allow-attribute.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,66 +14,66 @@
{
policy: null,
crossOrigin: false,
isAllowed: true,
expectIsAllowed: true,
},
{
policy: null,
crossOrigin: true,
isAllowed: false,
expectIsAllowed: false,
},
{
policy: "digital-credentials-get",
crossOrigin: false,
isAllowed: true,
expectIsAllowed: true,
},
{
policy: "digital-credentials-get",
crossOrigin: true,
isAllowed: true,
},
{
policy: "digital-credentials-get *",
crossOrigin: true,
isAllowed: true,
expectIsAllowed: true,
},
{
policy: "digital-credentials-get *",
crossOrigin: false,
isAllowed: true,
expectIsAllowed: true,
},
{
policy: "digital-credentials-get 'none'",
policy: "digital-credentials-get *",
crossOrigin: true,
isAllowed: false,
expectIsAllowed: true,
},
{
policy: "digital-credentials-get 'none'",
crossOrigin: false,
isAllowed: false,
expectIsAllowed: false,
},
{
policy: "digital-credentials-get 'self'",
policy: "digital-credentials-get 'none'",
crossOrigin: true,
isAllowed: false,
expectIsAllowed: false,
},
{
policy: "digital-credentials-get 'self'",
crossOrigin: false,
isAllowed: true,
expectIsAllowed: true,
},
{
policy: `digital-credentials-get ${hostInfo.HTTPS_REMOTE_ORIGIN}`,
policy: "digital-credentials-get 'self'",
crossOrigin: true,
isAllowed: true,
expectIsAllowed: false,
},
{
policy: `digital-credentials-get ${hostInfo.HTTPS_REMOTE_ORIGIN}`,
crossOrigin: false,
isAllowed: false,
expectIsAllowed: false,
},
{
policy: `digital-credentials-get ${hostInfo.HTTPS_REMOTE_ORIGIN}`,
crossOrigin: true,
expectIsAllowed: true,
},
];

async function loadIframe({ policy, crossOrigin, isAllowed }) {
async function loadIframe({ policy, crossOrigin, expectIsAllowed }) {
const iframe = document.createElement("iframe");
if (policy !== null) {
iframe.allow = policy;
Expand All @@ -87,7 +87,7 @@
? hostInfo.HTTPS_REMOTE_ORIGIN
: location.origin
).href;
iframe.dataset.isAllowed = isAllowed;
iframe.dataset.expectIsAllowed = expectIsAllowed;
document.body.appendChild(iframe);
});
iframe.focus();
Expand All @@ -98,7 +98,7 @@
for (const details of iframeDetails) {
promise_test(async (test) => {
const iframe = await loadIframe(details);
const { isAllowed } = details;
const { expectIsAllowed } = details;
const action = "get";
const options = {
digital: {
Expand All @@ -115,14 +115,14 @@
"*"
);
});
const { name, messsage } = data;
const { name, message } = data;
assert_equals(
name,
isAllowed ? "TypeError" : "NotAllowedError",
`${iframe.outerHTML} - ${messsage}`
expectIsAllowed ? "TypeError" : "NotAllowedError",
`${iframe.outerHTML} - ${message}`
);
iframe.remove();
}, `Policy to use: ${details.policy}, is cross-origin: ${details.crossOrigin}, is allowed by policy: ${details.isAllowed}`);
}, `Policy to use: ${details.policy}, is cross-origin: ${details.crossOrigin}, is allowed by policy: ${details.expectIsAllowed}`);
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
const cross_origin_src = new URL(same_origin_src, HTTPS_REMOTE_ORIGIN).href;

promise_test(async (test) => {
await test_driver.bless("use activation");
await test_driver.bless("user activation");
await promise_rejects_js(
test,
TypeError,
Expand Down
37 changes: 0 additions & 37 deletions digital-credentials/get-user-activation.https.html

This file was deleted.

0 comments on commit 78e53b6

Please sign in to comment.