Changeset 246701 in webkit


Ignore:
Timestamp:
Jun 21, 2019 3:47:17 PM (5 years ago)
Author:
jiewen_tan@apple.com
Message:

WebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
https://bugs.webkit.org/show_bug.cgi?id=199114
<rdar://problem/51671674>

Reviewed by Youenn Fablet.

Source/WebCore:

Covered by new test content within existing tests.

  • loader/FrameLoaderTypes.h:

Adds an EnumTraits for ShouldOpenExternalURLsPolicy.

Source/WebKit:

This patch teaches WebPageProxy::loadData to accept ShouldOpenExternalURLsPolicy policy,
and then utilize it in RedirectSOAuthorizationSession. Therefore, the response loaded after
successful interceptions will be able to propagate the same policy from the last navigation
as it were continuous loading.

Besides the above, this patch also fixes some minor issues.

  • Shared/LoadParameters.h:
  • UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm:

(WebKit::NavigationSOAuthorizationSession::shouldStartInternal):
(WebKit::NavigationSOAuthorizationSession::webViewDidMoveToWindow):

  • UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h:
  • UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:

(WebKit::PopUpSOAuthorizationSession::completeInternal):

  • UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.h:
  • UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm:

(WebKit::shouldOpenExternalURLsPolicy):
(WebKit::RedirectSOAuthorizationSession::completeInternal):

  • UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
  • UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:

(WebKit::SOAuthorizationSession::complete):

  • UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
  • UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:

(WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
(WebKit::SubFrameSOAuthorizationSession::completeInternal):
(WebKit::SubFrameSOAuthorizationSession::loadDataToFrame):
(WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigationShared):

  • UIProcess/WebPageProxy.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::loadDataImpl):
(WebKit::WebPage::loadData):

  • WebProcess/WebPage/WebPage.h:

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:

