Skip to content
Permalink
Browse files
REGRESSION (r294434): [ iOS ] TestWebKitAPI.WebAuthenticationPanel.Ex…
…portImportDuplicateCredential is a consistent failure

https://bugs.webkit.org/show_bug.cgi?id=240686
<rdar://93603762>

Reviewed by Brent Fulgham.

The sync flag may differ at runtime due to internal reasons. This patch modifies the test to support either value
of the flag.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/250966@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pascoej committed May 25, 2022
1 parent d795d91 commit 5624470fa5bf59612c173b7f2a2a0f6f21334ffb
Showing 1 changed file with 9 additions and 1 deletion.
@@ -2285,7 +2285,7 @@ HTTPServer server([parentFrame = String(parentFrame), subFrame = String(subFrame
reset();
cleanUpKeychain(emptyString());

addKeyToKeychain(testES256PrivateKeyBase64, "example.com"_s, testUserEntityBundleBase64, true /* synchronized */);
addKeyToKeychain(testES256PrivateKeyBase64, "example.com"_s, testUserEntityBundleBase64);

auto *credentials = [_WKWebAuthenticationPanel getAllLocalAuthenticatorCredentialsWithAccessGroup:testWebKitAPIAccessGroup];
EXPECT_NOT_NULL(credentials);
@@ -2294,8 +2294,16 @@ HTTPServer server([parentFrame = String(parentFrame), subFrame = String(subFrame
EXPECT_NOT_NULL([credentials firstObject]);
NSError *error = nil;
auto exportedKey = [_WKWebAuthenticationPanel exportLocalAuthenticatorCredentialWithID:[credentials firstObject][_WKLocalAuthenticatorCredentialIDKey] error:&error];
cleanUpKeychain("example.com"_s);

auto credentialId = [_WKWebAuthenticationPanel importLocalAuthenticatorWithAccessGroup:testWebKitAPIAccessGroup credential:exportedKey error:&error];

credentials = [_WKWebAuthenticationPanel getAllLocalAuthenticatorCredentialsWithAccessGroup:testWebKitAPIAccessGroup];
EXPECT_NOT_NULL(credentials);
EXPECT_EQ([credentials count], 1lu);
addKeyToKeychain(testES256PrivateKeyBase64, "example.com"_s, testUserEntityBundleBase64, [credentials firstObject][_WKLocalAuthenticatorCredentialSynchronizableKey]);

credentialId = [_WKWebAuthenticationPanel importLocalAuthenticatorWithAccessGroup:testWebKitAPIAccessGroup credential:exportedKey error:&error];
EXPECT_EQ(credentialId, nil);
EXPECT_EQ(error.code, WKErrorDuplicateCredential);

0 comments on commit 5624470

Please sign in to comment.