Changeset 249890 in webkit


Ignore:
Timestamp:
Sep 16, 2019 12:49:10 AM (5 years ago)
Author:
Carlos Garcia Campos
Message:

REGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely
https://bugs.webkit.org/show_bug.cgi?id=201544

Reviewed by Michael Catanzaro.

Source/WebKit:

WebPageProxy::loadAlternateHTML() is an exception, because it's an API request but always sets the navigationID
to 0. We always want to reset the pending API request URL when alternate HTML load starts.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Check also that it's an API alternate HTML load
to reset the pending API request URL.

Tools:

Add new test cases.

  • TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp:

(testWebViewActiveURI):
(testWebViewIsLoading):

  • TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp:

(loadChangedCallback):
(LoadTrackingTest::loadAlternateHTML):
(LoadTrackingTest::reset):

  • TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.h:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r249889 r249890  
     12019-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely
     4        https://bugs.webkit.org/show_bug.cgi?id=201544
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        WebPageProxy::loadAlternateHTML() is an exception, because it's an API request but always sets the navigationID
     9        to 0. We always want to reset the pending API request URL when alternate HTML load starts.
     10
     11        * UIProcess/WebPageProxy.cpp:
     12        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Check also that it's an API alternate HTML load
     13        to reset the pending API request URL.
     14
    1152019-09-15  David Kilzer  <ddkilzer@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r249855 r249890  
    40484048
    40494049    auto transaction = m_pageLoadState.transaction();
    4050 
    4051     if (navigation)
     4050    bool fromAlternateHTMLAPI = !unreachableURL.isEmpty() && unreachableURL == m_pageLoadState.pendingAPIRequestURL();
     4051    if (navigation || fromAlternateHTMLAPI)
    40524052        m_pageLoadState.clearPendingAPIRequest(transaction);
    40534053
  • trunk/Tools/ChangeLog

    r249884 r249890  
     12019-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely
     4        https://bugs.webkit.org/show_bug.cgi?id=201544
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Add new test cases.
     9
     10        * TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp:
     11        (testWebViewActiveURI):
     12        (testWebViewIsLoading):
     13        * TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp:
     14        (loadChangedCallback):
     15        (LoadTrackingTest::loadAlternateHTML):
     16        (LoadTrackingTest::reset):
     17        * TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.h:
     18
    1192019-09-15  David Kilzer  <ddkilzer@apple.com>
    220
  • trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp

    r249759 r249890  
    293293    }
    294294
     295    void loadURIAndRedirectOnCommitted(const char* uri, const char* redirectURI)
     296    {
     297        reset();
     298        m_uriToLoadOnCommitted = redirectURI;
     299        LoadTrackingTest::loadURI(uri);
     300    }
     301
    295302    void provisionalLoadStarted()
    296303    {
     
    306313    {
    307314        m_currentURIList[Commited] = m_currentURI;
     315        if (!m_uriToLoadOnCommitted.isNull()) {
     316            m_estimatedProgress = 0;
     317            m_activeURI = m_uriToLoadOnCommitted;
     318            webkit_web_view_load_uri(m_webView, m_uriToLoadOnCommitted.data());
     319        }
    308320    }
    309321
     
    312324        m_currentURIList[Finished] = m_currentURI;
    313325        LoadTrackingTest::loadFinished();
     326        if (!m_uriToLoadOnCommitted.isNull())
     327            m_uriToLoadOnCommitted = { };
    314328    }
    315329
     
    325339    void reset()
    326340    {
    327         m_currentURI = CString();
     341        m_currentURI = { };
     342        m_uriToLoadOnCommitted = { };
    328343        m_currentURIList.clear();
    329344        m_currentURIList.grow(m_currentURIList.capacity());
     
    331346
    332347    CString m_currentURI;
     348    CString m_uriToLoadOnCommitted;
    333349    Vector<CString, 4> m_currentURIList;
    334350};
     
    416432    test->checkURIAtState(ViewURITrackingTest::State::Commited, "/request-changed-on-redirect");
    417433    test->checkURIAtState(ViewURITrackingTest::State::Finished, "/request-changed-on-redirect");
     434
     435    test->loadURIAndRedirectOnCommitted(kServer->getURIForPath("/normal").data(), kServer->getURIForPath("/headers").data());
     436    test->waitUntilLoadFinished();
     437    test->checkURIAtState(ViewURITrackingTest::State::Provisional, "/normal");
     438    test->checkURIAtState(ViewURITrackingTest::State::ProvisionalAfterRedirect, nullptr);
     439    test->checkURIAtState(ViewURITrackingTest::State::Commited, "/normal");
     440    // Pending API request is always updated immedately.
     441    test->checkURIAtState(ViewURITrackingTest::State::Finished, "/headers");
     442    test->waitUntilLoadFinished();
     443    test->checkURIAtState(ViewURITrackingTest::State::Provisional, "/headers");
     444    test->checkURIAtState(ViewURITrackingTest::State::ProvisionalAfterRedirect, nullptr);
     445    test->checkURIAtState(ViewURITrackingTest::State::Commited, "/headers");
     446    test->checkURIAtState(ViewURITrackingTest::State::Finished, "/headers");
    418447}
    419448
     
    455484    test->loadURI(kServer->getURIForPath("/normal").data());
    456485    test->waitUntilLoadFinished();
     486    g_assert_false(webkit_web_view_is_loading(test->m_webView));
    457487
    458488    test->reload();
    459489    test->waitUntilLoadFinished();
     490    g_assert_false(webkit_web_view_is_loading(test->m_webView));
    460491
    461492    test->loadURI(kServer->getURIForPath("/error").data());
    462493    test->waitUntilLoadFinished();
     494    g_assert_false(webkit_web_view_is_loading(test->m_webView));
    463495
    464496    test->loadURI(kServer->getURIForPath("/normal").data());
    465497    test->waitUntilLoadFinished();
     498    g_assert_false(webkit_web_view_is_loading(test->m_webView));
    466499    test->loadURI(kServer->getURIForPath("/normal2").data());
    467500    test->waitUntilLoadFinished();
     501    g_assert_false(webkit_web_view_is_loading(test->m_webView));
    468502
    469503    test->goBack();
    470504    test->waitUntilLoadFinished();
     505    g_assert_false(webkit_web_view_is_loading(test->m_webView));
    471506
    472507    test->goForward();
    473508    test->waitUntilLoadFinished();
     509    g_assert_false(webkit_web_view_is_loading(test->m_webView));
     510
     511    test->loadAlternateHTML("<html><head><title>Title</title></head></html>", "file:///foo", nullptr);
     512    test->waitUntilLoadFinished();
     513    g_assert_false(webkit_web_view_is_loading(test->m_webView));
    474514}
    475515
  • trunk/Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp

    r239772 r249890  
    3232        g_assert_true(webkit_web_view_is_loading(webView));
    3333        test->m_activeURI = webkit_web_view_get_uri(webView);
     34        test->m_committedURI = test->m_activeURI;
    3435        if (!test->m_redirectURI.isNull())
    3536            g_assert_cmpstr(test->m_redirectURI.data(), ==, test->m_activeURI.data());
     
    4950    }
    5051    case WEBKIT_LOAD_FINISHED:
    51         if (!test->m_loadFailed) {
     52        if (!test->m_loadFailed)
     53            g_assert_cmpstr(test->m_activeURI.data(), ==, webkit_web_view_get_uri(webView));
     54
     55        // When a new load is started before the previous one has finished, we receive the load-finished signal
     56        // of the ongoing load while we already have a provisional URL for the new load. This is the only case
     57        // where isloading is true when the load has finished.
     58        if (test->m_activeURI == test->m_committedURI)
    5259            g_assert_false(webkit_web_view_is_loading(webView));
    53             g_assert_cmpstr(test->m_activeURI.data(), ==, webkit_web_view_get_uri(webView));
    54         } else if (!g_error_matches(test->m_error.get(), WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED)) {
    55             // When a new load is started before the previous one has finished, we receive the load-finished signal
    56             // of the ongoing load while we already have a provisional URL for the new load. This is the only case
    57             // where isloading is true when the load has finished.
    58             g_assert_false(webkit_web_view_is_loading(webView));
    59         }
     60
    6061        test->loadFinished();
    6162        break;
     
    225226}
    226227
     228void LoadTrackingTest::loadAlternateHTML(const char* html, const char* contentURI, const char* baseURI)
     229{
     230    reset();
     231    WebViewTest::loadAlternateHTML(html, contentURI, baseURI);
     232}
     233
    227234void LoadTrackingTest::reset()
    228235{
     
    232239    m_estimatedProgress = 0;
    233240    m_error.reset();
    234 }
     241    m_committedURI = { };
     242}
  • trunk/Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.h

    r218685 r249890  
    4747    void goBack();
    4848    void goForward();
     49    void loadAlternateHTML(const char* html, const char* contentURI, const char* baseURI);
    4950    void reset();
    5051
     
    6667    float m_estimatedProgress;
    6768    CString m_redirectURI;
     69    CString m_committedURI;
    6870};
Note: See TracChangeset for help on using the changeset viewer.