Changeset 257954 in webkit
- Timestamp:
- Mar 5, 2020 3:58:10 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r257953 r257954 1 2020-03-05 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthn] Implement SPI -[_WKWebAuthenticationPanelDelegate panel:selectAssertionResponse:source:completionHandler:] 4 https://bugs.webkit.org/show_bug.cgi?id=208626 5 <rdar://problem/60074148> 6 7 Reviewed by Brent Fulgham. 8 9 The patch adds a parameter (source) to the original SPI such that clients can know where those responses are from. 10 Besides that this patch also changes the completionHandler to accept a pointer instead of a reference such that clients 11 can pass a nullptr as a no op. In order to keep WebKitTestRunner running, the patch then overrides this SPI in the C API to 12 always return the first item. 13 14 * UIProcess/API/APIWebAuthenticationAssertionResponse.h: 15 * UIProcess/API/APIWebAuthenticationPanelClient.h: 16 (API::WebAuthenticationPanelClient::selectAssertionResponse const): 17 * UIProcess/API/C/WKPage.cpp: 18 (WKPageSetPageUIClient): 19 * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: 20 * UIProcess/WebAuthentication/Authenticator.h: 21 * UIProcess/WebAuthentication/AuthenticatorManager.cpp: 22 (WebKit::AuthenticatorManager::selectAssertionResponse): 23 * UIProcess/WebAuthentication/AuthenticatorManager.h: 24 * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: 25 (WebKit::LocalAuthenticator::getAssertion): 26 * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: 27 * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: 28 (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient): 29 (WebKit::wkWebAuthenticationSource): 30 (WebKit::WebAuthenticationPanelClient::selectAssertionResponse const): 31 * UIProcess/WebAuthentication/WebAuthenticationFlags.h: 32 * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: 33 (WebKit::CtapAuthenticator::continueGetNextAssertionAfterResponseReceived): 34 1 35 2020-03-05 Chris Dumez <cdumez@apple.com> 2 36 -
trunk/Source/WebKit/UIProcess/API/APIWebAuthenticationAssertionResponse.h
r254554 r257954 44 44 RefPtr<Data> userHandle() const; 45 45 46 const WebCore::AuthenticatorAssertionResponse& response() { return m_response.get(); }46 WebCore::AuthenticatorAssertionResponse* response() { return m_response.ptr(); } 47 47 48 48 private: -
trunk/Source/WebKit/UIProcess/API/APIWebAuthenticationPanelClient.h
r257877 r257954 51 51 virtual void dismissPanel(WebKit::WebAuthenticationResult) const { } 52 52 virtual void requestPin(uint64_t, CompletionHandler<void(const WTF::String&)>&& completionHandler) const { completionHandler(emptyString()); } 53 virtual void selectAssertionResponse(Vector<Ref<WebCore::AuthenticatorAssertionResponse>>&& responses, CompletionHandler<void(const WebCore::AuthenticatorAssertionResponse&)>&& completionHandler) const { ASSERT(!responses.isEmpty()); completionHandler(responses[0]); }53 virtual void selectAssertionResponse(Vector<Ref<WebCore::AuthenticatorAssertionResponse>>&& responses, WebKit::WebAuthenticationSource, CompletionHandler<void(WebCore::AuthenticatorAssertionResponse*)>&& completionHandler) const { completionHandler(nullptr); } 54 54 virtual void decidePolicyForLocalAuthenticator(CompletionHandler<void(WebKit::LocalAuthenticatorPolicy)>&& completionHandler) const { completionHandler(WebKit::LocalAuthenticatorPolicy::Disallow); } 55 55 }; -
trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp
r257877 r257954 2084 2084 void runWebAuthenticationPanel(WebPageProxy&, API::WebAuthenticationPanel& panel, WebFrameProxy&, FrameInfoData&&, CompletionHandler<void(WebKit::WebAuthenticationPanelResult)>&& completionHandler) final 2085 2085 { 2086 class PanelClient : public API::WebAuthenticationPanelClient {2086 class PanelClient final : public API::WebAuthenticationPanelClient { 2087 2087 public: 2088 void decidePolicyForLocalAuthenticator(CompletionHandler<void(WebKit::LocalAuthenticatorPolicy)>&& completionHandler) const { completionHandler(WebKit::LocalAuthenticatorPolicy::Allow); } 2088 void selectAssertionResponse(Vector<Ref<WebCore::AuthenticatorAssertionResponse>>&& responses, WebKit::WebAuthenticationSource, CompletionHandler<void(WebCore::AuthenticatorAssertionResponse*)>&& completionHandler) const final 2089 { 2090 ASSERT(!responses.isEmpty()); 2091 completionHandler(responses[0].ptr()); 2092 } 2093 2094 void decidePolicyForLocalAuthenticator(CompletionHandler<void(WebKit::LocalAuthenticatorPolicy)>&& completionHandler) const final 2095 { 2096 completionHandler(WebKit::LocalAuthenticatorPolicy::Allow); 2097 } 2089 2098 }; 2090 2099 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h
r257877 r257954 74 74 } WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 75 75 76 typedef NS_ENUM(NSInteger, _WKWebAuthenticationSource) { 77 _WKWebAuthenticationSourceLocal, 78 _WKWebAuthenticationSourceExternal, 79 } WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 80 76 81 @protocol _WKWebAuthenticationPanelDelegate <NSObject> 77 82 … … 81 86 - (void)panel:(_WKWebAuthenticationPanel *)panel dismissWebAuthenticationPanelWithResult:(_WKWebAuthenticationResult)result WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 82 87 - (void)panel:(_WKWebAuthenticationPanel *)panel requestPINWithRemainingRetries:(NSUInteger)retries completionHandler:(void (^)(NSString *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 83 - (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));88 - (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses source:(_WKWebAuthenticationSource)source completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 84 89 - (void)panel:(_WKWebAuthenticationPanel *)panel decidePolicyForLocalAuthenticatorWithCompletionHandler:(void (^)(_WKLocalAuthenticatorPolicy policy))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 85 90 -
trunk/Source/WebKit/UIProcess/WebAuthentication/Authenticator.h
r257877 r257954 56 56 virtual void authenticatorStatusUpdated(WebAuthenticationStatus) = 0; 57 57 virtual void requestPin(uint64_t retries, CompletionHandler<void(const WTF::String&)>&&) = 0; 58 virtual void selectAssertionResponse(const HashSet<Ref<WebCore::AuthenticatorAssertionResponse>>&, CompletionHandler<void(const WebCore::AuthenticatorAssertionResponse&)>&&) = 0;58 virtual void selectAssertionResponse(const HashSet<Ref<WebCore::AuthenticatorAssertionResponse>>&, WebAuthenticationSource, CompletionHandler<void(WebCore::AuthenticatorAssertionResponse*)>&&) = 0; 59 59 virtual void decidePolicyForLocalAuthenticator(CompletionHandler<void(LocalAuthenticatorPolicy)>&&) = 0; 60 60 }; -
trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp
r257877 r257954 284 284 } 285 285 286 void AuthenticatorManager::selectAssertionResponse(const HashSet<Ref<AuthenticatorAssertionResponse>>& responses, CompletionHandler<void(const AuthenticatorAssertionResponse&)>&& completionHandler)286 void AuthenticatorManager::selectAssertionResponse(const HashSet<Ref<AuthenticatorAssertionResponse>>& responses, WebAuthenticationSource source, CompletionHandler<void(AuthenticatorAssertionResponse*)>&& completionHandler) 287 287 { 288 288 Vector<Ref<AuthenticatorAssertionResponse>> responseVector; … … 291 291 responseVector.uncheckedAppend(response.copyRef()); 292 292 293 dispatchPanelClientCall([responses = WTFMove(responseVector), completionHandler = WTFMove(completionHandler)] (const API::WebAuthenticationPanel& panel) mutable {294 panel.client().selectAssertionResponse(WTFMove(responses), WTFMove(completionHandler));293 dispatchPanelClientCall([responses = WTFMove(responseVector), source, completionHandler = WTFMove(completionHandler)] (const API::WebAuthenticationPanel& panel) mutable { 294 panel.client().selectAssertionResponse(WTFMove(responses), source, WTFMove(completionHandler)); 295 295 }); 296 296 } -
trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h
r257877 r257954 83 83 void authenticatorStatusUpdated(WebAuthenticationStatus) final; 84 84 void requestPin(uint64_t retries, CompletionHandler<void(const WTF::String&)>&&) final; 85 void selectAssertionResponse(const HashSet<Ref<WebCore::AuthenticatorAssertionResponse>>&, CompletionHandler<void(const WebCore::AuthenticatorAssertionResponse&)>&&) final;85 void selectAssertionResponse(const HashSet<Ref<WebCore::AuthenticatorAssertionResponse>>&, WebAuthenticationSource, CompletionHandler<void(WebCore::AuthenticatorAssertionResponse*)>&&) final; 86 86 void decidePolicyForLocalAuthenticator(CompletionHandler<void(LocalAuthenticatorPolicy)>&&) final; 87 87 -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm
r257877 r257954 424 424 425 425 if (auto* observer = this->observer()) { 426 auto callback = [this, weakThis = makeWeakPtr(*this)] ( const AuthenticatorAssertionResponse&response) {426 auto callback = [this, weakThis = makeWeakPtr(*this)] (AuthenticatorAssertionResponse* response) { 427 427 ASSERT(RunLoop::isMain()); 428 428 if (!weakThis) 429 429 return; 430 430 431 auto returnResponse = m_assertionResponses.take( const_cast<AuthenticatorAssertionResponse*>(&response));431 auto returnResponse = m_assertionResponses.take(response); 432 432 if (!returnResponse) 433 433 return; 434 434 continueGetAssertionAfterResponseSelected(WTFMove(*returnResponse)); 435 435 }; 436 observer->selectAssertionResponse(m_assertionResponses, W TFMove(callback));436 observer->selectAssertionResponse(m_assertionResponses, WebAuthenticationSource::Local, WTFMove(callback)); 437 437 } 438 438 } -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h
r257877 r257954 50 50 void dismissPanel(WebAuthenticationResult) const final; 51 51 void requestPin(uint64_t, CompletionHandler<void(const WTF::String&)>&&) const final; 52 void selectAssertionResponse(Vector<Ref<WebCore::AuthenticatorAssertionResponse>>&&, CompletionHandler<void(const WebCore::AuthenticatorAssertionResponse&)>&&) const final;52 void selectAssertionResponse(Vector<Ref<WebCore::AuthenticatorAssertionResponse>>&&, WebAuthenticationSource, CompletionHandler<void(WebCore::AuthenticatorAssertionResponse*)>&&) const final; 53 53 void decidePolicyForLocalAuthenticator(CompletionHandler<void(LocalAuthenticatorPolicy)>&&) const final; 54 54 … … 60 60 bool panelDismissWebAuthenticationPanelWithResult : 1; 61 61 bool panelRequestPinWithRemainingRetriesCompletionHandler : 1; 62 bool panelSelectAssertionResponse CompletionHandler : 1;62 bool panelSelectAssertionResponseSourceCompletionHandler : 1; 63 63 bool panelDecidePolicyForLocalAuthenticatorCompletionHandler : 1; 64 64 } m_delegateMethods; -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm
r257877 r257954 49 49 m_delegateMethods.panelDismissWebAuthenticationPanelWithResult = [delegate respondsToSelector:@selector(panel:dismissWebAuthenticationPanelWithResult:)]; 50 50 m_delegateMethods.panelRequestPinWithRemainingRetriesCompletionHandler = [delegate respondsToSelector:@selector(panel:requestPINWithRemainingRetries:completionHandler:)]; 51 m_delegateMethods.panelSelectAssertionResponse CompletionHandler = [delegate respondsToSelector:@selector(panel:selectAssertionResponse:completionHandler:)];51 m_delegateMethods.panelSelectAssertionResponseSourceCompletionHandler = [delegate respondsToSelector:@selector(panel:selectAssertionResponse:source:completionHandler:)]; 52 52 m_delegateMethods.panelDecidePolicyForLocalAuthenticatorCompletionHandler = [delegate respondsToSelector:@selector(panel:decidePolicyForLocalAuthenticatorWithCompletionHandler:)]; 53 53 } … … 138 138 } 139 139 140 void WebAuthenticationPanelClient::selectAssertionResponse(Vector<Ref<WebCore::AuthenticatorAssertionResponse>>&& responses, CompletionHandler<void(const WebCore::AuthenticatorAssertionResponse&)>&& completionHandler) const 140 static _WKWebAuthenticationSource wkWebAuthenticationSource(WebAuthenticationSource result) 141 { 142 switch (result) { 143 case WebAuthenticationSource::Local: 144 return _WKWebAuthenticationSourceLocal; 145 case WebAuthenticationSource::External: 146 return _WKWebAuthenticationSourceExternal; 147 } 148 ASSERT_NOT_REACHED(); 149 return _WKWebAuthenticationSourceLocal; 150 } 151 152 void WebAuthenticationPanelClient::selectAssertionResponse(Vector<Ref<WebCore::AuthenticatorAssertionResponse>>&& responses, WebAuthenticationSource source, CompletionHandler<void(WebCore::AuthenticatorAssertionResponse*)>&& completionHandler) const 141 153 { 142 154 ASSERT(!responses.isEmpty()); 143 155 144 if (!m_delegateMethods.panelSelectAssertionResponse CompletionHandler) {145 completionHandler( responses[0]);156 if (!m_delegateMethods.panelSelectAssertionResponseSourceCompletionHandler) { 157 completionHandler(nullptr); 146 158 return; 147 159 } … … 149 161 auto delegate = m_delegate.get(); 150 162 if (!delegate) { 151 completionHandler( responses[0]);163 completionHandler(nullptr); 152 164 return; 153 165 } … … 158 170 apiResponses.uncheckedAppend(API::WebAuthenticationAssertionResponse::create(response.copyRef())); 159 171 160 auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(panel:selectAssertionResponse: completionHandler:));161 [delegate panel:m_panel selectAssertionResponse:wrapper(API::Array::create(WTFMove(apiResponses))) completionHandler:makeBlockPtr([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)](_WKWebAuthenticationAssertionResponse *response) mutable {172 auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(panel:selectAssertionResponse:source:completionHandler:)); 173 [delegate panel:m_panel selectAssertionResponse:wrapper(API::Array::create(WTFMove(apiResponses))) source:wkWebAuthenticationSource(source) completionHandler:makeBlockPtr([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)](_WKWebAuthenticationAssertionResponse *response) mutable { 162 174 if (checker->completionHandlerHasBeenCalled()) 163 175 return; 164 176 checker->didCallCompletionHandler(); 177 178 if (!response) { 179 completionHandler(nullptr); 180 return; 181 } 165 182 completionHandler(static_cast<API::WebAuthenticationAssertionResponse&>([response _apiObject]).response()); 166 183 }).get()]; -
trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationFlags.h
r257877 r257954 57 57 }; 58 58 59 enum class WebAuthenticationSource : bool { 60 Local, 61 External 62 }; 63 59 64 } // namespace WebKit 60 65 -
trunk/Source/WebKit/UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp
r256062 r257954 198 198 if (!m_remainingAssertionResponses) { 199 199 if (auto* observer = this->observer()) { 200 observer->selectAssertionResponse(m_assertionResponses, [this, weakThis = makeWeakPtr(*this)] (const AuthenticatorAssertionResponse&response) {200 observer->selectAssertionResponse(m_assertionResponses, WebAuthenticationSource::External, [this, weakThis = makeWeakPtr(*this)] (AuthenticatorAssertionResponse* response) { 201 201 ASSERT(RunLoop::isMain()); 202 202 if (!weakThis) 203 203 return; 204 auto returnResponse = m_assertionResponses.take( const_cast<AuthenticatorAssertionResponse*>(&response));204 auto returnResponse = m_assertionResponses.take(response); 205 205 if (!returnResponse) 206 206 return; -
trunk/Tools/ChangeLog
r257939 r257954 1 2020-03-05 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthn] Implement SPI -[_WKWebAuthenticationPanelDelegate panel:selectAssertionResponse:source:completionHandler:] 4 https://bugs.webkit.org/show_bug.cgi?id=208626 5 <rdar://problem/60074148> 6 7 Reviewed by Brent Fulgham. 8 9 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 10 * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: 11 (-[TestWebAuthenticationPanelDelegate panel:selectAssertionResponse:source:completionHandler:]): 12 (TestWebKitAPI::TEST): 13 (-[TestWebAuthenticationPanelDelegate panel:selectAssertionResponse:completionHandler:]): Deleted. 14 * TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-hid-multiple-accounts.html: 15 * TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-la.html: Added. 16 1 17 2020-03-05 Antoine Quint <graouts@apple.com> 2 18 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r257892 r257954 346 346 572B403421769A88000AD43E /* CtapRequestTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572B403321769A88000AD43E /* CtapRequestTest.cpp */; }; 347 347 572B404421781B43000AD43E /* CtapResponseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572B404321781B42000AD43E /* CtapResponseTest.cpp */; }; 348 572CEF71240F874700C412A2 /* web-authentication-get-assertion-la.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 572CEF70240F86AE00C412A2 /* web-authentication-get-assertion-la.html */; }; 348 349 57303BC9200824D300355965 /* CBORValueTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57303BAC2006C56000355965 /* CBORValueTest.cpp */; }; 349 350 57303BCA20082C0100355965 /* CBORWriterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57303BAB2006C55400355965 /* CBORWriterTest.cpp */; }; … … 1530 1531 570D26FC23C3F87000D5CF67 /* web-authentication-get-assertion-hid-pin.html in Copy Resources */, 1531 1532 57663DEC234F1F9300E85E09 /* web-authentication-get-assertion-hid.html in Copy Resources */, 1533 572CEF71240F874700C412A2 /* web-authentication-get-assertion-la.html in Copy Resources */, 1532 1534 579833922368FA37008E5547 /* web-authentication-get-assertion-nfc-multiple-tags.html in Copy Resources */, 1533 1535 57663DEA234EA66D00E85E09 /* web-authentication-get-assertion-nfc.html in Copy Resources */, … … 1973 1975 572B40352176A029000AD43E /* FidoTestData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FidoTestData.h; sourceTree = "<group>"; }; 1974 1976 572B404321781B42000AD43E /* CtapResponseTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CtapResponseTest.cpp; sourceTree = "<group>"; }; 1977 572CEF70240F86AE00C412A2 /* web-authentication-get-assertion-la.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "web-authentication-get-assertion-la.html"; sourceTree = "<group>"; }; 1975 1978 57303BAB2006C55400355965 /* CBORWriterTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORWriterTest.cpp; sourceTree = "<group>"; }; 1976 1979 57303BAC2006C56000355965 /* CBORValueTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORValueTest.cpp; sourceTree = "<group>"; }; … … 3615 3618 570D26FB23C3F86500D5CF67 /* web-authentication-get-assertion-hid-pin.html */, 3616 3619 57663DEB234F1F8000E85E09 /* web-authentication-get-assertion-hid.html */, 3620 572CEF70240F86AE00C412A2 /* web-authentication-get-assertion-la.html */, 3617 3621 5798337B235EB65C008E5547 /* web-authentication-get-assertion-nfc-multiple-tags.html */, 3618 3622 57663DE9234EA60B00E85E09 /* web-authentication-get-assertion-nfc.html */, -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm
r257877 r257954 133 133 } 134 134 135 - (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler135 - (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses source:(_WKWebAuthenticationSource)source completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler 136 136 { 137 137 if (responses.count == 1) { … … 140 140 } 141 141 142 EXPECT_EQ(source, _WKWebAuthenticationSourceExternal); 142 143 EXPECT_EQ(responses.count, 2ul); 143 144 for (_WKWebAuthenticationAssertionResponse *response in responses) { … … 1160 1161 1161 1162 [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]]; 1162 [webView waitForMessage:@" Succeeded!"];1163 [webView waitForMessage:@"Operation timed out."]; 1163 1164 } 1164 1165 … … 1292 1293 } 1293 1294 1295 TEST(WebAuthenticationPanel, LAGetAssertion) 1296 { 1297 reset(); 1298 RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"web-authentication-get-assertion-la" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]; 1299 1300 auto *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"WebProcessPlugInWithInternals" configureJSCForTesting:YES]; 1301 [[configuration preferences] _setEnabled:YES forExperimentalFeature:webAuthenticationExperimentalFeature()]; 1302 [[configuration preferences] _setEnabled:YES forExperimentalFeature:webAuthenticationLocalAuthenticatorExperimentalFeature()]; 1303 1304 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSZeroRect configuration:configuration]); 1305 auto delegate = adoptNS([[TestWebAuthenticationPanelUIDelegate alloc] init]); 1306 [webView setUIDelegate:delegate.get()]; 1307 1308 ASSERT_TRUE(addKeyToKeychain(testES256PrivateKeyBase64, "", testUserhandleBase64)); 1309 [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]]; 1310 [webView waitForMessage:@"Succeeded!"]; 1311 checkPanel([delegate panel], @"", @[adoptNS([[NSNumber alloc] initWithInt:_WKWebAuthenticationTransportUSB]).get(), adoptNS([[NSNumber alloc] initWithInt:_WKWebAuthenticationTransportInternal]).get()], _WKWebAuthenticationTypeGet); 1312 cleanUpKeychain(""); 1313 } 1314 1294 1315 #endif // USE(APPLE_INTERNAL_SDK) || PLATFORM(IOS) 1295 1316 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-hid-multiple-accounts.html
r254554 r257954 42 42 publicKey: { 43 43 challenge: new Uint8Array(16), 44 timeout: 100 044 timeout: 100 45 45 } 46 46 };
Note: See TracChangeset
for help on using the changeset viewer.