Diff
Modified: trunk/LayoutTests/ChangeLog (236624 => 236625)
--- trunk/LayoutTests/ChangeLog 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/ChangeLog 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,3 +1,55 @@
+2018-09-28 Jiewen Tan <[email protected]>
+
+ [WebAuthN] Polish WebAuthN auto-test environment
+ https://bugs.webkit.org/show_bug.cgi?id=189283
+ <rdar://problem/44117828>
+
+ Reviewed by Chris Dumez.
+
+ This patch does the following few things:
+ 1. Update tests that employ old mocking mechnism to the new one.
+ 2. Move tests from http/tests/webauthn to http/wpt/webauthn. As a result, we have one unified place for
+ all WebAuthN tests: http/wpt/webauthn.
+ 3. Add a helper function to check DOMException message as well.
+
+ * TestExpectations:
+ * http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https-expected.txt: Removed.
+ * http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https-expected.txt: Removed.
+ * http/tests/webauthn/public-key-credential-same-origin-with-ancestors-2.https-expected.txt: Removed.
+ * http/tests/webauthn/public-key-credential-same-origin-with-ancestors-2.https.html: Removed.
+ * http/tests/webauthn/public-key-credential-same-origin-with-ancestors.https-expected.txt: Removed.
+ * http/tests/webauthn/public-key-credential-same-origin-with-ancestors.https.html: Removed.
+ * http/tests/webauthn/resources/last-layer-frame.https.html: Removed.
+ * http/tests/webauthn/resources/util.js: Removed.
+ * http/wpt/credential-management/credentialscontainer-store-basics.https.html:
+ * http/wpt/webauthn/idl.https.html:
+ * http/wpt/webauthn/public-key-credential-create-failure-local.https.html:
+ * http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt:
+ * http/wpt/webauthn/public-key-credential-create-failure.https.html:
+ * http/wpt/webauthn/public-key-credential-create-success.https-expected.txt: Removed.
+ * http/wpt/webauthn/public-key-credential-create-success.https.html: Removed.
+ * http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https-expected.txt: Added.
+ * http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html: Renamed from LayoutTests/http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https.html.
+ * http/wpt/webauthn/public-key-credential-get-failure-local.https.html:
+ * http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt:
+ * http/wpt/webauthn/public-key-credential-get-failure.https.html:
+ * http/wpt/webauthn/public-key-credential-get-success.https-expected.txt: Removed.
+ * http/wpt/webauthn/public-key-credential-get-success.https.html: Removed.
+ * http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https-expected.txt: Added.
+ * http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html: Renamed from LayoutTests/http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https.html.
+ * http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https-expected.txt: Added.
+ * http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html: Added.
+ * http/wpt/webauthn/resources/last-layer-frame.https.html: Added.
+ * http/wpt/webauthn/resources/second-layer-frame.https.html: Renamed from LayoutTests/http/tests/webauthn/resources/second-layer-frame.https.html.
+ * http/wpt/webauthn/resources/util.js:
+ * platform/gtk/TestExpectations:
+ * platform/ios-wk1/TestExpectations:
+ * platform/mac-wk1/TestExpectations:
+ * platform/mac-wk2/TestExpectations:
+ * platform/win/TestExpectations:
+ * platform/wincairo/TestExpectations:
+ * platform/wpe/TestExpectations:
+
2018-09-28 Jer Noble <[email protected]>
Refactoring: eliminate raw pointer usage in Fullscreen code
Modified: trunk/LayoutTests/TestExpectations (236624 => 236625)
--- trunk/LayoutTests/TestExpectations 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/TestExpectations 2018-09-29 00:02:39 UTC (rev 236625)
@@ -2875,14 +2875,6 @@
webkit.org/b/187773 http/tests/webAPIStatistics [ Skip ]
-# Temporary disables old WebAuthN tests, will either reenable or remove them in webkit.org/b/189283
-http/wpt/credential-management/credentialscontainer-store-basics.https.html [ Skip ]
-http/wpt/webauthn/public-key-credential-create-failure.https.html [ Skip ]
-http/wpt/webauthn/public-key-credential-create-success.https.html [ Skip ]
-http/wpt/webauthn/public-key-credential-get-failure.https.html [ Skip ]
-http/wpt/webauthn/public-key-credential-get-success.https.html [ Skip ]
-http/wpt/webauthn/idl.https.html [ Skip ]
-
webkit.org/b/189997 imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.html [ Failure ]
# This is fallout from turning Web Animations on.
Modified: trunk/LayoutTests/http/wpt/credential-management/credentialscontainer-store-basics.https.html (236624 => 236625)
--- trunk/LayoutTests/http/wpt/credential-management/credentialscontainer-store-basics.https.html 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/credential-management/credentialscontainer-store-basics.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -3,6 +3,11 @@
<script src=""
<script src=""
<script>
+ const testES256PrivateKeyBase64 =
+ "BDj/zxSkzKgaBuS3cdWDF558of8AaIpgFpsjF/Qm1749VBJPgqUIwfhWHJ91nb7U" +
+ "PH76c0+WFOzZKslPyyFse4goGIW2R7k9VHLPEZl5nfnBgEVFh5zev+/xpHQIvuq6" +
+ "RQ==";
+ const testRpId = "localhost";
function asciiToUint8Array(str)
{
var chars = [];
@@ -42,10 +47,14 @@
}
};
// A mock attestation object
- internals.mockAuthenticatorCoordinator.setCreationReturnBundle(hexStringToUint8Array('00'), hexStringToUint8Array('01'));
+ if (window.testRunner)
+ testRunner.setWebAuthenticationMockConfiguration({ local: { acceptAuthentication: true, acceptAttestation: true, privateKeyBase64: testES256PrivateKeyBase64 } });
const credential = await navigator.credentials.create(options);
return promise_rejects(t, "NotSupportedError",
- navigator.credentials.store(credential));
+ navigator.credentials.store(credential)).then(() => {
+ if (window.testRunner)
+ testRunner.cleanUpKeychain(testRpId);
+ });
}, "navigator.credentials.store().");
</script>
Modified: trunk/LayoutTests/http/wpt/webauthn/idl.https.html (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/idl.https.html 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/idl.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -19,6 +19,9 @@
<div id='log'></div>
<script>
+if (window.testRunner)
+ testRunner.setWebAuthenticationMockConfiguration({ local: { acceptAuthentication: true, acceptAttestation: true, privateKeyBase64: testES256PrivateKeyBase64 } });
+
promise_test(async () => {
const idlURL = ["WebAuthN.idl"];
const idlArray = new IdlArray();
@@ -44,7 +47,7 @@
},
user: {
name: "John Appleseed",
- id: asciiToUint8Array("123456"),
+ id: Base64URL.parse(testUserhandleBase64),
displayName: "Appleseed",
},
challenge: Base64URL.parse("MTIzNDU2"),
@@ -51,8 +54,6 @@
pubKeyCredParams: [{ type: "public-key", alg: -7 }],
}
};
- // A mock attestation object
- internals.mockAuthenticatorCoordinator.setCreationReturnBundle(hexStringToUint8Array('00'), hexStringToUint8Array('01'));
createdCredential = await navigator.credentials.create(creationOptions);
@@ -61,11 +62,12 @@
challenge: Base64URL.parse("MTIzNDU2"),
}
};
- // A mock assertion return bundle.
- internals.mockAuthenticatorCoordinator.setAssertionReturnBundle(hexStringToUint8Array('00'), hexStringToUint8Array('01'), hexStringToUint8Array('02'), hexStringToUint8Array('03'));
requestedCredential = await navigator.credentials.get(requestOptions);
idlArray.add_objects({"PublicKeyCredential": ["createdCredential"], "AuthenticatorAttestationResponse": ["createdCredential.response"], "AuthenticatorAssertionResponse": ["requestedCredential.response"]});
idlArray.test();
+
+ if (window.testRunner)
+ testRunner.cleanUpKeychain(testRpId);
}, "Setup for WebAuthN API IDL tests.");
</script>
Modified: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-local.https.html (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-local.https.html 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-local.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -23,7 +23,7 @@
pubKeyCredParams: [{ type: "public-key", alg: -35 }, { type: "public-key", alg: -257 }], // ES384, RS256
}
};
- return promise_rejects(t, "NotSupportedError", navigator.credentials.create(options), "The platform attached authenticator doesn't support any provided PublicKeyCredentialParameters.");
+ return promiseRejects(t, "NotSupportedError", navigator.credentials.create(options), "The platform attached authenticator doesn't support any provided PublicKeyCredentialParameters.");
}, "PublicKeyCredential's [[create]] with unsupported public key credential parameters in a mock local authenticator.");
promise_test(t => {
@@ -44,7 +44,7 @@
};
if (window.testRunner)
testRunner.addTestKeyToKeychain(testES256PrivateKeyBase64, testRpId, testUserhandleBase64);
- return promise_rejects(t, "NotAllowedError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => {
+ return promiseRejects(t, "NotAllowedError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => {
if (window.testRunner)
testRunner.cleanUpKeychain(testRpId);
});
@@ -73,7 +73,7 @@
};
if (window.testRunner)
testRunner.addTestKeyToKeychain(testES256PrivateKeyBase64, testRpId, testUserhandleBase64);
- return promise_rejects(t, "NotAllowedError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => {
+ return promiseRejects(t, "NotAllowedError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => {
if (window.testRunner)
testRunner.cleanUpKeychain(testRpId);
});
@@ -94,7 +94,7 @@
pubKeyCredParams: [{ type: "public-key", alg: -7 }]
}
};
- return promise_rejects(t, "NotAllowedError", navigator.credentials.create(options), "Couldn't get user consent.");
+ return promiseRejects(t, "NotAllowedError", navigator.credentials.create(options), "Couldn't get user consent.");
}, "PublicKeyCredential's [[create]] without user consent in a mock local authenticator.");
promise_test(t => {
@@ -114,7 +114,7 @@
};
if (window.testRunner)
testRunner.setWebAuthenticationMockConfiguration({ local: { acceptAuthentication: true, acceptAttestation: false, privateKeyBase64: "" } });
- return promise_rejects(t, "UnknownError", navigator.credentials.create(options), "Unknown internal error.");
+ return promiseRejects(t, "UnknownError", navigator.credentials.create(options), "Unknown internal error.");
}, "PublicKeyCredential's [[create]] without attestation in a mock local authenticator.");
promise_test(t => {
@@ -136,7 +136,7 @@
testRunner.setWebAuthenticationMockConfiguration({ local: { acceptAuthentication: true, acceptAttestation: false, privateKeyBase64: "" } });
testRunner.addTestKeyToKeychain(testES256PrivateKeyBase64, testRpId, testUserhandleBase64);
}
- return promise_rejects(t, "UnknownError", navigator.credentials.create(options), "Unknown internal error.").then(() => {
+ return promiseRejects(t, "UnknownError", navigator.credentials.create(options), "Unknown internal error.").then(() => {
if (window.testRunner)
assert_false(testRunner.keyExistsInKeychain(testRpId, testUserhandleBase64));
});
Modified: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,6 +1,4 @@
-PASS PublicKeyCredential's [[create]] with timeout
PASS PublicKeyCredential's [[create]] with a mismatched RP ID
PASS PublicKeyCredential's [[create]] with an empty pubKeyCredParams
-PASS PublicKeyCredential's [[create]] with user cancellations
Modified: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https.html (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https.html 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -4,27 +4,31 @@
<script src=""
<script src=""
<script>
- promise_test(function(t) {
- const options = {
- publicKey: {
- rp: {
- name: "example.com"
- },
- user: {
- name: "John Appleseed",
- id: asciiToUint8Array("123456"),
- displayName: "John",
- },
- challenge: asciiToUint8Array("123456"),
- pubKeyCredParams: [{ type: "public-key", alg: -7 }],
- timeout: 0,
- }
- };
- internals.mockAuthenticatorCoordinator.setDidTimeOut();
+ // Default mock configuration. Tests need to override if they need different configuration.
+ if (window.testRunner)
+ testRunner.setWebAuthenticationMockConfiguration({ });
- return promise_rejects(t, "NotAllowedError",
- navigator.credentials.create(options));
- }, "PublicKeyCredential's [[create]] with timeout");
+ // FIXME(189642): Re-enable the following test.
+ // promise_test(function(t) {
+ // const options = {
+ // publicKey: {
+ // rp: {
+ // name: "example.com"
+ // },
+ // user: {
+ // name: "John Appleseed",
+ // id: asciiToUint8Array("123456"),
+ // displayName: "John",
+ // },
+ // challenge: asciiToUint8Array("123456"),
+ // pubKeyCredParams: [{ type: "public-key", alg: -7 }],
+ // timeout: 0,
+ // }
+ // };
+ //
+ // return promiseRejects(t, "NotAllowedError",
+ // navigator.credentials.create(options), "Operation timed out.");
+ // }, "PublicKeyCredential's [[create]] with timeout");
promise_test(function(t) {
const options = {
@@ -42,8 +46,9 @@
pubKeyCredParams: [{ type: "public-key", alg: -7 }],
}
};
- return promise_rejects(t, "SecurityError",
- navigator.credentials.create(options));
+
+ return promiseRejects(t, "SecurityError",
+ navigator.credentials.create(options), "The origin of the document is not a registrable domain suffix of the provided RP ID.");
}, "PublicKeyCredential's [[create]] with a mismatched RP ID");
promise_test(function(t) {
@@ -62,29 +67,8 @@
pubKeyCredParams: [ ],
}
};
- return promise_rejects(t, "NotSupportedError",
- navigator.credentials.create(options));
+
+ return promiseRejects(t, "NotSupportedError",
+ navigator.credentials.create(options), "No desired properties of the to be created credential are provided.");
}, "PublicKeyCredential's [[create]] with an empty pubKeyCredParams");
-
- promise_test(function(t) {
- const options = {
- publicKey: {
- rp: {
- name: "localhost",
- id: "localhost"
- },
- user: {
- name: "John Appleseed",
- id: asciiToUint8Array("123456"),
- displayName: "John",
- },
- challenge: asciiToUint8Array("123456"),
- pubKeyCredParams: [{ type: "public-key", alg: -7 }],
- }
- };
- internals.mockAuthenticatorCoordinator.setDidUserCancel();
-
- return promise_rejects(t, "NotAllowedError",
- navigator.credentials.create(options));
- }, "PublicKeyCredential's [[create]] with user cancellations");
</script>
Deleted: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-success.https-expected.txt (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-success.https-expected.txt 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-success.https-expected.txt 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,3 +0,0 @@
-
-PASS PublicKeyCredential's [[create]] with minimum options
-
Deleted: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-success.https.html (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-success.https.html 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-success.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<title>Web Authentication API: PublicKeyCredential's [[create]] success cases.</title>
-<script src=""
-<script src=""
-<script src=""
-<script>
- promise_test(function(t) {
- const options = {
- publicKey: {
- rp: {
- name: "localhost",
- },
- user: {
- name: "John Appleseed",
- id: asciiToUint8Array("123456"),
- displayName: "Appleseed",
- },
- challenge: Base64URL.parse("MTIzNDU2"),
- pubKeyCredParams: [{ type: "public-key", alg: -7 }],
- }
- };
- // A mock attestation object
- internals.mockAuthenticatorCoordinator.setCreationReturnBundle(hexStringToUint8Array('00'), hexStringToUint8Array('01'));
-
- return navigator.credentials.create(options).then(function(credential) {
- assert_equals(credential.id, 'AA');
- assert_equals(credential.type, 'public-key');
- assert_equals(bytesToHexString(credential.rawId), '00');
- assert_equals(bytesToASCIIString(credential.response.clientDataJSON), '{"type":"webauthn.create","challenge":"MTIzNDU2","origin":"https://localhost:9443","hashAlgorithm":"SHA-256"}');
- assert_equals(bytesToHexString(credential.response.attestationObject), '01');
- assert_throws("NotSupportedError", () => { credential.getClientExtensionResults() });
- });
- }, "PublicKeyCredential's [[create]] with minimum options");
-</script>
Added: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https-expected.txt (0 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https-expected.txt (rev 0)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https-expected.txt 2018-09-29 00:02:39 UTC (rev 236625)
@@ -0,0 +1,57 @@
+
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 1
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 2
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 3
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 4
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 5
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 6
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 7
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 8
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 9
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 10
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 11
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 12
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 13
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 14
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 15
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 16
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 17
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 18
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 19
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 20
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 21
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 22
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 23
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 24
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 25
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 26
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 27
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 28
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 29
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 30
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 31
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 32
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 33
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 34
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 35
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 36
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 37
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 38
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 39
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 40
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 41
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 42
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 43
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 44
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 45
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 46
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 47
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 48
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 49
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 50
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 51
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 52
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 53
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 54
+PASS PublicKeyCredential's [[create]] with with invalid parameters. 55
+
Copied: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html (from rev 236624, trunk/LayoutTests/http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https.html) (0 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html (rev 0)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+<title>Web Authentication API: PublicKeyCredential's [[create]] with invalid parameters.</title>
+<script src=""
+<script src=""
+<script src=""
+<script>
+ const rp = {
+ name: "example.com"
+ };
+ const user = {
+ name: "John Appleseed",
+ id: asciiToUint8Array("123456"),
+ displayName: "Appleseed"
+ };
+ const challenge = asciiToUint8Array("123456");
+ const pubKeyCredParam = { type: "public-key", alg: -7 };
+ const excludeCredentials = { type: "public-key", id: asciiToUint8Array("123456") };
+
+ const missingAttributeVector = [
+ // missing top level attribute
+ [undefined, user, challenge, [pubKeyCredParam]],
+ [rp, undefined, challenge, [pubKeyCredParam]],
+ [rp, user, undefined, [pubKeyCredParam]],
+ [rp, user, challenge, undefined],
+ // missing rp attribute
+ [{ name: undefined }, user, challenge, [pubKeyCredParam]],
+ // missing user attribute
+ [rp, { name: undefined, id: user.id, displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: undefined, displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: user.id, displayName: undefined}, challenge, [pubKeyCredParam]],
+ // missing pubKeyCredParams attribute
+ [rp, user, challenge, [{ type: undefined, alg: pubKeyCredParam.alg }]],
+ [rp, user, challenge, [{ type: pubKeyCredParam.type, alg: undefined }]],
+ // missing excludeCredentials attribute
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: undefined, id: excludeCredentials.id }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: undefined }]]
+ ];
+
+ const wrongTypeAttributeVector = [
+ // wrong rp attribute type
+ [{ name: Symbol() }, user, challenge, [pubKeyCredParam]],
+ [{ name: rp.name, icon: Symbol() }, user, challenge, [pubKeyCredParam]],
+ [{ name: rp.name, id: Symbol() }, user, challenge, [pubKeyCredParam]],
+ // wrong user attribute type
+ [rp, { name: Symbol(), id: user.id, displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: 1, displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: true, displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: null, displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: Symbol(), displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: { }, displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: "foo", displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: [ ], displayName: user.displayName}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: user.id, displayName: Symbol()}, challenge, [pubKeyCredParam]],
+ [rp, { name: user.name, id: user.id, displayName: user.displayName, icon: Symbol()}, challenge, [pubKeyCredParam]],
+ // wrong challenge type
+ [rp, user, 1, [pubKeyCredParam]],
+ [rp, user, true, [pubKeyCredParam]],
+ [rp, user, null, [pubKeyCredParam]],
+ [rp, user, Symbol(), [pubKeyCredParam]],
+ [rp, user, "foo", [pubKeyCredParam]],
+ [rp, user, [ ], [pubKeyCredParam]],
+ [rp, user, { }, [pubKeyCredParam]],
+ // wrong pubKeyCredParam type
+ [rp, user, challenge, [{ type: 1, alg: pubKeyCredParam.alg }]],
+ [rp, user, challenge, [{ type: true, alg: pubKeyCredParam.alg }]],
+ [rp, user, challenge, [{ type: null, alg: pubKeyCredParam.alg }]],
+ [rp, user, challenge, [{ type: Symbol(), alg: pubKeyCredParam.alg }]],
+ [rp, user, challenge, [{ type: "foo", alg: pubKeyCredParam.alg }]],
+ [rp, user, challenge, [{ type: [ ], alg: pubKeyCredParam.alg }]],
+ [rp, user, challenge, [{ type: { }, alg: pubKeyCredParam.alg }]],
+ [rp, user, challenge, [{ type: pubKeyCredParam.type, alg: Symbol() }]],
+ // wrong timeout type
+ [rp, user, challenge, [pubKeyCredParam], Symbol(), undefined],
+ // wrong excludeCredentials
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: 1, id: excludeCredentials.id }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: true, id: excludeCredentials.id }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: null, id: excludeCredentials.id }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: Symbol(), id: excludeCredentials.id }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: "foo", id: excludeCredentials.id }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: [ ], id: excludeCredentials.id }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: { }, id: excludeCredentials.id }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: 1 }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: true }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: null }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: Symbol() }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: "foo" }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: [ ] }]],
+ [rp, user, challenge, [pubKeyCredParam], undefined, [{ type: excludeCredentials.type, id: { } }]]
+ ];
+
+ function makeOptions(attributes)
+ {
+ if (attributes.length == 4)
+ return { publicKey: { rp: attributes[0], user: attributes[1], challenge: attributes[2], pubKeyCredParams: attributes[3] } };
+ return { publicKey: { rp: attributes[0], user: attributes[1], challenge: attributes[2], pubKeyCredParams: attributes[3], timeout: attributes[4], excludeCredentials: attributes[5]} };
+ }
+
+ let index = 1;
+ function runTest(attributesVectors) {
+ attributesVectors.forEach(function(attributesVector) {
+ attributesVector.forEach(async function(attributes) {
+ promise_test(function(t) {
+ return promise_rejects(t, new TypeError(),
+ navigator.credentials.create(makeOptions(attributes)));
+ }, "PublicKeyCredential's [[create]] with with invalid parameters. " + index);
+ index = index + 1;
+ });
+ });
+ }
+
+ const vectors = [];
+ vectors.push(missingAttributeVector);
+ vectors.push(wrongTypeAttributeVector);
+ runTest(vectors);
+</script>
Modified: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure-local.https.html (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure-local.https.html 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure-local.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -21,7 +21,7 @@
}
};
- return promise_rejects(t, "NotAllowedError", navigator.credentials.get(options), "No matched credentials are found in the platform attached authenticator.");
+ return promiseRejects(t, "NotAllowedError", navigator.credentials.get(options), "No matched credentials are found in the platform attached authenticator.");
}, "PublicKeyCredential's [[get]] with no matched credentials in a mock local authenticator.");
promise_test(t => {
@@ -36,7 +36,7 @@
if (window.testRunner)
testRunner.addTestKeyToKeychain(testES256PrivateKeyBase64, testRpId, testUserhandleBase64);
- return promise_rejects(t, "NotAllowedError", navigator.credentials.get(options), "No matched credentials are found in the platform attached authenticator.").then(() => {
+ return promiseRejects(t, "NotAllowedError", navigator.credentials.get(options), "No matched credentials are found in the platform attached authenticator.").then(() => {
if (window.testRunner)
testRunner.cleanUpKeychain(testRpId);
});
@@ -51,7 +51,7 @@
if (window.testRunner)
testRunner.addTestKeyToKeychain(testES256PrivateKeyBase64, testRpId, testUserhandleBase64);
- return promise_rejects(t, "NotAllowedError", navigator.credentials.get(options), "Couldn't get user consent.").then(() => {
+ return promiseRejects(t, "NotAllowedError", navigator.credentials.get(options), "Couldn't get user consent.").then(() => {
if (window.testRunner)
testRunner.cleanUpKeychain(testRpId);
});
Modified: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,5 +1,3 @@
-PASS PublicKeyCredential's [[get]] with timeout
PASS PublicKeyCredential's [[get]] with a mismatched RP ID
-PASS PublicKeyCredential's [[get]] with user cancellations
Modified: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https.html (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https.html 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -4,18 +4,22 @@
<script src=""
<script src=""
<script>
- promise_test(function(t) {
- const options = {
- publicKey: {
- challenge: asciiToUint8Array("123456"),
- timeout: 0,
- }
- };
- internals.mockAuthenticatorCoordinator.setDidTimeOut();
+ // Default mock configuration. Tests need to override if they need different configuration.
+ if (window.testRunner)
+ testRunner.setWebAuthenticationMockConfiguration({ });
- return promise_rejects(t, "NotAllowedError",
- navigator.credentials.get(options));
- }, "PublicKeyCredential's [[get]] with timeout");
+ // FIXME(189642): Re-enable the following test.
+ // promise_test(function(t) {
+ // const options = {
+ // publicKey: {
+ // challenge: asciiToUint8Array("123456"),
+ // timeout: 0,
+ // }
+ // };
+ //
+ // return promiseRejects(t, "NotAllowedError",
+ // navigator.credentials.get(options), "Operation timed out.");
+ // }, "PublicKeyCredential's [[get]] with timeout");
promise_test(function(t) {
const options = {
@@ -24,20 +28,7 @@
challenge: asciiToUint8Array("123456"),
}
};
- return promise_rejects(t, "SecurityError",
- navigator.credentials.get(options));
+ return promiseRejects(t, "SecurityError",
+ navigator.credentials.get(options), "The origin of the document is not a registrable domain suffix of the provided RP ID.");
}, "PublicKeyCredential's [[get]] with a mismatched RP ID");
-
- promise_test(function(t) {
- const options = {
- publicKey: {
- challenge: asciiToUint8Array("123456"),
- allowCredentials: [{ type: "public-key", id: asciiToUint8Array("123456") }],
- }
- };
- internals.mockAuthenticatorCoordinator.setDidUserCancel();
-
- return promise_rejects(t, "NotAllowedError",
- navigator.credentials.get(options));
- }, "PublicKeyCredential's [[get]] with user cancellations");
</script>
Deleted: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success.https-expected.txt (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success.https-expected.txt 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success.https-expected.txt 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,3 +0,0 @@
-
-PASS PublicKeyCredential's [[get]] with minimum options
-
Deleted: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success.https.html (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success.https.html 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<title>Web Authentication API: PublicKeyCredential's [[get]] success cases.</title>
-<script src=""
-<script src=""
-<script src=""
-<script>
- // The following test is specifically tuned for current dummy authenticator.
- promise_test(function(t) {
- const options = {
- publicKey: {
- challenge: Base64URL.parse("MTIzNDU2"),
- }
- };
- // A mock assertion return bundle.
- internals.mockAuthenticatorCoordinator.setAssertionReturnBundle(hexStringToUint8Array('00'), hexStringToUint8Array('01'), hexStringToUint8Array('02'), hexStringToUint8Array('03'));
-
- return navigator.credentials.get(options).then(function(credential) {
- assert_equals(credential.id, 'AA');
- assert_equals(credential.type, 'public-key');
- assert_equals(bytesToHexString(credential.rawId), '00');
- assert_equals(bytesToASCIIString(credential.response.clientDataJSON), '{"type":"webauthn.get","challenge":"MTIzNDU2","origin":"https://localhost:9443","hashAlgorithm":"SHA-256"}');
- assert_equals(bytesToHexString(credential.response.authenticatorData), '01');
- assert_equals(bytesToHexString(credential.response.signature), '02');
- assert_equals(bytesToHexString(credential.response.userHandle), '03');
- assert_throws("NotSupportedError", () => { credential.getClientExtensionResults() });
- });
- }, "PublicKeyCredential's [[get]] with minimum options");
-</script>
Added: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https-expected.txt (0 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https-expected.txt (rev 0)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https-expected.txt 2018-09-29 00:02:39 UTC (rev 236625)
@@ -0,0 +1,28 @@
+
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 1
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 2
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 3
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 4
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 5
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 6
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 7
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 8
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 9
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 10
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 11
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 12
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 13
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 14
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 15
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 16
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 17
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 18
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 19
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 20
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 21
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 22
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 23
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 24
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 25
+PASS PublicKeyCredential's [[get]] with with invalid parameters. 26
+
Copied: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html (from rev 236624, trunk/LayoutTests/http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https.html) (0 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html (rev 0)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<title>Web Authentication API: PublicKeyCredential's [[get]] with invalid parameters.</title>
+<script src=""
+<script src=""
+<script src=""
+<script>
+ const challenge = asciiToUint8Array("123456");
+ const allowCredential = { type: "public-key", id: asciiToUint8Array("123456") };
+
+ const missingAttributeVector = [
+ // missing top level attribute
+ [undefined],
+ // missing allowCredentials attribute
+ [challenge, undefined, undefined, [{ type: undefined, id: allowCredential.id }]],
+ [challenge, undefined, undefined, [{ type: allowCredential.type, id: undefined }]]
+ ];
+
+ const wrongTypeAttributeVector = [
+ // wrong challenge type
+ [1],
+ [true],
+ [null],
+ [Symbol()],
+ ["foo"],
+ [[ ]],
+ [{ }],
+ // wrong timeout type
+ [challenge, Symbol(), undefined, undefined],
+ // wrong rpId type
+ [challenge, undefined, Symbol(), undefined],
+ // wrong allowCredentials type
+ [challenge, undefined, undefined, [{ type: 1, id: allowCredential.id }]],
+ [challenge, undefined, undefined, [{ type: true, id: allowCredential.id }]],
+ [challenge, undefined, undefined, [{ type: null, id: allowCredential.id }]],
+ [challenge, undefined, undefined, [{ type: Symbol(), id: allowCredential.id }]],
+ [challenge, undefined, undefined, [{ type: "foo", id: allowCredential.id }]],
+ [challenge, undefined, undefined, [{ type: [ ], id: allowCredential.id }]],
+ [challenge, undefined, undefined, [{ type: { }, id: allowCredential.id }]],
+ [challenge, undefined, undefined, [{ type: allowCredential.type, id: 1 }]],
+ [challenge, undefined, undefined, [{ type: allowCredential.type, id: true }]],
+ [challenge, undefined, undefined, [{ type: allowCredential.type, id: null }]],
+ [challenge, undefined, undefined, [{ type: allowCredential.type, id: Symbol() }]],
+ [challenge, undefined, undefined, [{ type: allowCredential.type, id: "foo" }]],
+ [challenge, undefined, undefined, [{ type: allowCredential.type, id: [ ] }]],
+ [challenge, undefined, undefined, [{ type: allowCredential.type, id: { } }]]
+ ];
+
+ function makeOptions(attributes)
+ {
+ if (attributes.length == 1)
+ return { publicKey: { challenge: attributes[0] } };
+ return { publicKey: { challenge: attributes[0], timeout: attributes[1], rpId: attributes[2], allowCredentials: attributes[3] } };
+ }
+
+ let index = 1;
+ function runTest(attributesVectors) {
+ attributesVectors.forEach(function(attributesVector) {
+ attributesVector.forEach(async function(attributes) {
+ promise_test(function(t) {
+ return promise_rejects(t, new TypeError(),
+ navigator.credentials.get(makeOptions(attributes)));
+ }, "PublicKeyCredential's [[get]] with with invalid parameters. " + index);
+ index = index + 1;
+ });
+ });
+ }
+
+ const vectors = [];
+ vectors.push(missingAttributeVector);
+ vectors.push(wrongTypeAttributeVector);
+ runTest(vectors);
+</script>
Added: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https-expected.txt (0 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https-expected.txt (rev 0)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https-expected.txt 2018-09-29 00:02:39 UTC (rev 236625)
@@ -0,0 +1,5 @@
+
+
+PASS Tests that a frame that doesn't share the same origin with all its ancestors could not access the API.
+PASS Tests that a frame that doesn't share the same origin with all its ancestors could not access the API. 2
+
Added: trunk/LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html (0 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html (rev 0)
+++ trunk/LayoutTests/http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Web Authentication API: Tests that a frame that doesn't share the same origin with all its ancestors could not access the API.</title>
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+</head>
+<body>
+ <script>
+ promise_test(t => {
+ return withCrossOriginIframe("last-layer-frame.https.html").then((message) => {
+ assert_equals(message.data, "PASS.");
+ });
+ }, "Tests that a frame that doesn't share the same origin with all its ancestors could not access the API.");
+
+ promise_test(t => {
+ return withCrossOriginIframe("second-layer-frame.https.html").then((message) => {
+ assert_equals(message.data, "PASS.");
+ });
+ }, "Tests that a frame that doesn't share the same origin with all its ancestors could not access the API. 2");
+ </script>
+</body>
+</html>
Added: trunk/LayoutTests/http/wpt/webauthn/resources/last-layer-frame.https.html (0 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/resources/last-layer-frame.https.html (rev 0)
+++ trunk/LayoutTests/http/wpt/webauthn/resources/last-layer-frame.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -0,0 +1,48 @@
+<script src=""
+<script>
+function messageToTop(message) {
+ top.postMessage(message, "*");
+}
+
+const makeOptions = {
+ publicKey: {
+ rp: {
+ name: "example.com"
+ },
+ user: {
+ name: "John Appleseed",
+ id: asciiToUint8Array("123456"),
+ displayName: "Appleseed",
+ },
+ challenge: asciiToUint8Array("123456"),
+ pubKeyCredParams: [{ type: "public-key", alg: -7 }]
+ }
+};
+const requestOptions = {
+ publicKey: {
+ challenge: asciiToUint8Array("123456"),
+ }
+};
+
+
+navigator.credentials.create(makeOptions).then(
+ function(value) {
+ messageToTop("Access granted. " + value);
+ },
+ function(exception) {
+ if (exception.name == "NotAllowedError" && exception.message == "The origin of the document is not the same as its ancestors.")
+ return navigator.credentials.get(requestOptions);
+ else
+ messageToTop("Throw " + exception.name + ".");
+ }
+).then(function(value) {
+ messageToTop("Access granted. " + value);
+ },
+ function(exception) {
+ if (exception.name == "NotAllowedError" && exception.message == "The origin of the document is not the same as its ancestors.")
+ messageToTop("PASS.");
+ else
+ messageToTop("Throw " + exception.name + ".");
+ }
+);
+</script>
Copied: trunk/LayoutTests/http/wpt/webauthn/resources/second-layer-frame.https.html (from rev 236624, trunk/LayoutTests/http/tests/webauthn/resources/second-layer-frame.https.html) (0 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/resources/second-layer-frame.https.html (rev 0)
+++ trunk/LayoutTests/http/wpt/webauthn/resources/second-layer-frame.https.html 2018-09-29 00:02:39 UTC (rev 236625)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+ <iframe src=""
+</body>
+</html>
Modified: trunk/LayoutTests/http/wpt/webauthn/resources/util.js (236624 => 236625)
--- trunk/LayoutTests/http/wpt/webauthn/resources/util.js 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/http/wpt/webauthn/resources/util.js 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,3 +1,16 @@
+const testCredentialIdBase64url = "SMSXHngF7hEOsElA73C3RY-8bR4";
+const testES256PrivateKeyBase64 =
+ "BDj/zxSkzKgaBuS3cdWDF558of8AaIpgFpsjF/Qm1749VBJPgqUIwfhWHJ91nb7U" +
+ "PH76c0+WFOzZKslPyyFse4goGIW2R7k9VHLPEZl5nfnBgEVFh5zev+/xpHQIvuq6" +
+ "RQ==";
+const testES256PublicKeyBase64url =
+ "BDj_zxSkzKgaBuS3cdWDF558of8AaIpgFpsjF_Qm1749VBJPgqUIwfhWHJ91nb7U" +
+ "PH76c0-WFOzZKslPyyFse4g";
+const testRpId = "localhost";
+const testUserhandleBase64 = "AAECAwQFBgcICQ==";
+
+const RESOURCES_DIR = "/WebKit/webauthn/resources/";
+
function asciiToUint8Array(str)
{
var chars = [];
@@ -138,13 +151,31 @@
return tmp.buffer;
}
-const testCredentialIdBase64url = "SMSXHngF7hEOsElA73C3RY-8bR4";
-const testES256PrivateKeyBase64 =
- "BDj/zxSkzKgaBuS3cdWDF558of8AaIpgFpsjF/Qm1749VBJPgqUIwfhWHJ91nb7U" +
- "PH76c0+WFOzZKslPyyFse4goGIW2R7k9VHLPEZl5nfnBgEVFh5zev+/xpHQIvuq6" +
- "RQ==";
-const testES256PublicKeyBase64url =
- "BDj_zxSkzKgaBuS3cdWDF558of8AaIpgFpsjF_Qm1749VBJPgqUIwfhWHJ91nb7U" +
- "PH76c0-WFOzZKslPyyFse4g";
-const testRpId = "localhost";
-const testUserhandleBase64 = "AAECAwQFBgcICQ==";
+function waitForLoad()
+{
+ return new Promise((resolve) => {
+ window.addEventListener('message', (message) => {
+ resolve(message);
+ });
+ });
+}
+
+function withCrossOriginIframe(resourceFile)
+{
+ return new Promise((resolve) => {
+ waitForLoad().then((message) => {
+ resolve(message);
+ });
+ const frame = document.createElement("iframe");
+ frame.src = "" + RESOURCES_DIR + resourceFile;
+ document.body.appendChild(frame);
+ });
+}
+
+function promiseRejects(test, expected, promise, description)
+{
+ return promise.then(test.unreached_func("Should have rejected: " + description)).catch(function(e) {
+ assert_throws(expected, function() { throw e }, description);
+ assert_equals(e.message, description);
+ });
+}
\ No newline at end of file
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (236624 => 236625)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1150,7 +1150,6 @@
webkit.org/b/175419 http/wpt/service-workers/third-party-registration.html [ Skip ]
# Skip anything related to WebAuthN
-http/tests/webauthn/ [ Skip ]
http/wpt/credential-management/ [ Skip ]
http/wpt/webauthn/ [ Skip ]
imported/w3c/web-platform-tests/credential-management/ [ Skip ]
Modified: trunk/LayoutTests/platform/ios-wk1/TestExpectations (236624 => 236625)
--- trunk/LayoutTests/platform/ios-wk1/TestExpectations 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/platform/ios-wk1/TestExpectations 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1969,7 +1969,6 @@
http/tests/xmlhttprequest/range-test.html [ Skip ]
# Skip anything related to WebAuthN
-http/tests/webauthn/ [ Skip ]
http/wpt/credential-management/ [ Skip ]
http/wpt/webauthn/ [ Skip ]
imported/w3c/web-platform-tests/credential-management/ [ Skip ]
Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (236624 => 236625)
--- trunk/LayoutTests/platform/mac-wk1/TestExpectations 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations 2018-09-29 00:02:39 UTC (rev 236625)
@@ -545,7 +545,6 @@
webkit.org/b/179853 imported/blink/fast/text/international-iteration-simple-text.html [ Pass Failure ]
# Skip anything related to WebAuthN
-http/tests/webauthn/ [ Skip ]
http/wpt/credential-management/ [ Skip ]
http/wpt/webauthn/ [ Skip ]
imported/w3c/web-platform-tests/credential-management/ [ Skip ]
Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (236624 => 236625)
--- trunk/LayoutTests/platform/mac-wk2/TestExpectations 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations 2018-09-29 00:02:39 UTC (rev 236625)
@@ -887,3 +887,6 @@
http/wpt/webauthn/public-key-credential-create-success-local.https.html [ Skip ]
http/wpt/webauthn/public-key-credential-get-failure-local.https.html [ Skip ]
http/wpt/webauthn/public-key-credential-get-success-local.https.html [ Skip ]
+# The following tests require PublicKeyCredential objects. We can only produce them via local authenticators now.
+http/wpt/credential-management/credentialscontainer-store-basics.https.html [ Skip ]
+http/wpt/webauthn/idl.https.html [ Skip ]
Modified: trunk/LayoutTests/platform/win/TestExpectations (236624 => 236625)
--- trunk/LayoutTests/platform/win/TestExpectations 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/platform/win/TestExpectations 2018-09-29 00:02:39 UTC (rev 236625)
@@ -654,7 +654,6 @@
webkit.org/b/158836 imported/w3c/web-platform-tests/encrypted-media [ Skip ]
# Skip anything related to WebAuthN
-http/tests/webauthn/ [ Skip ]
http/wpt/credential-management/ [ Skip ]
http/wpt/webauthn/ [ Skip ]
imported/w3c/web-platform-tests/credential-management/ [ Skip ]
Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (236624 => 236625)
--- trunk/LayoutTests/platform/wincairo/TestExpectations 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations 2018-09-29 00:02:39 UTC (rev 236625)
@@ -924,7 +924,6 @@
http/tests/subresource-integrity [ Skip ]
http/tests/webarchive [ Skip ]
-http/tests/webauthn [ Skip ]
http/tests/webgl [ Skip ]
http/tests/webrtc [ Skip ]
Modified: trunk/LayoutTests/platform/wpe/TestExpectations (236624 => 236625)
--- trunk/LayoutTests/platform/wpe/TestExpectations 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/LayoutTests/platform/wpe/TestExpectations 2018-09-29 00:02:39 UTC (rev 236625)
@@ -120,7 +120,6 @@
# Skip anything related to WebAuthN
# ---------------------------------
-http/tests/webauthn/ [ Skip ]
http/wpt/credential-management/ [ Skip ]
http/wpt/webauthn/ [ Skip ]
imported/w3c/web-platform-tests/credential-management/ [ Skip ]
Modified: trunk/Source/WebCore/ChangeLog (236624 => 236625)
--- trunk/Source/WebCore/ChangeLog 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebCore/ChangeLog 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,3 +1,28 @@
+2018-09-28 Jiewen Tan <[email protected]>
+
+ [WebAuthN] Polish WebAuthN auto-test environment
+ https://bugs.webkit.org/show_bug.cgi?id=189283
+ <rdar://problem/44117828>
+
+ Reviewed by Chris Dumez.
+
+ This patch removes the old mocking mechanism.
+
+ Tests: http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html
+ http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html
+ http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html
+
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ * testing/Internals.cpp:
+ (WebCore::Internals::Internals):
+ (WebCore::Internals::mockAuthenticatorCoordinator const): Deleted.
+ * testing/Internals.h:
+ * testing/Internals.idl:
+ * testing/MockAuthenticatorCoordinator.cpp: Removed.
+ * testing/MockAuthenticatorCoordinator.h: Removed.
+ * testing/MockAuthenticatorCoordinator.idl: Removed.
+
2018-09-28 Jer Noble <[email protected]>
Refactoring: eliminate raw pointer usage in Fullscreen code
Modified: trunk/Source/WebCore/DerivedSources.make (236624 => 236625)
--- trunk/Source/WebCore/DerivedSources.make 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebCore/DerivedSources.make 2018-09-29 00:02:39 UTC (rev 236625)
@@ -978,7 +978,6 @@
$(WebCore)/testing/Internals.idl \
$(WebCore)/testing/MallocStatistics.idl \
$(WebCore)/testing/MemoryInfo.idl \
- $(WebCore)/testing/MockAuthenticatorCoordinator.idl \
$(WebCore)/testing/MockCDMFactory.idl \
$(WebCore)/testing/MockContentFilterSettings.idl \
$(WebCore)/testing/MockPageOverlay.idl \
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (236624 => 236625)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1769,8 +1769,6 @@
5750A9871E6A216800705C4A /* CryptoAlgorithmECDH.h in Headers */ = {isa = PBXBuildFile; fileRef = 5750A9851E6A216800705C4A /* CryptoAlgorithmECDH.h */; };
5754719F1ECE628300DD63B2 /* JSRsaPssParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 575471991ECE5D2A00DD63B2 /* JSRsaPssParams.h */; };
5760827220215A5500116678 /* AuthenticatorCoordinatorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 576082702021513F00116678 /* AuthenticatorCoordinatorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 5760827A2024EA5C00116678 /* MockAuthenticatorCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 5760827820244DAB00116678 /* MockAuthenticatorCoordinator.h */; };
- 5760827B2024ED2900116678 /* MockAuthenticatorCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5760827920244DAC00116678 /* MockAuthenticatorCoordinator.cpp */; };
5768142A1E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 576814291E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h */; };
576814411E709FA400E77754 /* JSEcdhKeyDeriveParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5768143E1E709C3600E77754 /* JSEcdhKeyDeriveParams.h */; };
576814451E70CB1F00E77754 /* JSAesKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 576814431E70CB1000E77754 /* JSAesKeyParams.h */; };
@@ -1792,8 +1790,6 @@
57D846281FE8960500CA3682 /* NavigatorCredentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 57D846261FE895F800CA3682 /* NavigatorCredentials.h */; };
57D8462E1FEAF69900CA3682 /* PublicKeyCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 57D8462B1FEAF68F00CA3682 /* PublicKeyCredential.h */; settings = {ATTRIBUTES = (Private, ); }; };
57D846351FEAFCD300CA3682 /* JSPublicKeyCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 57D846301FEAFC2F00CA3682 /* JSPublicKeyCredential.h */; };
- 57DCED672140775B0016B847 /* JSMockAuthenticatorCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 57DCED622140763C0016B847 /* JSMockAuthenticatorCoordinator.h */; };
- 57DCED69214077640016B847 /* JSMockAuthenticatorCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57DCED632140763C0016B847 /* JSMockAuthenticatorCoordinator.cpp */; };
57DCED74214305F00016B847 /* PublicKeyCredentialData.h in Headers */ = {isa = PBXBuildFile; fileRef = 57DCED72214305F00016B847 /* PublicKeyCredentialData.h */; settings = {ATTRIBUTES = (Private, ); }; };
57DCED9021487FF70016B847 /* AuthenticatorTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = 57DCED8C21487EDB0016B847 /* AuthenticatorTransport.h */; settings = {ATTRIBUTES = (Private, ); }; };
57DCED98214882160016B847 /* JSAuthenticatorTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = 57DCED92214880C60016B847 /* JSAuthenticatorTransport.h */; };
@@ -8568,9 +8564,6 @@
5760824F20118D8D00116678 /* JSBasicCredentialCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSBasicCredentialCustom.cpp; sourceTree = "<group>"; };
576082562011BE0200116678 /* JSAuthenticatorResponseCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSAuthenticatorResponseCustom.cpp; sourceTree = "<group>"; };
576082702021513F00116678 /* AuthenticatorCoordinatorClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AuthenticatorCoordinatorClient.h; sourceTree = "<group>"; };
- 5760827820244DAB00116678 /* MockAuthenticatorCoordinator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockAuthenticatorCoordinator.h; sourceTree = "<group>"; };
- 5760827920244DAC00116678 /* MockAuthenticatorCoordinator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MockAuthenticatorCoordinator.cpp; sourceTree = "<group>"; };
- 57608280202556F400116678 /* MockAuthenticatorCoordinator.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MockAuthenticatorCoordinator.idl; sourceTree = "<group>"; };
57608293202BA95300116678 /* AuthenticatorCoordinatorClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticatorCoordinatorClient.cpp; sourceTree = "<group>"; };
576814281E6F98AD00E77754 /* EcdhKeyDeriveParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = EcdhKeyDeriveParams.idl; sourceTree = "<group>"; };
576814291E6F99C100E77754 /* CryptoAlgorithmEcdhKeyDeriveParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmEcdhKeyDeriveParams.h; sourceTree = "<group>"; };
@@ -8625,8 +8618,6 @@
57D8462D1FEAF68F00CA3682 /* PublicKeyCredential.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PublicKeyCredential.idl; sourceTree = "<group>"; };
57D846301FEAFC2F00CA3682 /* JSPublicKeyCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPublicKeyCredential.h; sourceTree = "<group>"; };
57D846311FEAFC2F00CA3682 /* JSPublicKeyCredential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPublicKeyCredential.cpp; sourceTree = "<group>"; };
- 57DCED622140763C0016B847 /* JSMockAuthenticatorCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMockAuthenticatorCoordinator.h; sourceTree = "<group>"; };
- 57DCED632140763C0016B847 /* JSMockAuthenticatorCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMockAuthenticatorCoordinator.cpp; sourceTree = "<group>"; };
57DCED72214305F00016B847 /* PublicKeyCredentialData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PublicKeyCredentialData.h; sourceTree = "<group>"; };
57DCED8C21487EDB0016B847 /* AuthenticatorTransport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AuthenticatorTransport.h; sourceTree = "<group>"; };
57DCED8E21487EDB0016B847 /* AuthenticatorTransport.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AuthenticatorTransport.idl; sourceTree = "<group>"; };
@@ -17037,9 +17028,6 @@
A7BE7EDE14C9175A0014489D /* MallocStatistics.idl */,
CD5393CB175DCCE600C07123 /* MemoryInfo.h */,
CD5393CC175DCCE600C07123 /* MemoryInfo.idl */,
- 5760827920244DAC00116678 /* MockAuthenticatorCoordinator.cpp */,
- 5760827820244DAB00116678 /* MockAuthenticatorCoordinator.h */,
- 57608280202556F400116678 /* MockAuthenticatorCoordinator.idl */,
CDF4B7211E03BF8100E235A2 /* MockCDMFactory.cpp */,
CDF4B7221E03BF8100E235A2 /* MockCDMFactory.h */,
CDF4B71F1E03BF6F00E235A2 /* MockCDMFactory.idl */,
@@ -17096,8 +17084,6 @@
A7B4EA6914C9348400C8F5BF /* JSMallocStatistics.h */,
CD5393D1175E018600C07123 /* JSMemoryInfo.cpp */,
CD5393D2175E018600C07123 /* JSMemoryInfo.h */,
- 57DCED632140763C0016B847 /* JSMockAuthenticatorCoordinator.cpp */,
- 57DCED622140763C0016B847 /* JSMockAuthenticatorCoordinator.h */,
CDF4B72D1E03CA4A00E235A2 /* JSMockCDMFactory.cpp */,
CDF4B72E1E03CA4A00E235A2 /* JSMockCDMFactory.h */,
A19AEA1D1AAA806E00B52B25 /* JSMockContentFilterSettings.cpp */,
@@ -18814,8 +18800,6 @@
574F55DD204F3744002948C6 /* cocoa */ = {
isa = PBXGroup;
children = (
- 574F55DE204F3744002948C6 /* LocalAuthenticator.h */,
- 574F55DF204F3744002948C6 /* LocalAuthenticator.mm */,
);
path = cocoa;
sourceTree = "<group>";
@@ -27138,7 +27122,6 @@
53ED3FDF167A88E7006762E6 /* JSInternalSettingsGenerated.h in Headers */,
A740B59514C935AB00A77FA4 /* JSMallocStatistics.h in Headers */,
CD5393D4175E018600C07123 /* JSMemoryInfo.h in Headers */,
- 57DCED672140775B0016B847 /* JSMockAuthenticatorCoordinator.h in Headers */,
538EC9331F99B9F7004D22A8 /* JSMockCDMFactory.h in Headers */,
A19AEA211AAA808600B52B25 /* JSMockContentFilterSettings.h in Headers */,
538EC9341F99B9F7004D22A8 /* JSMockPageOverlay.h in Headers */,
@@ -27148,7 +27131,6 @@
427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */,
EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */,
CDC26B41160A8CCE0026757B /* LegacyMockCDM.h in Headers */,
- 5760827A2024EA5C00116678 /* MockAuthenticatorCoordinator.h in Headers */,
A1BF6B831AA96C7D00AF4A8A /* MockContentFilter.h in Headers */,
A1B5B29F1AAA846F008B6042 /* MockContentFilterSettings.h in Headers */,
51058ADC1D6792C1009A538C /* MockGamepad.h in Headers */,
@@ -31567,7 +31549,6 @@
53ED3FDE167A88E7006762E6 /* JSInternalSettingsGenerated.cpp in Sources */,
538EC9321F99B9F7004D22A8 /* JSMallocStatistics.cpp in Sources */,
CD5393D3175E018600C07123 /* JSMemoryInfo.cpp in Sources */,
- 57DCED69214077640016B847 /* JSMockAuthenticatorCoordinator.cpp in Sources */,
CDF4B7321E03D06000E235A2 /* JSMockCDMFactory.cpp in Sources */,
A19AEA221AAA808A00B52B25 /* JSMockContentFilterSettings.cpp in Sources */,
2D4150DE1C1F868C000A3BA2 /* JSMockPageOverlay.cpp in Sources */,
@@ -31577,7 +31558,6 @@
427DA71D13735DFA007C57FB /* JSServiceWorkerInternals.cpp in Sources */,
EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
CDC26B40160A8CC60026757B /* LegacyMockCDM.cpp in Sources */,
- 5760827B2024ED2900116678 /* MockAuthenticatorCoordinator.cpp in Sources */,
CDF4B7311E03D00700E235A2 /* MockCDMFactory.cpp in Sources */,
A1BF6B821AA96C7D00AF4A8A /* MockContentFilter.cpp in Sources */,
A1B5B29E1AAA846E008B6042 /* MockContentFilterSettings.cpp in Sources */,
Modified: trunk/Source/WebCore/testing/Internals.cpp (236624 => 236625)
--- trunk/Source/WebCore/testing/Internals.cpp 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebCore/testing/Internals.cpp 2018-09-29 00:02:39 UTC (rev 236625)
@@ -268,11 +268,6 @@
#include "PaymentCoordinator.h"
#endif
-#if ENABLE(WEB_AUTHN)
-#include "AuthenticatorCoordinator.h"
-#include "MockAuthenticatorCoordinator.h"
-#endif
-
#if PLATFORM(MAC) && USE(LIBWEBRTC)
#include <webrtc/sdk/WebKit/VideoProcessingSoftLink.h>
#endif
@@ -553,15 +548,6 @@
frame->page()->setPaymentCoordinator(std::make_unique<PaymentCoordinator>(*m_mockPaymentCoordinator));
}
#endif
-
-#if ENABLE(WEB_AUTHN)
- // FIXME(189283)
- if (document.page()) {
- auto mockAuthenticatorCoordinator = std::make_unique<MockAuthenticatorCoordinator>();
- m_mockAuthenticatorCoordinator = makeWeakPtr(mockAuthenticatorCoordinator.get());
-// document.page()->authenticatorCoordinator().setClient(WTFMove(mockAuthenticatorCoordinator));
- }
-#endif
}
Document* Internals::contextDocument() const
@@ -4640,13 +4626,6 @@
}
#endif
-#if ENABLE(WEB_AUTHN)
-MockAuthenticatorCoordinator& Internals::mockAuthenticatorCoordinator() const
-{
- return *m_mockAuthenticatorCoordinator;
-}
-#endif
-
bool Internals::isSystemPreviewLink(Element& element) const
{
#if USE(SYSTEM_PREVIEW)
Modified: trunk/Source/WebCore/testing/Internals.h (236624 => 236625)
--- trunk/Source/WebCore/testing/Internals.h 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebCore/testing/Internals.h 2018-09-29 00:02:39 UTC (rev 236625)
@@ -79,7 +79,6 @@
class MemoryInfo;
class MockCDMFactory;
class MockContentFilterSettings;
-class MockAuthenticatorCoordinator;
class MockPageOverlay;
class MockPaymentCoordinator;
class NodeList;
@@ -704,10 +703,6 @@
void pauseTimeline(AnimationTimeline&);
void setTimelineCurrentTime(AnimationTimeline&, double);
-#if ENABLE(WEB_AUTHN)
- MockAuthenticatorCoordinator& mockAuthenticatorCoordinator() const;
-#endif
-
bool isSystemPreviewLink(Element&) const;
bool isSystemPreviewImage(Element&) const;
@@ -806,10 +801,6 @@
#if ENABLE(APPLE_PAY)
MockPaymentCoordinator* m_mockPaymentCoordinator { nullptr };
#endif
-
-#if ENABLE(WEB_AUTHN)
- WeakPtr<MockAuthenticatorCoordinator> m_mockAuthenticatorCoordinator;
-#endif
};
} // namespace WebCore
Modified: trunk/Source/WebCore/testing/Internals.idl (236624 => 236625)
--- trunk/Source/WebCore/testing/Internals.idl 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebCore/testing/Internals.idl 2018-09-29 00:02:39 UTC (rev 236625)
@@ -684,7 +684,6 @@
[EnabledAtRuntime=WebAnimations] void pauseTimeline(AnimationTimeline timeline);
[EnabledAtRuntime=WebAnimations] void setTimelineCurrentTime(AnimationTimeline timeline, double currentTime);
[Conditional=APPLE_PAY] readonly attribute MockPaymentCoordinator mockPaymentCoordinator;
- [Conditional=WEB_AUTHN] readonly attribute MockAuthenticatorCoordinator mockAuthenticatorCoordinator;
boolean isSystemPreviewLink(Element element);
boolean isSystemPreviewImage(Element element);
Deleted: trunk/Source/WebCore/testing/MockAuthenticatorCoordinator.cpp (236624 => 236625)
--- trunk/Source/WebCore/testing/MockAuthenticatorCoordinator.cpp 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebCore/testing/MockAuthenticatorCoordinator.cpp 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MockAuthenticatorCoordinator.h"
-
-#if ENABLE(WEB_AUTHN)
-
-#include "Internals.h"
-#include <WebCore/PublicKeyCredentialData.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-void MockAuthenticatorCoordinator::setCreationReturnBundle(const BufferSource& credentialId, const BufferSource& attestationObject)
-{
- ASSERT(!m_credentialId && !m_attestationObject);
- m_credentialId = ArrayBuffer::create(credentialId.data(), credentialId.length());
- m_attestationObject = ArrayBuffer::create(attestationObject.data(), attestationObject.length());
-}
-
-void MockAuthenticatorCoordinator::setAssertionReturnBundle(const BufferSource& credentialId, const BufferSource& authenticatorData, const BufferSource& signature, const BufferSource& userHandle)
-{
- ASSERT(!m_credentialId && !m_authenticatorData && !m_signature && !m_userHandle);
- m_credentialId = ArrayBuffer::create(credentialId.data(), credentialId.length());
- m_authenticatorData = ArrayBuffer::create(authenticatorData.data(), authenticatorData.length());
- m_signature = ArrayBuffer::create(signature.data(), signature.length());
- m_userHandle = ArrayBuffer::create(userHandle.data(), userHandle.length());
-}
-
-void MockAuthenticatorCoordinator::makeCredential(const Vector<uint8_t>&, const PublicKeyCredentialCreationOptions&, RequestCompletionHandler&& handler)
-{
- if (!setRequestCompletionHandler(WTFMove(handler)))
- return;
-
- if (m_didTimeOut) {
- m_didTimeOut = false;
- return;
- }
- if (m_didUserCancel) {
- m_didUserCancel = false;
- requestReply({ }, { NotAllowedError, "User cancelled."_s });
- return;
- }
- if (m_credentialId) {
- ASSERT(m_attestationObject);
- requestReply(PublicKeyCredentialData { WTFMove(m_credentialId), true, nullptr, WTFMove(m_attestationObject), nullptr, nullptr, nullptr }, { });
- m_credentialId = nullptr;
- m_attestationObject = nullptr;
- return;
- }
- ASSERT_NOT_REACHED();
-}
-
-void MockAuthenticatorCoordinator::getAssertion(const Vector<uint8_t>&, const PublicKeyCredentialRequestOptions&, RequestCompletionHandler&& handler)
-{
- if (!setRequestCompletionHandler(WTFMove(handler)))
- return;
-
- if (m_didTimeOut) {
- m_didTimeOut = false;
- return;
- }
- if (m_didUserCancel) {
- m_didUserCancel = false;
- requestReply({ }, { NotAllowedError, "User cancelled."_s });
- return;
- }
- if (m_credentialId) {
- ASSERT(m_authenticatorData && m_signature && m_userHandle);
- requestReply(PublicKeyCredentialData { WTFMove(m_credentialId), false, nullptr, nullptr, WTFMove(m_authenticatorData), WTFMove(m_signature), WTFMove(m_userHandle) }, { });
- m_credentialId = nullptr;
- m_authenticatorData = nullptr;
- m_signature = nullptr;
- m_userHandle = nullptr;
- return;
- }
- ASSERT_NOT_REACHED();
-}
-
-void MockAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable(QueryCompletionHandler&& handler)
-{
- auto messageId = addQueryCompletionHandler(WTFMove(handler));
- if (m_didUserVerifyingPlatformAuthenticatorPresent) {
- isUserVerifyingPlatformAuthenticatorAvailableReply(messageId, true);
- m_didUserVerifyingPlatformAuthenticatorPresent = false;
- } else
- isUserVerifyingPlatformAuthenticatorAvailableReply(messageId, false);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_AUTHN)
Deleted: trunk/Source/WebCore/testing/MockAuthenticatorCoordinator.h (236624 => 236625)
--- trunk/Source/WebCore/testing/MockAuthenticatorCoordinator.h 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebCore/testing/MockAuthenticatorCoordinator.h 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(WEB_AUTHN)
-
-#include "AuthenticatorCoordinatorClient.h"
-#include "BufferSource.h"
-#include <wtf/Forward.h>
-
-namespace WebCore {
-
-class Internals;
-
-class MockAuthenticatorCoordinator final : public AuthenticatorCoordinatorClient {
-public:
- void setDidTimeOut() { m_didTimeOut = true; }
- void setDidUserCancel() { m_didUserCancel = true; }
- void setDidUserVerifyingPlatformAuthenticatorPresent() { m_didUserVerifyingPlatformAuthenticatorPresent = true; }
- void setCreationReturnBundle(const BufferSource& credentialId, const BufferSource& attestationObject);
- void setAssertionReturnBundle(const BufferSource& credentialId, const BufferSource& authenticatorData, const BufferSource& signature, const BufferSource& userHandle);
-
- // RefCounted is required for JS wrapper. Therefore, fake them to compile.
- void ref() const { }
- void deref() const { }
-
-private:
- void makeCredential(const Vector<uint8_t>& hash, const PublicKeyCredentialCreationOptions&, RequestCompletionHandler&&) final;
- void getAssertion(const Vector<uint8_t>& hash, const PublicKeyCredentialRequestOptions&, RequestCompletionHandler&&) final;
- void isUserVerifyingPlatformAuthenticatorAvailable(QueryCompletionHandler&&) final;
-
- // All following fields are disposable.
- bool m_didTimeOut { false };
- bool m_didUserCancel { false };
- bool m_didUserVerifyingPlatformAuthenticatorPresent { false };
- RefPtr<ArrayBuffer> m_credentialId;
- RefPtr<ArrayBuffer> m_attestationObject;
- RefPtr<ArrayBuffer> m_authenticatorData;
- RefPtr<ArrayBuffer> m_signature;
- RefPtr<ArrayBuffer> m_userHandle;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_AUTHN)
Deleted: trunk/Source/WebCore/testing/MockAuthenticatorCoordinator.idl (236624 => 236625)
--- trunk/Source/WebCore/testing/MockAuthenticatorCoordinator.idl 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebCore/testing/MockAuthenticatorCoordinator.idl 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- Conditional=WEB_AUTHN,
- NoInterfaceObject,
-] interface MockAuthenticatorCoordinator {
- void setDidTimeOut();
- void setDidUserCancel();
- void setDidUserVerifyingPlatformAuthenticatorPresent();
- void setCreationReturnBundle(BufferSource credentialId, BufferSource attestationObject);
- void setAssertionReturnBundle(BufferSource credentialId, BufferSource authenticatorData, BufferSource signature, BufferSource userHandle);
-};
Modified: trunk/Source/WebKit/ChangeLog (236624 => 236625)
--- trunk/Source/WebKit/ChangeLog 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebKit/ChangeLog 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,3 +1,23 @@
+2018-09-28 Jiewen Tan <[email protected]>
+
+ [WebAuthN] Polish WebAuthN auto-test environment
+ https://bugs.webkit.org/show_bug.cgi?id=189283
+ <rdar://problem/44117828>
+
+ Reviewed by Chris Dumez.
+
+ This patch changes MockWebAuthenticationConfiguration.local to optional such that tests can express
+ absence of local authenticators.
+
+ * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
+ (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
+ * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
+ (WebKit::MockLocalConnection::getUserConsent const):
+ (WebKit::MockLocalConnection::getAttestation const):
+ * UIProcess/WebAuthentication/Mock/MockLocalService.cpp:
+ (WebKit::MockLocalService::platformStartDiscovery const):
+ * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
+
2018-09-28 Jer Noble <[email protected]>
Refactoring: eliminate raw pointer usage in Fullscreen code
Modified: trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp (236624 => 236625)
--- trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp 2018-09-29 00:02:39 UTC (rev 236625)
@@ -575,13 +575,17 @@
void WKWebsiteDataStoreSetWebAuthenticationMockConfiguration(WKWebsiteDataStoreRef dataStoreRef, WKDictionaryRef configurationRef)
{
#if ENABLE(WEB_AUTHN)
+ MockWebAuthenticationConfiguration configuration;
+
auto localRef = static_cast<WKDictionaryRef>(WKDictionaryGetItemForKey(configurationRef, adoptWK(WKStringCreateWithUTF8CString("Local")).get()));
+ if (localRef) {
+ MockWebAuthenticationConfiguration::Local local;
+ local.acceptAuthentication = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(localRef, adoptWK(WKStringCreateWithUTF8CString("AcceptAuthentication")).get())));
+ local.acceptAttestation = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(localRef, adoptWK(WKStringCreateWithUTF8CString("AcceptAttestation")).get())));
+ local.privateKeyBase64 = WebKit::toImpl(static_cast<WKStringRef>(WKDictionaryGetItemForKey(localRef, adoptWK(WKStringCreateWithUTF8CString("PrivateKeyBase64")).get())))->string();
+ configuration.local = WTFMove(local);
+ }
- MockWebAuthenticationConfiguration configuration;
- configuration.local.acceptAuthentication = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(localRef, adoptWK(WKStringCreateWithUTF8CString("AcceptAuthentication")).get())));
- configuration.local.acceptAttestation = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(localRef, adoptWK(WKStringCreateWithUTF8CString("AcceptAttestation")).get())));
- configuration.local.privateKeyBase64 = WebKit::toImpl(static_cast<WKStringRef>(WKDictionaryGetItemForKey(localRef, adoptWK(WKStringCreateWithUTF8CString("PrivateKeyBase64")).get())))->string();
-
WebKit::toImpl(dataStoreRef)->websiteDataStore().setMockWebAuthenticationConfiguration(WTFMove(configuration));
#endif
}
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.mm (236624 => 236625)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.mm 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.mm 2018-09-29 00:02:39 UTC (rev 236625)
@@ -73,7 +73,8 @@
{
// Mock async operations.
RunLoop::main().dispatch([configuration = m_configuration, callback = WTFMove(callback)]() mutable {
- if (!configuration.local.acceptAuthentication) {
+ ASSERT(configuration.local);
+ if (!configuration.local->acceptAuthentication) {
callback(UserConsent::No);
return;
}
@@ -85,7 +86,8 @@
{
// Mock async operations.
RunLoop::main().dispatch([configuration = m_configuration, callback = WTFMove(callback)]() mutable {
- if (!configuration.local.acceptAuthentication) {
+ ASSERT(configuration.local);
+ if (!configuration.local->acceptAuthentication) {
callback(UserConsent::No, nil);
return;
}
@@ -99,7 +101,8 @@
// Mock async operations.
RunLoop::main().dispatch([configuration = m_configuration, rpId, username, hash, callback = WTFMove(callback)]() mutable {
- if (!configuration.local.acceptAttestation) {
+ ASSERT(configuration.local);
+ if (!configuration.local->acceptAttestation) {
callback(NULL, NULL, [NSError errorWithDomain:NSOSStatusErrorDomain code:-1 userInfo:nil]);
return;
}
@@ -112,7 +115,7 @@
};
CFErrorRef errorRef = nullptr;
auto key = adoptCF(SecKeyCreateWithData(
- (__bridge CFDataRef)adoptNS([[NSData alloc] initWithBase64EncodedString:configuration.local.privateKeyBase64 options:NSDataBase64DecodingIgnoreUnknownCharacters]).get(),
+ (__bridge CFDataRef)adoptNS([[NSData alloc] initWithBase64EncodedString:configuration.local->privateKeyBase64 options:NSDataBase64DecodingIgnoreUnknownCharacters]).get(),
(__bridge CFDictionaryRef)options,
&errorRef
));
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp (236624 => 236625)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalService.cpp 2018-09-29 00:02:39 UTC (rev 236625)
@@ -42,8 +42,7 @@
bool MockLocalService::platformStartDiscovery() const
{
- // FIXME(189642): we should test false case.
- return true;
+ return !!m_configuration.local;
}
UniqueRef<LocalConnection> MockLocalService::createLocalConnection() const
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h (236624 => 236625)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h 2018-09-29 00:02:39 UTC (rev 236625)
@@ -36,7 +36,7 @@
String privateKeyBase64;
};
- Local local;
+ std::optional<Local> local;
};
} // namespace WebKit
Modified: trunk/Tools/ChangeLog (236624 => 236625)
--- trunk/Tools/ChangeLog 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Tools/ChangeLog 2018-09-29 00:02:39 UTC (rev 236625)
@@ -1,3 +1,14 @@
+2018-09-28 Jiewen Tan <[email protected]>
+
+ [WebAuthN] Polish WebAuthN auto-test environment
+ https://bugs.webkit.org/show_bug.cgi?id=189283
+ <rdar://problem/44117828>
+
+ Reviewed by Chris Dumez.
+
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::setWebAuthenticationMockConfiguration):
+
2018-09-28 Chris Dumez <[email protected]>
Drop support for cross-origin-window-policy header
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (236624 => 236625)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2018-09-28 23:31:29 UTC (rev 236624)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2018-09-29 00:02:39 UTC (rev 236625)
@@ -2358,52 +2358,55 @@
return;
JSObjectRef configuration = JSValueToObject(context, configurationValue, 0);
+ Vector<WKRetainPtr<WKStringRef>> configurationKeys;
+ Vector<WKRetainPtr<WKTypeRef>> configurationValues;
+
JSRetainPtr<JSStringRef> localPropertyName(Adopt, JSStringCreateWithUTF8CString("local"));
JSValueRef localValue = JSObjectGetProperty(context, configuration, localPropertyName.get(), 0);
- if (!JSValueIsObject(context, localValue))
- return;
- JSObjectRef local = JSValueToObject(context, localValue, 0);
+ if (!JSValueIsNull(context, localValue)) {
+ if (!JSValueIsObject(context, localValue))
+ return;
+ JSObjectRef local = JSValueToObject(context, localValue, 0);
- JSRetainPtr<JSStringRef> acceptAuthenticationPropertyName(Adopt, JSStringCreateWithUTF8CString("acceptAuthentication"));
- JSValueRef acceptAuthenticationValue = JSObjectGetProperty(context, local, acceptAuthenticationPropertyName.get(), 0);
- if (!JSValueIsBoolean(context, acceptAuthenticationValue))
- return;
- bool acceptAuthentication = JSValueToBoolean(context, acceptAuthenticationValue);
+ JSRetainPtr<JSStringRef> acceptAuthenticationPropertyName(Adopt, JSStringCreateWithUTF8CString("acceptAuthentication"));
+ JSValueRef acceptAuthenticationValue = JSObjectGetProperty(context, local, acceptAuthenticationPropertyName.get(), 0);
+ if (!JSValueIsBoolean(context, acceptAuthenticationValue))
+ return;
+ bool acceptAuthentication = JSValueToBoolean(context, acceptAuthenticationValue);
- JSRetainPtr<JSStringRef> acceptAttestationPropertyName(Adopt, JSStringCreateWithUTF8CString("acceptAttestation"));
- JSValueRef acceptAttestationValue = JSObjectGetProperty(context, local, acceptAttestationPropertyName.get(), 0);
- if (!JSValueIsBoolean(context, acceptAttestationValue))
- return;
- bool acceptAttestation = JSValueToBoolean(context, acceptAttestationValue);
+ JSRetainPtr<JSStringRef> acceptAttestationPropertyName(Adopt, JSStringCreateWithUTF8CString("acceptAttestation"));
+ JSValueRef acceptAttestationValue = JSObjectGetProperty(context, local, acceptAttestationPropertyName.get(), 0);
+ if (!JSValueIsBoolean(context, acceptAttestationValue))
+ return;
+ bool acceptAttestation = JSValueToBoolean(context, acceptAttestationValue);
- JSRetainPtr<JSStringRef> privateKeyBase64PropertyName(Adopt, JSStringCreateWithUTF8CString("privateKeyBase64"));
- JSValueRef privateKeyBase64Value = JSObjectGetProperty(context, local, privateKeyBase64PropertyName.get(), 0);
- if (!JSValueIsString(context, privateKeyBase64Value))
- return;
+ JSRetainPtr<JSStringRef> privateKeyBase64PropertyName(Adopt, JSStringCreateWithUTF8CString("privateKeyBase64"));
+ JSValueRef privateKeyBase64Value = JSObjectGetProperty(context, local, privateKeyBase64PropertyName.get(), 0);
+ if (!JSValueIsString(context, privateKeyBase64Value))
+ return;
- Vector<WKRetainPtr<WKStringRef>> localKeys;
- Vector<WKRetainPtr<WKTypeRef>> localValues;
- localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("AcceptAuthentication") });
- localValues.append(adoptWK(WKBooleanCreate(acceptAuthentication)).get());
- localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("AcceptAttestation") });
- localValues.append(adoptWK(WKBooleanCreate(acceptAttestation)).get());
- localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("PrivateKeyBase64") });
- localValues.append(toWK(adopt(JSValueToStringCopy(context, privateKeyBase64Value, 0)).get()));
+ Vector<WKRetainPtr<WKStringRef>> localKeys;
+ Vector<WKRetainPtr<WKTypeRef>> localValues;
+ localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("AcceptAuthentication") });
+ localValues.append(adoptWK(WKBooleanCreate(acceptAuthentication)).get());
+ localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("AcceptAttestation") });
+ localValues.append(adoptWK(WKBooleanCreate(acceptAttestation)).get());
+ localKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("PrivateKeyBase64") });
+ localValues.append(toWK(adopt(JSValueToStringCopy(context, privateKeyBase64Value, 0)).get()));
- Vector<WKStringRef> rawLocalKeys;
- Vector<WKTypeRef> rawLocalValues;
- rawLocalKeys.resize(localKeys.size());
- rawLocalValues.resize(localValues.size());
- for (size_t i = 0; i < localKeys.size(); ++i) {
- rawLocalKeys[i] = localKeys[i].get();
- rawLocalValues[i] = localValues[i].get();
+ Vector<WKStringRef> rawLocalKeys;
+ Vector<WKTypeRef> rawLocalValues;
+ rawLocalKeys.resize(localKeys.size());
+ rawLocalValues.resize(localValues.size());
+ for (size_t i = 0; i < localKeys.size(); ++i) {
+ rawLocalKeys[i] = localKeys[i].get();
+ rawLocalValues[i] = localValues[i].get();
+ }
+
+ configurationKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("Local") });
+ configurationValues.append({ AdoptWK, WKDictionaryCreate(rawLocalKeys.data(), rawLocalValues.data(), rawLocalKeys.size()) });
}
- Vector<WKRetainPtr<WKStringRef>> configurationKeys;
- Vector<WKRetainPtr<WKTypeRef>> configurationValues;
- configurationKeys.append({ AdoptWK, WKStringCreateWithUTF8CString("Local") });
- configurationValues.append({ AdoptWK, WKDictionaryCreate(rawLocalKeys.data(), rawLocalValues.data(), rawLocalKeys.size()) });
-
Vector<WKStringRef> rawConfigurationKeys;
Vector<WKTypeRef> rawConfigurationValues;
rawConfigurationKeys.resize(configurationKeys.size());