[FedCM] Add hint argument to revoke
Per https://github.com/fedidcg/FedCM/pull/232
R=dsinclair@chromium.org, yigu@chromium.org
Fixed: 1300009
Change-Id: I93a65cd9d0310be8b725ab15f2c26453434f3119
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3523270
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Sam Goto <goto@chromium.org>
Reviewed-by: Yi Gu <yigu@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#980915}
diff --git a/credential-management/fedcm-revoke.https.html b/credential-management/fedcm-revoke.https.html
index 84a20b0..f0c3e5e 100644
--- a/credential-management/fedcm-revoke.https.html
+++ b/credential-management/fedcm-revoke.https.html
@@ -13,7 +13,6 @@
const provider = {
url: provider_url || "https://idp.example/",
clientId: "1234",
- hint: "foo@bar.com",
};
return await navigator.credentials.get({
federated: {
@@ -24,17 +23,23 @@
fedcm_test(async (t, mock) => {
mock.revokeReturn("kSuccess");
- await (await getCredential()).revoke();
+ await (await getCredential()).revoke("foo@bar.com");
}, "Successfully revoking a token should resolve the promise.");
fedcm_test(async (t, mock) => {
mock.revokeReturn("kError");
- const result = (await getCredential()).revoke();
+ const result = (await getCredential()).revoke("foo@bar.com");
return promise_rejects_dom(t, "NetworkError", result);
}, "Error should reject the promise.");
fedcm_test(async (t, mock) => {
- const result = getCredential("https://other-idp.example/").then((c) => c.revoke());
+ mock.revokeReturn("kError");
+ const result = (await getCredential()).revoke("");
+ return promise_rejects_dom(t, "InvalidStateError", result);
+ }, "Empty hint should reject the promise.");
+
+ fedcm_test(async (t, mock) => {
+ const result = getCredential("https://other-idp.example/").then((c) => c.revoke("foo@bar.com"));
return promise_rejects_dom(t, "NetworkError", result);
}, "Provider URL should honor Content-Security-Policy.");
</script>