(-[TestSOAuthorizationNavigationDelegate init]):
(-[TestSOAuthorizationNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(configureSOAuthorizationWebView):
(TestWebKitAPI::TEST):

Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246700 r246701  
     12019-06-21  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        WebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
     4        https://bugs.webkit.org/show_bug.cgi?id=199114
     5        <rdar://problem/51671674>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Covered by new test content within existing tests.
     10
     11        * loader/FrameLoaderTypes.h:
     12        Adds an EnumTraits for ShouldOpenExternalURLsPolicy.
     13
    1142019-06-21  Saam Barati  <sbarati@apple.com>
    215
  • trunk/Source/WebCore/loader/FrameLoaderTypes.h

    r244540 r246701  
    220220};
    221221
     222template<> struct EnumTraits<WebCore::ShouldOpenExternalURLsPolicy> {
     223    using values = EnumValues<
     224        WebCore::ShouldOpenExternalURLsPolicy,
     225        WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow,
     226        WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes,
     227        WebCore::ShouldOpenExternalURLsPolicy::ShouldAllow
     228    >;
     229};
     230
    222231} // namespace WTF
  • trunk/Source/WebKit/ChangeLog

    r246697 r246701  
     12019-06-21  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        WebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
     4        https://bugs.webkit.org/show_bug.cgi?id=199114
     5        <rdar://problem/51671674>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        This patch teaches WebPageProxy::loadData to accept ShouldOpenExternalURLsPolicy policy,
     10        and then utilize it in RedirectSOAuthorizationSession. Therefore, the response loaded after
     11        successful interceptions will be able to propagate the same policy from the last navigation
     12        as it were continuous loading.
     13
     14        Besides the above, this patch also fixes some minor issues.
     15
     16        * Shared/LoadParameters.h:
     17        * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm:
     18        (WebKit::NavigationSOAuthorizationSession::shouldStartInternal):
     19        (WebKit::NavigationSOAuthorizationSession::webViewDidMoveToWindow):
     20        * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h:
     21        * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:
     22        (WebKit::PopUpSOAuthorizationSession::completeInternal):
     23        * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.h:
     24        * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm:
     25        (WebKit::shouldOpenExternalURLsPolicy):
     26        (WebKit::RedirectSOAuthorizationSession::completeInternal):
     27        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
     28        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
     29        (WebKit::SOAuthorizationSession::complete):
     30        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
     31        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
     32        (WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
     33        (WebKit::SubFrameSOAuthorizationSession::completeInternal):
     34        (WebKit::SubFrameSOAuthorizationSession::loadDataToFrame):
     35        (WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent):
     36        * UIProcess/WebPageProxy.cpp:
     37        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
     38        (WebKit::WebPageProxy::loadFile):
     39        (WebKit::WebPageProxy::loadData):
     40        (WebKit::WebPageProxy::loadDataWithNavigationShared):
     41        * UIProcess/WebPageProxy.h:
     42        * WebProcess/WebPage/WebPage.cpp:
     43        (WebKit::WebPage::loadDataImpl):
     44        (WebKit::WebPage::loadData):
     45        * WebProcess/WebPage/WebPage.h:
     46
    1472019-06-21  Tim Horton  <timothy_horton@apple.com>
    248
  • trunk/Source/WebKit/Shared/LoadParameters.h

    r239427 r246701  
    6464    Optional<WebsitePoliciesData> websitePolicies;
    6565
    66     uint64_t shouldOpenExternalURLsPolicy;
     66    WebCore::ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy;
    6767    bool shouldTreatAsContinuingLoad { false };
    6868    UserData userData;
  • trunk/Source/WebKit/UIProcess/API/APINavigationAction.h

    r246519 r246701  
    6060    bool shouldPerformDownload() const { return !m_navigationActionData.downloadAttribute.isNull(); }
    6161    bool isRedirect() const { return m_navigationActionData.isRedirect; }
     62    WebCore::ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy() const { return m_navigationActionData.shouldOpenExternalURLsPolicy; }
    6263
    6364    bool isProcessingUserGesture() const { return m_userInitiatedAction; }
  • trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm

    r246514 r246701  
    5050void NavigationSOAuthorizationSession::shouldStartInternal()
    5151{
    52     auto* pagePtr = page();
    53     ASSERT(pagePtr);
     52    auto* page = this->page();
     53    ASSERT(page);
    5454    beforeStart();
    55     if (!pagePtr->isInWindow()) {
     55    if (!page->isInWindow()) {
    5656        setState(State::Waiting);
    57         pagePtr->addObserver(*this);
     57        page->addObserver(*this);
    5858        return;
    5959    }
     
    6363void NavigationSOAuthorizationSession::webViewDidMoveToWindow()
    6464{
    65     auto* pagePtr = page();
    66     if (state() != State::Waiting || !pagePtr || !pagePtr->isInWindow())
     65    auto* page = this->page();
     66    if (state() != State::Waiting || !page || !page->isInWindow())
    6767        return;
    6868    start();
    69     pagePtr->removeObserver(*this);
     69    page->removeObserver(*this);
    7070}
    7171
  • trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h

    r246514 r246701  
    5656    void fallBackToWebPathInternal() final;
    5757    void abortInternal() final;
    58     void completeInternal(WebCore::ResourceResponse&&, NSData *) final;
     58    void completeInternal(const WebCore::ResourceResponse&, NSData *) final;
    5959
    6060    void initSecretWebView();
  • trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm

    r246514 r246701  
    133133}
    134134
    135 void PopUpSOAuthorizationSession::completeInternal(WebCore::ResourceResponse&& response, NSData *data)
     135void PopUpSOAuthorizationSession::completeInternal(const WebCore::ResourceResponse& response, NSData *data)
    136136{
    137137    if (response.httpStatusCode() != 200 || !page()) {
  • trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.h

    r246514 r246701  
    4444    void fallBackToWebPathInternal() final;
    4545    void abortInternal() final;
    46     void completeInternal(WebCore::ResourceResponse&&, NSData *) final;
     46    void completeInternal(const WebCore::ResourceResponse&, NSData *) final;
    4747
    4848    // NavigationSOAuthorizationSession
  • trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm

    r246514 r246701  
    3333
    3434namespace WebKit {
     35using namespace WebCore;
    3536
    3637Ref<SOAuthorizationSession> RedirectSOAuthorizationSession::create(SOAuthorization *soAuthorization, Ref<API::NavigationAction>&& navigationAction, WebPageProxy& page, Callback&& completionHandler)
     
    5455}
    5556
    56 void RedirectSOAuthorizationSession::completeInternal(WebCore::ResourceResponse&& response, NSData *data)
     57void RedirectSOAuthorizationSession::completeInternal(const ResourceResponse& response, NSData *data)
    5758{
    58     auto* pagePtr = page();
    59     if ((response.httpStatusCode() != 302 && response.httpStatusCode() != 200) || !pagePtr) {
     59    auto* navigationAction = this->navigationAction();
     60    ASSERT(navigationAction);
     61    auto* page = this->page();
     62    if ((response.httpStatusCode() != 302 && response.httpStatusCode() != 200) || !page) {
    6063        fallBackToWebPathInternal();
    6164        return;
     
    6467    if (response.httpStatusCode() == 302) {
    6568#if PLATFORM(IOS)
    66         auto* navigationActionPtr = navigationAction();
    67         ASSERT(navigationActionPtr);
    6869        // MobileSafari has a WBSURLSpoofingMitigator, which will not display the provisional URL for navigations without user gestures.
    6970        // For slow loads that are initiated from the MobileSafari Favorites screen, the aforementioned behavior will create a period
     
    7273        // request URL, instead of directly loading a new request. The html page should be super fast to load and therefore will not
    7374        // show an empty URL or a blank page. These changes ensure a relevant URL bar and useful page content during the load.
    74         if (!navigationActionPtr->isProcessingUserGesture()) {
    75             pagePtr->setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision();
    76             auto html = makeString("<script>location = '", response.httpHeaderFields().get(WebCore::HTTPHeaderName::Location), "'</script>").utf8();
     75        if (!navigationAction->isProcessingUserGesture()) {
     76            page->setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision();
     77            auto html = makeString("<script>location = '", response.httpHeaderFields().get(HTTPHeaderName::Location), "'</script>").utf8();
    7778            auto data = IPC::DataReference(reinterpret_cast<const uint8_t*>(html.data()), html.length());
    78             pagePtr->loadData(data, "text/html"_s, "UTF-8"_s, navigationActionPtr->request().url());
     79            page->loadData(data, "text/html"_s, "UTF-8"_s, navigationAction->request().url(), nullptr, navigationAction->shouldOpenExternalURLsPolicy());
    7980            return;
    8081        }
    8182#endif
    82         pagePtr->loadRequest(WebCore::ResourceRequest(response.httpHeaderFields().get(WebCore::HTTPHeaderName::Location)));
     83        page->loadRequest(ResourceRequest(response.httpHeaderFields().get(HTTPHeaderName::Location)));
    8384    }
    8485    if (response.httpStatusCode() == 200) {
    85         pagePtr->setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision();
    86         pagePtr->loadData(IPC::DataReference(static_cast<const uint8_t*>(data.bytes), data.length), "text/html"_s, "UTF-8"_s, response.url().string());
     86        page->setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision();
     87        page->loadData(IPC::DataReference(static_cast<const uint8_t*>(data.bytes), data.length), "text/html"_s, "UTF-8"_s, response.url().string(), nullptr, navigationAction->shouldOpenExternalURLsPolicy());
    8788    }
    8889}
  • trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h

    r246514 r246701  
    9999    virtual void fallBackToWebPathInternal() = 0;
    100100    virtual void abortInternal() = 0;
    101     virtual void completeInternal(WebCore::ResourceResponse&&, NSData *) = 0;
     101    virtual void completeInternal(const WebCore::ResourceResponse&, NSData *) = 0;
    102102
    103103    void becomeCompleted();
  • trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm

    r246514 r246701  
    155155    auto cookies = toCookieVector([NSHTTPCookie cookiesWithResponseHeaderFields:httpResponse.allHeaderFields forURL:response.url()]);
    156156    if (cookies.isEmpty()) {
    157         completeInternal(WTFMove(response), data);
     157        completeInternal(response, data);
    158158        return;
    159159    }
     
    164164        if (!weakThis)
    165165            return;
    166         weakThis->completeInternal(WTFMove(response), data.get());
     166        weakThis->completeInternal(response, data.get());
    167167    });
    168168}
  • trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h

    r246514 r246701  
    4848    void fallBackToWebPathInternal() final;
    4949    void abortInternal() final;
    50     void completeInternal(WebCore::ResourceResponse&&, NSData *) final;
     50    void completeInternal(const WebCore::ResourceResponse&, NSData *) final;
    5151
    5252    // NavigationSOAuthorizationSession
  • trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm

    r246514 r246701  
    6060        if (!weakThis)
    6161            return;
    62         auto* pagePtr = weakThis->page();
     62        auto* page = weakThis->page();
    6363        auto* navigationActionPtr = weakThis->navigationAction();
    64         if (!pagePtr || !navigationActionPtr)
     64        if (!page || !navigationActionPtr)
    6565            return;
    6666
    6767        if (auto* targetFrame = navigationActionPtr->targetFrame()) {
    68             if (auto* frame = pagePtr->process().webFrame(targetFrame->handle().frameID())) {
    69                 pagePtr->setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision();
     68            if (auto* frame = page->process().webFrame(targetFrame->handle().frameID())) {
     69                page->setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision();
    7070                // Issue a new load to the original URL as the original load is aborted before start.
    7171                frame->loadURL(navigationActionPtr->request().url());
     
    8080}
    8181
    82 void SubFrameSOAuthorizationSession::completeInternal(WebCore::ResourceResponse&& response, NSData *data)
     82void SubFrameSOAuthorizationSession::completeInternal(const WebCore::ResourceResponse& response, NSData *data)
    8383{
    8484    if (response.httpStatusCode() != 200) {
     
    104104void SubFrameSOAuthorizationSession::loadDataToFrame(const IPC::DataReference& data, const URL& baseURL)
    105105{
    106     auto* pagePtr = page();
     106    auto* page = this->page();
    107107    auto* navigationActionPtr = navigationAction();
    108     if (!pagePtr || !navigationActionPtr)
     108    if (!page || !navigationActionPtr)
    109109        return;
    110110
    111111    if (auto* targetFrame = navigationActionPtr->targetFrame()) {
    112         if (auto* frame = pagePtr->process().webFrame(targetFrame->handle().frameID())) {
    113             pagePtr->setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision();
     112        if (auto* frame = page->process().webFrame(targetFrame->handle().frameID())) {
     113            page->setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision();
    114114            frame->loadData(data, "text/html", "UTF-8", baseURL);
    115115        }
     
    119119void SubFrameSOAuthorizationSession::postDidCancelMessageToParent(Function<void()>&& callback)
    120120{
    121     auto* pagePtr = page();
     121    auto* page = this->page();
    122122    auto* navigationActionPtr = navigationAction();
    123     if (!pagePtr || !navigationActionPtr)
     123    if (!page || !navigationActionPtr)
    124124        return;
    125125
    126126    if (auto* targetFrame = navigationActionPtr->targetFrame()) {
    127         pagePtr->runJavaScriptInFrame(targetFrame->handle().frameID(), soAuthorizationPostDidCancelMessageToParent, false, [callback = WTFMove(callback)] (API::SerializedScriptValue*, bool, const ExceptionDetails&, ScriptValueCallback::Error) {
     127        page->runJavaScriptInFrame(targetFrame->handle().frameID(), soAuthorizationPostDidCancelMessageToParent, false, [callback = WTFMove(callback)] (API::SerializedScriptValue*, bool, const ExceptionDetails&, ScriptValueCallback::Error) {
    128128            callback();
    129129        });
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r246694 r246701  
    11181118    loadParameters.navigationID = navigation.navigationID();
    11191119    loadParameters.request = WTFMove(request);
    1120     loadParameters.shouldOpenExternalURLsPolicy = (uint64_t)shouldOpenExternalURLsPolicy;
     1120    loadParameters.shouldOpenExternalURLsPolicy = shouldOpenExternalURLsPolicy;
    11211121    loadParameters.userData = UserData(process->transformObjectsToHandles(userData).get());
    11221122    loadParameters.shouldTreatAsContinuingLoad = shouldTreatAsContinuingLoad == ShouldTreatAsContinuingLoad::Yes;
     
    11731173    loadParameters.navigationID = navigation->navigationID();
    11741174    loadParameters.request = fileURL;
    1175     loadParameters.shouldOpenExternalURLsPolicy = (uint64_t)ShouldOpenExternalURLsPolicy::ShouldNotAllow;
     1175    loadParameters.shouldOpenExternalURLsPolicy = ShouldOpenExternalURLsPolicy::ShouldNotAllow;
    11761176    loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get());
    11771177    SandboxExtension::createHandle(resourceDirectoryPath, SandboxExtension::Type::ReadOnly, loadParameters.sandboxExtensionHandle);
     
    11851185}
    11861186
    1187 RefPtr<API::Navigation> WebPageProxy::loadData(const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData)
     1187RefPtr<API::Navigation> WebPageProxy::loadData(const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy)
    11881188{
    11891189    RELEASE_LOG_IF_ALLOWED(Loading, "loadData: webPID = %i, pageID = %" PRIu64, m_process->processIdentifier(), m_pageID.toUInt64());
     
    11981198
    11991199    auto navigation = m_navigationState->createLoadDataNavigation(std::make_unique<API::SubstituteData>(data.vector(), MIMEType, encoding, baseURL, userData));
    1200     loadDataWithNavigationShared(m_process.copyRef(), navigation, data, MIMEType, encoding, baseURL, userData, ShouldTreatAsContinuingLoad::No);
     1200    loadDataWithNavigationShared(m_process.copyRef(), navigation, data, MIMEType, encoding, baseURL, userData, ShouldTreatAsContinuingLoad::No, WTF::nullopt, shouldOpenExternalURLsPolicy);
    12011201    return navigation;
    12021202}
    12031203
    1204 void WebPageProxy::loadDataWithNavigationShared(Ref<WebProcessProxy>&& process, API::Navigation& navigation, const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& websitePolicies)
     1204void WebPageProxy::loadDataWithNavigationShared(Ref<WebProcessProxy>&& process, API::Navigation& navigation, const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& websitePolicies, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy)
    12051205{
    12061206    RELEASE_LOG_IF_ALLOWED(Loading, "loadDataWithNavigation: webPID = %i, pageID = %" PRIu64, process->processIdentifier(), m_pageID.toUInt64());
     
    12211221    loadParameters.userData = UserData(process->transformObjectsToHandles(userData).get());
    12221222    loadParameters.websitePolicies = WTFMove(websitePolicies);
     1223    loadParameters.shouldOpenExternalURLsPolicy = shouldOpenExternalURLsPolicy;
    12231224    addPlatformLoadParameters(loadParameters);
    12241225
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r246694 r246701  
    529529    RefPtr<API::Navigation> loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr);
    530530    RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
    531     RefPtr<API::Navigation> loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
     531    RefPtr<API::Navigation> loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
    532532    void loadAlternateHTML(const IPC::DataReference&, const String& encoding, const URL& baseURL, const URL& unreachableURL, API::Object* userData = nullptr);
    533533    void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
     
    15101510        uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, const String& downloadAttribute, uint64_t listenerID, const UserData&);
    15111511    void startURLSchemeTaskShared(Ref<WebProcessProxy>&&, URLSchemeTaskParameters&&);
    1512     void loadDataWithNavigationShared(Ref<WebProcessProxy>&&, API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt);
     1512    void loadDataWithNavigationShared(Ref<WebProcessProxy>&&, API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
    15131513    void loadRequestWithNavigationShared(Ref<WebProcessProxy>&&, API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& = WTF::nullopt);
    15141514    void backForwardGoToItemShared(Ref<WebProcessProxy>&&, const WebCore::BackForwardItemIdentifier&, CompletionHandler<void(SandboxExtension::Handle&&)>&&);
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r246413 r246701  
    15341534    // Initate the load in WebCore.
    15351535    FrameLoadRequest frameLoadRequest { *m_mainFrame->coreFrame(), loadParameters.request, ShouldOpenExternalURLsPolicy::ShouldNotAllow };
    1536     ShouldOpenExternalURLsPolicy externalURLsPolicy = static_cast<ShouldOpenExternalURLsPolicy>(loadParameters.shouldOpenExternalURLsPolicy);
    1537     frameLoadRequest.setShouldOpenExternalURLsPolicy(externalURLsPolicy);
     1536    frameLoadRequest.setShouldOpenExternalURLsPolicy(loadParameters.shouldOpenExternalURLsPolicy);
    15381537    frameLoadRequest.setShouldTreatAsContinuingLoad(loadParameters.shouldTreatAsContinuingLoad);
    15391538    frameLoadRequest.setLockHistory(loadParameters.lockHistory);
     
    15481547}
    15491548
    1550 void WebPage::loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& websitePolicies, Ref<SharedBuffer>&& sharedBuffer, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& unreachableURL, const UserData& userData)
     1549void WebPage::loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&& websitePolicies, Ref<SharedBuffer>&& sharedBuffer, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& unreachableURL, const UserData& userData, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy)
    15511550{
    15521551    SendStopResponsivenessTimer stopper;
     
    15641563
    15651564    // Initate the load in WebCore.
    1566     FrameLoadRequest frameLoadRequest(*m_mainFrame->coreFrame(), request, ShouldOpenExternalURLsPolicy::ShouldNotAllow, substituteData);
     1565    FrameLoadRequest frameLoadRequest(*m_mainFrame->coreFrame(), request, shouldOpenExternalURLsPolicy, substituteData);
    15671566    frameLoadRequest.setShouldTreatAsContinuingLoad(shouldTreatAsContinuingLoad);
    15681567    m_mainFrame->coreFrame()->loader().load(WTFMove(frameLoadRequest));
     
    15751574    auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadParameters.data.data()), loadParameters.data.size());
    15761575    URL baseURL = loadParameters.baseURLString.isEmpty() ? WTF::blankURL() : URL(URL(), loadParameters.baseURLString);
    1577     loadDataImpl(loadParameters.navigationID, loadParameters.shouldTreatAsContinuingLoad, WTFMove(loadParameters.websitePolicies), WTFMove(sharedBuffer), loadParameters.MIMEType, loadParameters.encodingName, baseURL, URL(), loadParameters.userData);
     1576    loadDataImpl(loadParameters.navigationID, loadParameters.shouldTreatAsContinuingLoad, WTFMove(loadParameters.websitePolicies), WTFMove(sharedBuffer), loadParameters.MIMEType, loadParameters.encodingName, baseURL, URL(), loadParameters.userData, loadParameters.shouldOpenExternalURLsPolicy);
    15781577}
    15791578
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r246677 r246701  
    12851285    String sourceForFrame(WebFrame*);
    12861286
    1287     void loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&);
     1287    void loadDataImpl(uint64_t navigationID, bool shouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&, Ref<WebCore::SharedBuffer>&&, const String& MIMEType, const String& encodingName, const URL& baseURL, const URL& failingURL, const UserData&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
    12881288
    12891289    // Actions
  • trunk/Tools/ChangeLog

    r246694 r246701  
     12019-06-21  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        WebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
     4        https://bugs.webkit.org/show_bug.cgi?id=199114
     5        <rdar://problem/51671674>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        * TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
     10        (-[TestSOAuthorizationNavigationDelegate init]):
     11        (-[TestSOAuthorizationNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
     12        (configureSOAuthorizationWebView):
     13        (TestWebKitAPI::TEST):
     14
    1152019-06-21  Youenn Fablet  <youenn@apple.com>
    216
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm

    r246514 r246701  
    3333#import "PlatformUtilities.h"
    3434#import "TestWKWebView.h"
     35#import <WebKit/WKNavigationActionPrivate.h>
    3536#import <WebKit/WKNavigationDelegatePrivate.h>
    3637#import <WebKit/WKNavigationPrivate.h>
     
    122123@interface TestSOAuthorizationNavigationDelegate : NSObject <WKNavigationDelegate, WKUIDelegate>
    123124@property bool isDefaultPolicy;
     125@property bool shouldOpenExternalSchemes;
    124126- (instancetype)init;
    125127@end
     
    129131- (instancetype)init
    130132{
    131     if (self = [super init])
     133    if (self = [super init]) {
    132134        self.isDefaultPolicy = true;
     135        self.shouldOpenExternalSchemes = false;
     136    }
    133137    return self;
    134138}
     
    143147- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
    144148{
     149    EXPECT_EQ(navigationAction._shouldOpenExternalSchemes, self.shouldOpenExternalSchemes);
    145150    if (self.isDefaultPolicy) {
    146151        decisionHandler(WKNavigationActionPolicyAllow);
     
    243248}
    244249
    245 static void configureSOAuthorizationWebView(TestWKWebView *webView, TestSOAuthorizationNavigationDelegate *delegate)
     250enum class OpenExternalSchemesPolicy : bool {
     251    Allow,
     252    Disallow
     253};
     254
     255static void configureSOAuthorizationWebView(TestWKWebView *webView, TestSOAuthorizationNavigationDelegate *delegate, OpenExternalSchemesPolicy policy = OpenExternalSchemesPolicy::Disallow)
    246256{
    247257    [webView setNavigationDelegate:delegate];
    248258    [webView setUIDelegate:delegate];
     259    delegate.shouldOpenExternalSchemes = policy == OpenExternalSchemesPolicy::Allow;
    249260}
    250261
     
    278289    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    279290    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    280     configureSOAuthorizationWebView(webView.get(), delegate.get());
     291    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    281292
    282293    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    295306    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    296307    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    297     configureSOAuthorizationWebView(webView.get(), delegate.get());
     308    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    298309
    299310    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    314325    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    315326    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    316     configureSOAuthorizationWebView(webView.get(), delegate.get());
     327    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    317328
    318329    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    337348    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    338349    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    339     configureSOAuthorizationWebView(webView.get(), delegate.get());
     350    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    340351
    341352    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    360371    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    361372    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    362     configureSOAuthorizationWebView(webView.get(), delegate.get());
     373    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    363374
    364375    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    383394    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    384395    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    385     configureSOAuthorizationWebView(webView.get(), delegate.get());
     396    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    386397
    387398    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    407418    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    408419    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    409     configureSOAuthorizationWebView(webView.get(), delegate.get());
     420    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    410421
    411422    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    434445    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    435446    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    436     configureSOAuthorizationWebView(webView.get(), delegate.get());
     447    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    437448
    438449    // Force App Links with a request.URL that has a different host than the current one (empty host) and ShouldOpenExternalURLsPolicy::ShouldAllow.
     
    468479    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    469480    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    470     configureSOAuthorizationWebView(webView.get(), delegate.get());
     481    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    471482
    472483    // Force App Links with a request.URL that has a different host than the current one (empty host) and ShouldOpenExternalURLsPolicy::ShouldAllow.
     
    505516    // A separate delegate that implements decidePolicyForNavigationAction.
    506517    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    507     configureSOAuthorizationWebView(webView.get(), delegate.get());
     518    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    508519    [delegate setIsDefaultPolicy:false];
    509520
     
    534545    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    535546    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    536     configureSOAuthorizationWebView(webView.get(), delegate.get());
     547    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    537548
    538549    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    558569    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    559570    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    560     configureSOAuthorizationWebView(webView.get(), delegate.get());
     571    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    561572
    562573    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    593604    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    594605    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    595     configureSOAuthorizationWebView(webView.get(), delegate.get());
     606    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    596607
    597608    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    627638    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    628639    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    629     configureSOAuthorizationWebView(webView.get(), delegate.get());
     640    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    630641
    631642    auto testURL = URL(URL(), "https://www.example.com");
     
    668679    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    669680    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    670     configureSOAuthorizationWebView(webView.get(), delegate.get());
     681    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    671682
    672683    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    692703    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    693704    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    694     [webView setNavigationDelegate:delegate.get()];
    695     [webView setUIDelegate:delegate.get()];
     705    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    696706
    697707    // The session will be waiting since the web view is is not int the window.
     
    728738    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    729739    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    730     configureSOAuthorizationWebView(webView.get(), delegate.get());
     740    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    731741
    732742    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    759769    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    760770    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    761     configureSOAuthorizationWebView(webView.get(), delegate.get());
     771    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    762772
    763773    for (int i = 0; i < 2; i++) {
     
    792802    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    793803    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    794     configureSOAuthorizationWebView(webView.get(), delegate.get());
     804    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    795805
    796806    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    827837    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    828838    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    829     [webView setNavigationDelegate:delegate.get()];
    830     [webView setUIDelegate:delegate.get()];
     839    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    831840
    832841    // The session will be waiting since the web view is is not int the window.
     
    868877    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    869878    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    870     configureSOAuthorizationWebView(webView.get(), delegate.get());
     879    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    871880
    872881    // Add a http body to the request to mimic a SAML request.
     
    898907    [webView loadHTMLString:@"" baseURL:(NSURL *)URL(URL(), "http://www.webkit.org")];
    899908    Util::run(&navigationCompleted);
     909
     910    [delegate setShouldOpenExternalSchemes:true];
    900911    [webView evaluateJavaScript: @"location = 'http://www.example.com'" completionHandler:nil];
    901912    Util::run(&authorizationPerformed);
     
    914925    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    915926    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    916     configureSOAuthorizationWebView(webView.get(), delegate.get());
     927    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    917928
    918929    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    935946    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    936947    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    937     configureSOAuthorizationWebView(webView.get(), delegate.get());
     948    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    938949
    939950    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    960971    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    961972    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    962     configureSOAuthorizationWebView(webView.get(), delegate.get());
     973    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    963974
    964975    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    9931004    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    9941005    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    995     configureSOAuthorizationWebView(webView.get(), delegate.get());
     1006    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    9961007
    9971008    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    10251036    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    10261037    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    1027     configureSOAuthorizationWebView(webView.get(), delegate.get());
     1038    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    10281039
    10291040    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    10571068    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    10581069    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    1059     configureSOAuthorizationWebView(webView.get(), delegate.get());
     1070    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    10601071
    10611072    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    10961107    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    10971108    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    1098     configureSOAuthorizationWebView(webView.get(), delegate.get());
     1109    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    10991110
    11001111    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    11331144    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
    11341145    auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
    1135     configureSOAuthorizationWebView(webView.get(), delegate.get());
     1146    configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
    11361147
    11371148    [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
     
    11681179    Util::run(&navigationCompleted);
    11691180
     1181    [delegate setShouldOpenExternalSchemes:true];
    11701182    navigationCompleted = false;
    11711183#if PLATFORM(MAC)
     
    12451257    Util::run(&navigationCompleted);
    12461258
     1259    [delegate setShouldOpenExternalSchemes:true];
    12471260#if PLATFORM(MAC)
    12481261    [webView sendClicksAtPoint:NSMakePoint(200, 200) numberOfClicks:1];
     
    14211434    Util::run(&navigationCompleted);
    14221435
     1436    [delegate setShouldOpenExternalSchemes:true];
    14231437#if PLATFORM(MAC)
    14241438    [webView sendClicksAtPoint:NSMakePoint(200, 200) numberOfClicks:1];
Note: See TracChangeset for help on using the changeset viewer.