[WebAuthN] Implement authenticatorMakeCredential
[WebKit-https.git] / Source / WebCore / testing / MockCredentialsMessenger.h
index b3a59b6..b4b08df 100644 (file)
@@ -37,13 +37,13 @@ class Internals;
 
 class MockCredentialsMessenger final : public CredentialsMessenger {
 public:
-    MockCredentialsMessenger(Internals&);
+    explicit MockCredentialsMessenger(Internals&);
     ~MockCredentialsMessenger();
 
     void setDidTimeOut() { m_didTimeOut = true; }
     void setDidUserCancel() { m_didUserCancel = true; }
     void setDidUserVerifyingPlatformAuthenticatorPresent() { m_didUserVerifyingPlatformAuthenticatorPresent = true; }
-    void setAttestationObject(const BufferSource&);
+    void setCreationReturnBundle(const BufferSource& credentialId, const BufferSource& attestationObject);
     void setAssertionReturnBundle(const BufferSource& credentialId, const BufferSource& authenticatorData, const BufferSource& signature, const BufferSource& userHandle);
 
     void ref();
@@ -53,7 +53,7 @@ private:
     void makeCredential(const Vector<uint8_t>&, const PublicKeyCredentialCreationOptions&, CreationCompletionHandler&&) final;
     void getAssertion(const Vector<uint8_t>& hash, const PublicKeyCredentialRequestOptions&, RequestCompletionHandler&&) final;
     void isUserVerifyingPlatformAuthenticatorAvailable(QueryCompletionHandler&&) final;
-    void makeCredentialReply(uint64_t messageId, const Vector<uint8_t>&) final;
+    void makeCredentialReply(uint64_t messageId, const Vector<uint8_t>& credentialId, const Vector<uint8_t>& attestationObject) final;
     void getAssertionReply(uint64_t messageId, const Vector<uint8_t>& credentialId, const Vector<uint8_t>& authenticatorData, const Vector<uint8_t>& signature, const Vector<uint8_t>& userHandle) final;
     void isUserVerifyingPlatformAuthenticatorAvailableReply(uint64_t messageId, bool) final;
 
@@ -63,7 +63,7 @@ private:
     bool m_didUserCancel { false };
     bool m_didUserVerifyingPlatformAuthenticatorPresent { false };
     Vector<uint8_t> m_attestationObject;
-    Vector<uint8_t> m_credentialId;
+    Vector<uint8_t> m_credentialId; // Overlapped between CreationReturnBundle and AssertionReturnBundle.
     Vector<uint8_t> m_authenticatorData;
     Vector<uint8_t> m_signature;
     Vector<uint8_t> m_userHandle;