[WebAuthN] Implement authenticatorMakeCredential
[WebKit-https.git] / LayoutTests / http / wpt / webauthn / public-key-credential-create-success.https.html
index b11c793..ab4fcc0 100644 (file)
@@ -4,7 +4,6 @@
 <script src="/resources/testharnessreport.js"></script>
 <script src="./resources/util.js"></script>
 <script>
-    // The following test is specifically tuned for current dummy authenticator.
     promise_test(function(t) {
         const options = {
             publicKey: {
                 pubKeyCredParams: [{ type: "public-key", alg: -7 }],
             }
         };
+        // A mock attestation object
+        internals.mockCredentialsMessenger.setCreationReturnBundle(hexStringToUint8Array('00'), hexStringToUint8Array('01'));
 
         return navigator.credentials.create(options).then(function(credential) {
-                assert_equals(credential.id, '_w');
+                assert_equals(credential.id, 'AA');
                 assert_equals(credential.type, 'public-key');
-                assert_equals(bytesToHexString(credential.rawId), 'ff');
+                assert_equals(bytesToHexString(credential.rawId), '00');
                 assert_equals(bytesToASCIIString(credential.response.clientDataJSON), '{"type":"webauthn.create","challenge":"MTIzNDU2","origin":"https://localhost:9443","hashAlgorithm":"SHA-256"}');
-                // This field is completely fake 0x00*43 | 0x0001ff | SHA-256 hash of the clientDataJSON
-                assert_equals(bytesToHexString(credential.response.attestationObject), '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ff3374b98316b38046727a770b8e95c4580a292b9e2f4bb44a250a5402d6d3783a');
+                assert_equals(bytesToHexString(credential.response.attestationObject), '01');
+                console.log()
                 try {
                     assert_throws("NotSupportedError", credential.getClientExtensionResults());
                 } catch(error) { }