From aec66cd43c2be7b7096c176b600873099456cf4a Mon Sep 17 00:00:00 2001 From: Nina Satragno Date: Thu, 12 Sep 2024 12:31:55 -0700 Subject: [PATCH] [webauthn] Add WPTs for Signal methods Add WPTs for: * signalUnknownCredential * signalCurrentUserDetails * signalAllAcceptedCredentials Bug: 361751877 Change-Id: Iae31d62c28621aab2d2cd8aac952f842fd67c95e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5850213 Auto-Submit: Nina Satragno Commit-Queue: Nina Satragno Reviewed-by: Martin Kreichgauer Cr-Commit-Position: refs/heads/main@{#1354733} --- webauthn/helpers.js | 8 +- ...signal-all-accepted-credentials.https.html | 119 ++++++++++++++++++ .../signal-current-user-details.https.html | 82 ++++++++++++ webauthn/signal-unknown-credential.https.html | 74 +++++++++++ 4 files changed, 280 insertions(+), 3 deletions(-) create mode 100644 webauthn/signal-all-accepted-credentials.https.html create mode 100644 webauthn/signal-current-user-details.https.html create mode 100644 webauthn/signal-unknown-credential.https.html diff --git a/webauthn/helpers.js b/webauthn/helpers.js index 5b30749bf377ca..a45b686ca775c9 100644 --- a/webauthn/helpers.js +++ b/webauthn/helpers.js @@ -362,7 +362,8 @@ function extendObject(dst, src) { function isSimpleObject(o) { return (typeof o === "object" && !Array.isArray(o) && - !(o instanceof ArrayBuffer)); + !(o instanceof ArrayBuffer) && + !(o instanceof Uint8Array)); } function isAbortSignal(o) { @@ -613,8 +614,9 @@ function virtualAuthenticatorPromiseTest( testCb, options = {}, name = 'Virtual Authenticator Test') { let authenticatorArgs = Object.assign(defaultAuthenticatorArgs(), options); promise_test(async t => { + let authenticator; try { - let authenticator = + authenticator = await window.test_driver.add_virtual_authenticator(authenticatorArgs); t.add_cleanup( () => window.test_driver.remove_virtual_authenticator(authenticator)); @@ -623,7 +625,7 @@ function virtualAuthenticatorPromiseTest( throw error; } } - return testCb(t); + return testCb(t, authenticator); }, name); } diff --git a/webauthn/signal-all-accepted-credentials.https.html b/webauthn/signal-all-accepted-credentials.https.html new file mode 100644 index 00000000000000..45519b13e35a6f --- /dev/null +++ b/webauthn/signal-all-accepted-credentials.https.html @@ -0,0 +1,119 @@ + + +Signal all accepted credentials tests + + + + + + + + + \ No newline at end of file diff --git a/webauthn/signal-current-user-details.https.html b/webauthn/signal-current-user-details.https.html new file mode 100644 index 00000000000000..b4027377272e49 --- /dev/null +++ b/webauthn/signal-current-user-details.https.html @@ -0,0 +1,82 @@ + + +Signal current user details tests + + + + + + + + + \ No newline at end of file diff --git a/webauthn/signal-unknown-credential.https.html b/webauthn/signal-unknown-credential.https.html new file mode 100644 index 00000000000000..a01dd3e692a8dc --- /dev/null +++ b/webauthn/signal-unknown-credential.https.html @@ -0,0 +1,74 @@ + + +Signal unknown credential tests + + + + + + + + + \ No newline at end of file