Skip to content

Commit

Permalink
[Digital Credentials WPT Tests] Fix tests some more
Browse files Browse the repository at this point in the history
This CL:
- Changes the exception thrown when the digital credentials API is
invoked when the page does not have transient user activation to
NotAllowedError in order to match spec.
- Reorders check for number of providers to after transient user
activation check in order to match spec.
- Makes allow-attribute.https.html test pass if the <iframe> does
not have user activation.

BUG=368070320

Change-Id: Iaa194da8d0a2a96d1fd40592dbe74e7bd7391bdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5883276
Reviewed-by: Ken Buchanan <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Peter Kotwicz <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1363719}
  • Loading branch information
pkotwicz authored and chromium-wpt-export-bot committed Oct 3, 2024
1 parent 1b16716 commit b43d0fb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions digital-credentials/allow-attribute.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,15 @@
);
});
const { name, message } = data;
assert_equals(
name,
expectIsAllowed ? "TypeError" : "NotAllowedError",
`${iframe.outerHTML} - ${message}`
);
if (expectIsAllowed) {
assert_true(name == "TypeError" ||
(name == "NotAllowedError" && message.includes("transient activation")),
`${iframe.outerHTML} - ${message}`);
} else {
assert_equals(name, "NotAllowedError", `${iframe.outerHTML} - ${message}`);
assert_false(message.includes("transient activation"),
`${iframe.outerHTML} - ${message}`);
}
iframe.remove();
}, `Policy to use: ${details.policy}, is cross-origin: ${details.crossOrigin}, is allowed by policy: ${details.expectIsAllowed}`);
}
Expand Down

0 comments on commit b43d0fb

Please sign in to comment.