Changeset 199663 in webkit


Ignore:
Timestamp:
Apr 18, 2016 3:01:45 AM (8 years ago)
Author:
Carlos Garcia Campos
Message:

Pending API request URL no set when loading Data, Alternate HTML or plain text
https://bugs.webkit.org/show_bug.cgi?id=136916

Reviewed by Darin Adler.

Source/WebKit2:

Set pending API request URL for all load methods in
WebPageProxy. This ensures that right after calling those methods,
the active URL is the requested one and that
PageLoadState::isLoading() returns true.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::loadAlternateHTMLString):
(WebKit::WebPageProxy::loadPlainTextString):
(WebKit::WebPageProxy::loadWebArchiveData):

Tools:

Add new test to check that active URL is the requested one right
after calling WKPage load methods.

  • TestWebKitAPI/PlatformEfl.cmake:
  • TestWebKitAPI/PlatformGTK.cmake:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp: Added.

(TestWebKitAPI::TEST):

  • TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:

(WebViewTest::loadPlainText): Remove FIXME.
(WebViewTest::loadBytes): Ditto.
(WebViewTest::loadAlternateHTML): Ditto.

Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r199662 r199663  
     12016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Pending API request URL no set when loading Data, Alternate HTML or plain text
     4        https://bugs.webkit.org/show_bug.cgi?id=136916
     5
     6        Reviewed by Darin Adler.
     7
     8        Set pending API request URL for all load methods in
     9        WebPageProxy. This ensures that right after calling those methods,
     10        the active URL is the requested one and that
     11        PageLoadState::isLoading() returns true.
     12
     13        * UIProcess/WebPageProxy.cpp:
     14        (WebKit::WebPageProxy::loadAlternateHTMLString):
     15        (WebKit::WebPageProxy::loadPlainTextString):
     16        (WebKit::WebPageProxy::loadWebArchiveData):
     17
    1182016-04-18  Commit Queue  <commit-queue@webkit.org>
    219
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r199662 r199663  
    972972    auto transaction = m_pageLoadState.transaction();
    973973
    974     m_pageLoadState.setPendingAPIRequestURL(transaction, !baseURL.isEmpty() ? baseURL : ASCIILiteral("about:blank"));
     974    m_pageLoadState.setPendingAPIRequestURL(transaction, !baseURL.isEmpty() ? baseURL : blankURL().string());
    975975
    976976    if (!isValid())
     
    994994    auto transaction = m_pageLoadState.transaction();
    995995
    996     m_pageLoadState.setPendingAPIRequestURL(transaction, !baseURL.isEmpty() ? baseURL : ASCIILiteral("about:blank"));
     996    m_pageLoadState.setPendingAPIRequestURL(transaction, !baseURL.isEmpty() ? baseURL : blankURL().string());
    997997
    998998    if (!isValid())
     
    10221022    auto transaction = m_pageLoadState.transaction();
    10231023
     1024    m_pageLoadState.setPendingAPIRequestURL(transaction, unreachableURL);
    10241025    m_pageLoadState.setUnreachableURL(transaction, unreachableURL);
    10251026
     
    10411042        reattachToWebProcess();
    10421043
     1044    auto transaction = m_pageLoadState.transaction();
     1045    m_pageLoadState.setPendingAPIRequestURL(transaction, blankURL().string());
     1046
    10431047    m_process->send(Messages::WebPage::LoadPlainTextString(string, UserData(process().transformObjectsToHandles(userData).get())), m_pageID);
    10441048    m_process->responsivenessTimer().start();
     
    10521056    if (!isValid())
    10531057        reattachToWebProcess();
     1058
     1059    auto transaction = m_pageLoadState.transaction();
     1060    m_pageLoadState.setPendingAPIRequestURL(transaction, blankURL().string());
    10541061
    10551062    m_process->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference(), UserData(process().transformObjectsToHandles(userData).get())), m_pageID);
  • trunk/Tools/ChangeLog

    r199662 r199663  
     12016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Pending API request URL no set when loading Data, Alternate HTML or plain text
     4        https://bugs.webkit.org/show_bug.cgi?id=136916
     5
     6        Reviewed by Darin Adler.
     7
     8        Add new test to check that active URL is the requested one right
     9        after calling WKPage load methods.
     10
     11        * TestWebKitAPI/PlatformEfl.cmake:
     12        * TestWebKitAPI/PlatformGTK.cmake:
     13        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     14        * TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp: Added.
     15        (TestWebKitAPI::TEST):
     16        * TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
     17        (WebViewTest::loadPlainText): Remove FIXME.
     18        (WebViewTest::loadBytes): Ditto.
     19        (WebViewTest::loadAlternateHTML): Ditto.
     20
    1212016-04-18  Commit Queue  <commit-queue@webkit.org>
    222
  • trunk/Tools/TestWebKitAPI/PlatformEfl.cmake

    r199662 r199663  
    9595    PageLoadDidChangeLocationWithinPageForFrame
    9696    ParentFrame
     97    PendingAPIRequestURL
    9798    PreventEmptyUserAgent
    9899    PrivateBrowsingPushStateNoHistoryCallback
  • trunk/Tools/TestWebKitAPI/PlatformGTK.cmake

    r199662 r199663  
    9999    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp
    100100    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame.cpp
     101    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PendingAPIRequestURL.cpp
    101102    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PreventEmptyUserAgent.cpp
    102103    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r199662 r199663  
    88
    99/* Begin PBXBuildFile section */
     10                0766DD201A5AD5200023E3BB /* PendingAPIRequestURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0766DD1F1A5AD5200023E3BB /* PendingAPIRequestURL.cpp */; };
    1011                0F139E771A423A5B00F590F5 /* WeakObjCPtr.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F139E751A423A5300F590F5 /* WeakObjCPtr.mm */; };
    1112                0F139E781A423A6B00F590F5 /* PlatformUtilitiesCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F139E721A423A2B00F590F5 /* PlatformUtilitiesCocoa.mm */; };
     
    507508                00BC16851680FE810065F1E5 /* PublicSuffix.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PublicSuffix.mm; sourceTree = "<group>"; };
    508509                00CD9F6215BE312C002DA2CE /* BackForwardList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackForwardList.mm; sourceTree = "<group>"; };
     510                0766DD1F1A5AD5200023E3BB /* PendingAPIRequestURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PendingAPIRequestURL.cpp; sourceTree = "<group>"; };
    509511                0BCD833414857CE400EA2003 /* HashMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HashMap.cpp; sourceTree = "<group>"; };
    510512                0BCD85691485C98B00EA2003 /* TemporaryChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TemporaryChange.cpp; sourceTree = "<group>"; };
     
    12001202                        isa = PBXGroup;
    12011203                        children = (
     1204                                0766DD1F1A5AD5200023E3BB /* PendingAPIRequestURL.cpp */,
    12021205                                0F139E741A423A4600F590F5 /* cocoa */,
    12031206                                C0C5D3BB14598B6F00A802A6 /* mac */,
     
    19531956                        buildActionMask = 2147483647;
    19541957                        files = (
     1958                                0766DD201A5AD5200023E3BB /* PendingAPIRequestURL.cpp in Sources */,
    19551959                                2D9A53AF1B31FA8D0074D5AA /* ShrinkToFit.mm in Sources */,
    19561960                                51B454EC1B4E236B0085EAA6 /* WebViewCloseInsideDidFinishLoadForFrame.mm in Sources */,
  • trunk/Tools/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp

    r199662 r199663  
    8383    m_activeURI = "about:blank";
    8484    webkit_web_view_load_plain_text(m_webView, plainText);
    85 #if 0
    86     // FIXME: Pending API request URL no set when loading plain text.
    87     // See https://bugs.webkit.org/show_bug.cgi?id=136916.
    88     g_assert(webkit_web_view_is_loading(m_webView));
    89     g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data());
    90 #endif
     85    g_assert(webkit_web_view_is_loading(m_webView));
     86    g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data());
    9187}
    9288
     
    9894        m_activeURI = baseURI;
    9995    webkit_web_view_load_bytes(m_webView, bytes, mimeType, encoding, baseURI);
    100 #if 0
    101     // FIXME: Pending API request URL no set when loading data.
    102     // See https://bugs.webkit.org/show_bug.cgi?id=136916.
    103     g_assert(webkit_web_view_is_loading(m_webView));
    104     g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data());
    105 #endif
     96    g_assert(webkit_web_view_is_loading(m_webView));
     97    g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data());
    10698}
    10799
     
    118110    m_activeURI = contentURI;
    119111    webkit_web_view_load_alternate_html(m_webView, html, contentURI, baseURI);
    120 #if 0
    121     // FIXME: Pending API request URL no set when loading Alternate HTML.
    122     // See https://bugs.webkit.org/show_bug.cgi?id=136916.
    123     g_assert(webkit_web_view_is_loading(m_webView));
    124 #endif
     112    g_assert(webkit_web_view_is_loading(m_webView));
    125113    g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data());
    126114}
Note: See TracChangeset for help on using the changeset viewer.