Changeset 257954 in webkit


Ignore:
Timestamp:
Mar 5, 2020 3:58:10 PM (4 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebAuthn] Implement SPI -[_WKWebAuthenticationPanelDelegate panel:selectAssertionResponse:source:completionHandler:]
https://bugs.webkit.org/show_bug.cgi?id=208626
<rdar://problem/60074148>

Reviewed by Brent Fulgham.

Source/WebKit:

The patch adds a parameter (source) to the original SPI such that clients can know where those responses are from.
Besides that this patch also changes the completionHandler to accept a pointer instead of a reference such that clients
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
always return the first item.

  • UIProcess/API/APIWebAuthenticationAssertionResponse.h:
  • UIProcess/API/APIWebAuthenticationPanelClient.h:

(API::WebAuthenticationPanelClient::selectAssertionResponse const):

  • UIProcess/API/C/WKPage.cpp:

(WKPageSetPageUIClient):

  • UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
  • UIProcess/WebAuthentication/Authenticator.h:
  • UIProcess/WebAuthentication/AuthenticatorManager.cpp:

(WebKit::AuthenticatorManager::selectAssertionResponse):

  • UIProcess/WebAuthentication/AuthenticatorManager.h:
  • UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:

(WebKit::LocalAuthenticator::getAssertion):

  • UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
  • UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:

(WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
(WebKit::wkWebAuthenticationSource):
(WebKit::WebAuthenticationPanelClient::selectAssertionResponse const):

  • UIProcess/WebAuthentication/WebAuthenticationFlags.h:
  • UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:

(WebKit::CtapAuthenticator::continueGetNextAssertionAfterResponseReceived):

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:

(-[TestWebAuthenticationPanelDelegate panel:selectAssertionResponse:source:completionHandler:]):
(TestWebKitAPI::TEST):
(-[TestWebAuthenticationPanelDelegate panel:selectAssertionResponse:completionHandler:]): Deleted.

  • TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-hid-multiple-accounts.html:
  • TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-la.html: Added.
Location:
trunk
Files:
1 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r257953 r257954  
     12020-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
    1352020-03-05  Chris Dumez  <cdumez@apple.com>
    236
  • trunk/Source/WebKit/UIProcess/API/APIWebAuthenticationAssertionResponse.h

    r254554 r257954  
    4444    RefPtr<Data> userHandle() const;
    4545
    46     const WebCore::AuthenticatorAssertionResponse& response() { return m_response.get(); }
     46    WebCore::AuthenticatorAssertionResponse* response() { return m_response.ptr(); }
    4747
    4848private:
  • trunk/Source/WebKit/UIProcess/API/APIWebAuthenticationPanelClient.h

    r257877 r257954  
    5151    virtual void dismissPanel(WebKit::WebAuthenticationResult) const { }
    5252    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); }
    5454    virtual void decidePolicyForLocalAuthenticator(CompletionHandler<void(WebKit::LocalAuthenticatorPolicy)>&& completionHandler) const { completionHandler(WebKit::LocalAuthenticatorPolicy::Disallow); }
    5555};
  • trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r257877 r257954  
    20842084        void runWebAuthenticationPanel(WebPageProxy&, API::WebAuthenticationPanel& panel, WebFrameProxy&, FrameInfoData&&, CompletionHandler<void(WebKit::WebAuthenticationPanelResult)>&& completionHandler) final
    20852085        {
    2086             class PanelClient : public API::WebAuthenticationPanelClient {
     2086            class PanelClient final : public API::WebAuthenticationPanelClient {
    20872087            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                }
    20892098            };
    20902099
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h

    r257877 r257954  
    7474} WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    7575
     76typedef NS_ENUM(NSInteger, _WKWebAuthenticationSource) {
     77    _WKWebAuthenticationSourceLocal,
     78    _WKWebAuthenticationSourceExternal,
     79} WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
     80
    7681@protocol _WKWebAuthenticationPanelDelegate <NSObject>
    7782
     
    8186- (void)panel:(_WKWebAuthenticationPanel *)panel dismissWebAuthenticationPanelWithResult:(_WKWebAuthenticationResult)result WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    8287- (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));
    8489- (void)panel:(_WKWebAuthenticationPanel *)panel decidePolicyForLocalAuthenticatorWithCompletionHandler:(void (^)(_WKLocalAuthenticatorPolicy policy))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    8590
  • trunk/Source/WebKit/UIProcess/WebAuthentication/Authenticator.h

    r257877 r257954  
    5656        virtual void authenticatorStatusUpdated(WebAuthenticationStatus) = 0;
    5757        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;
    5959        virtual void decidePolicyForLocalAuthenticator(CompletionHandler<void(LocalAuthenticatorPolicy)>&&) = 0;
    6060    };
  • trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp

    r257877 r257954  
    284284}
    285285
    286 void AuthenticatorManager::selectAssertionResponse(const HashSet<Ref<AuthenticatorAssertionResponse>>& responses, CompletionHandler<void(const AuthenticatorAssertionResponse&)>&& completionHandler)
     286void AuthenticatorManager::selectAssertionResponse(const HashSet<Ref<AuthenticatorAssertionResponse>>& responses, WebAuthenticationSource source, CompletionHandler<void(AuthenticatorAssertionResponse*)>&& completionHandler)
    287287{
    288288    Vector<Ref<AuthenticatorAssertionResponse>> responseVector;
     
    291291        responseVector.uncheckedAppend(response.copyRef());
    292292
    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));
    295295    });
    296296}
  • trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h

    r257877 r257954  
    8383    void authenticatorStatusUpdated(WebAuthenticationStatus) final;
    8484    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;
    8686    void decidePolicyForLocalAuthenticator(CompletionHandler<void(LocalAuthenticatorPolicy)>&&) final;
    8787
  • trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm

    r257877 r257954  
    424424
    425425    if (auto* observer = this->observer()) {
    426         auto callback = [this, weakThis = makeWeakPtr(*this)] (const AuthenticatorAssertionResponse& response) {
     426        auto callback = [this, weakThis = makeWeakPtr(*this)] (AuthenticatorAssertionResponse* response) {
    427427            ASSERT(RunLoop::isMain());
    428428            if (!weakThis)
    429429                return;
    430430
    431             auto returnResponse = m_assertionResponses.take(const_cast<AuthenticatorAssertionResponse*>(&response));
     431            auto returnResponse = m_assertionResponses.take(response);
    432432            if (!returnResponse)
    433433                return;
    434434            continueGetAssertionAfterResponseSelected(WTFMove(*returnResponse));
    435435        };
    436         observer->selectAssertionResponse(m_assertionResponses, WTFMove(callback));
     436        observer->selectAssertionResponse(m_assertionResponses, WebAuthenticationSource::Local, WTFMove(callback));
    437437    }
    438438}
  • trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h

    r257877 r257954  
    5050    void dismissPanel(WebAuthenticationResult) const final;
    5151    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;
    5353    void decidePolicyForLocalAuthenticator(CompletionHandler<void(LocalAuthenticatorPolicy)>&&) const final;
    5454
     
    6060        bool panelDismissWebAuthenticationPanelWithResult : 1;
    6161        bool panelRequestPinWithRemainingRetriesCompletionHandler : 1;
    62         bool panelSelectAssertionResponseCompletionHandler : 1;
     62        bool panelSelectAssertionResponseSourceCompletionHandler : 1;
    6363        bool panelDecidePolicyForLocalAuthenticatorCompletionHandler : 1;
    6464    } m_delegateMethods;
  • trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm

    r257877 r257954  
    4949    m_delegateMethods.panelDismissWebAuthenticationPanelWithResult = [delegate respondsToSelector:@selector(panel:dismissWebAuthenticationPanelWithResult:)];
    5050    m_delegateMethods.panelRequestPinWithRemainingRetriesCompletionHandler = [delegate respondsToSelector:@selector(panel:requestPINWithRemainingRetries:completionHandler:)];
    51     m_delegateMethods.panelSelectAssertionResponseCompletionHandler = [delegate respondsToSelector:@selector(panel:selectAssertionResponse:completionHandler:)];
     51    m_delegateMethods.panelSelectAssertionResponseSourceCompletionHandler = [delegate respondsToSelector:@selector(panel:selectAssertionResponse:source:completionHandler:)];
    5252    m_delegateMethods.panelDecidePolicyForLocalAuthenticatorCompletionHandler = [delegate respondsToSelector:@selector(panel:decidePolicyForLocalAuthenticatorWithCompletionHandler:)];
    5353}
     
    138138}
    139139
    140 void WebAuthenticationPanelClient::selectAssertionResponse(Vector<Ref<WebCore::AuthenticatorAssertionResponse>>&& responses, CompletionHandler<void(const WebCore::AuthenticatorAssertionResponse&)>&& completionHandler) const
     140static _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
     152void WebAuthenticationPanelClient::selectAssertionResponse(Vector<Ref<WebCore::AuthenticatorAssertionResponse>>&& responses, WebAuthenticationSource source, CompletionHandler<void(WebCore::AuthenticatorAssertionResponse*)>&& completionHandler) const
    141153{
    142154    ASSERT(!responses.isEmpty());
    143155
    144     if (!m_delegateMethods.panelSelectAssertionResponseCompletionHandler) {
    145         completionHandler(responses[0]);
     156    if (!m_delegateMethods.panelSelectAssertionResponseSourceCompletionHandler) {
     157        completionHandler(nullptr);
    146158        return;
    147159    }
     
    149161    auto delegate = m_delegate.get();
    150162    if (!delegate) {
    151         completionHandler(responses[0]);
     163        completionHandler(nullptr);
    152164        return;
    153165    }
     
    158170        apiResponses.uncheckedAppend(API::WebAuthenticationAssertionResponse::create(response.copyRef()));
    159171
    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 {
    162174        if (checker->completionHandlerHasBeenCalled())
    163175            return;
    164176        checker->didCallCompletionHandler();
     177
     178        if (!response) {
     179            completionHandler(nullptr);
     180            return;
     181        }
    165182        completionHandler(static_cast<API::WebAuthenticationAssertionResponse&>([response _apiObject]).response());
    166183    }).get()];
  • trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationFlags.h

    r257877 r257954  
    5757};
    5858
     59enum class WebAuthenticationSource : bool {
     60    Local,
     61    External
     62};
     63
    5964} // namespace WebKit
    6065
  • trunk/Source/WebKit/UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp

    r256062 r257954  
    198198    if (!m_remainingAssertionResponses) {
    199199        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) {
    201201                ASSERT(RunLoop::isMain());
    202202                if (!weakThis)
    203203                    return;
    204                 auto returnResponse = m_assertionResponses.take(const_cast<AuthenticatorAssertionResponse*>(&response));
     204                auto returnResponse = m_assertionResponses.take(response);
    205205                if (!returnResponse)
    206206                    return;
  • trunk/Tools/ChangeLog

    r257939 r257954  
     12020-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
    1172020-03-05  Antoine Quint  <graouts@apple.com>
    218
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r257892 r257954  
    346346                572B403421769A88000AD43E /* CtapRequestTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572B403321769A88000AD43E /* CtapRequestTest.cpp */; };
    347347                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 */; };
    348349                57303BC9200824D300355965 /* CBORValueTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57303BAC2006C56000355965 /* CBORValueTest.cpp */; };
    349350                57303BCA20082C0100355965 /* CBORWriterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57303BAB2006C55400355965 /* CBORWriterTest.cpp */; };
     
    15301531                                570D26FC23C3F87000D5CF67 /* web-authentication-get-assertion-hid-pin.html in Copy Resources */,
    15311532                                57663DEC234F1F9300E85E09 /* web-authentication-get-assertion-hid.html in Copy Resources */,
     1533                                572CEF71240F874700C412A2 /* web-authentication-get-assertion-la.html in Copy Resources */,
    15321534                                579833922368FA37008E5547 /* web-authentication-get-assertion-nfc-multiple-tags.html in Copy Resources */,
    15331535                                57663DEA234EA66D00E85E09 /* web-authentication-get-assertion-nfc.html in Copy Resources */,
     
    19731975                572B40352176A029000AD43E /* FidoTestData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FidoTestData.h; sourceTree = "<group>"; };
    19741976                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>"; };
    19751978                57303BAB2006C55400355965 /* CBORWriterTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORWriterTest.cpp; sourceTree = "<group>"; };
    19761979                57303BAC2006C56000355965 /* CBORValueTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBORValueTest.cpp; sourceTree = "<group>"; };
     
    36153618                                570D26FB23C3F86500D5CF67 /* web-authentication-get-assertion-hid-pin.html */,
    36163619                                57663DEB234F1F8000E85E09 /* web-authentication-get-assertion-hid.html */,
     3620                                572CEF70240F86AE00C412A2 /* web-authentication-get-assertion-la.html */,
    36173621                                5798337B235EB65C008E5547 /* web-authentication-get-assertion-nfc-multiple-tags.html */,
    36183622                                57663DE9234EA60B00E85E09 /* web-authentication-get-assertion-nfc.html */,
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm

    r257877 r257954  
    133133}
    134134
    135 - (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler
     135- (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses source:(_WKWebAuthenticationSource)source completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler
    136136{
    137137    if (responses.count == 1) {
     
    140140    }
    141141
     142    EXPECT_EQ(source, _WKWebAuthenticationSourceExternal);
    142143    EXPECT_EQ(responses.count, 2ul);
    143144    for (_WKWebAuthenticationAssertionResponse *response in responses) {
     
    11601161
    11611162    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
    1162     [webView waitForMessage:@"Succeeded!"];
     1163    [webView waitForMessage:@"Operation timed out."];
    11631164}
    11641165
     
    12921293}
    12931294
     1295TEST(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
    12941315#endif // USE(APPLE_INTERNAL_SDK) || PLATFORM(IOS)
    12951316
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-hid-multiple-accounts.html

    r254554 r257954  
    4242        publicKey: {
    4343            challenge: new Uint8Array(16),
    44             timeout: 1000
     44            timeout: 100
    4545        }
    4646    };
Note: See TracChangeset for help on using the changeset viewer.