Changeset 69461 in webkit


Ignore:
Timestamp:
Oct 9, 2010 4:18:54 PM (13 years ago)
Author:
weinig@apple.com
Message:

WKFrameGetFrameLoadState() returns kWKFrameLoadStateCommitted after the load has been stopped
<rdar://problem/8173667>
https://bugs.webkit.org/show_bug.cgi?id=47461

Reviewed by Dan Bernstein.

WebKit2:

API Test: WebKit2/FailedLoad

  • UIProcess/WebFrameProxy.cpp:

(WebKit::WebFrameProxy::didFailProvisionalLoad):
(WebKit::WebFrameProxy::didFailLoad):

  • UIProcess/WebFrameProxy.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
Set the frame load state to LoadStateFinished for both didFailProvisionalLoadForFrame
and didFailLoadForFrame.

WebKitTools:

  • TestWebKitAPI/PlatformUtilities.h:
  • TestWebKitAPI/Test.h:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp: Added.

(TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/mac/PlatformUtilitiesMac.mm:

(TestWebKitAPI::Util::URLForNonExistentResource):
Adds a test for the frame load state after a failed provisional load. I wanted to test
the frame load state after a committed load failed, but I don't believe that is possible
to do without hooking up the http server to serve a long loading page.

Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r69460 r69461  
     12010-10-09  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        WKFrameGetFrameLoadState() returns kWKFrameLoadStateCommitted after the load has been stopped
     6        <rdar://problem/8173667>
     7        https://bugs.webkit.org/show_bug.cgi?id=47461
     8
     9        API Test: WebKit2/FailedLoad
     10
     11        * UIProcess/WebFrameProxy.cpp:
     12        (WebKit::WebFrameProxy::didFailProvisionalLoad):
     13        (WebKit::WebFrameProxy::didFailLoad):
     14        * UIProcess/WebFrameProxy.h:
     15        * UIProcess/WebPageProxy.cpp:
     16        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
     17        (WebKit::WebPageProxy::didFailLoadForFrame):
     18        Set the frame load state to LoadStateFinished for both didFailProvisionalLoadForFrame
     19        and didFailLoadForFrame.
     20
    1212010-10-09  Sam Weinig  <sam@webkit.org>
    222
  • trunk/WebKit2/UIProcess/WebFrameProxy.cpp

    r67775 r69461  
    8181}
    8282
     83void WebFrameProxy::didFailProvisionalLoad()
     84{
     85    m_loadState = LoadStateFinished;
     86}
     87
    8388void WebFrameProxy::didCommitLoad()
    8489{
     
    9297{
    9398    // FIXME: Add assertions
     99    m_loadState = LoadStateFinished;
     100}
     101
     102void WebFrameProxy::didFailLoad()
     103{
    94104    m_loadState = LoadStateFinished;
    95105}
  • trunk/WebKit2/UIProcess/WebFrameProxy.h

    r69116 r69461  
    8383    void didStartProvisionalLoad(const String& url);
    8484    void didReceiveServerRedirectForProvisionalLoad(const String& url);
     85    void didFailProvisionalLoad();
    8586    void didCommitLoad();
    8687    void didFinishLoad();
     88    void didFailLoad();
    8789    void didReceiveTitle(const String&);
    8890
  • trunk/WebKit2/UIProcess/WebPageProxy.cpp

    r69460 r69461  
    645645    WebFrameProxy* frame = process()->webFrame(frameID);
    646646
     647    frame->didFailProvisionalLoad();
    647648    m_loaderClient.didFailProvisionalLoadWithErrorForFrame(this, frame, userData.get());
    648649}
     
    696697
    697698    WebFrameProxy* frame = process()->webFrame(frameID);
     699    frame->didFailLoad();
    698700
    699701    m_loaderClient.didFailLoadWithErrorForFrame(this, frame, userData.get());
  • trunk/WebKitTools/ChangeLog

    r69460 r69461  
     12010-10-09  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        WKFrameGetFrameLoadState() returns kWKFrameLoadStateCommitted after the load has been stopped
     6        <rdar://problem/8173667>
     7        https://bugs.webkit.org/show_bug.cgi?id=47461
     8
     9        * TestWebKitAPI/PlatformUtilities.h:
     10        * TestWebKitAPI/Test.h:
     11        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     12        * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp: Added.
     13        (TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame):
     14        (TestWebKitAPI::TEST):
     15        * TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
     16        (TestWebKitAPI::Util::URLForNonExistentResource):
     17        Adds a test for the frame load state after a failed provisional load. I wanted to test
     18        the frame load state after a committed load failed, but I don't believe that is possible
     19        to do without hooking up the http server to serve a long loading page.
     20
    1212010-10-09  Sam Weinig  <sam@webkit.org>
    222
  • trunk/WebKitTools/TestWebKitAPI/PlatformUtilities.h

    r69129 r69461  
    3939
    4040WKURLRef createURLForResource(const char* resource, const char* extension);
     41WKURLRef URLForNonExistentResource();
    4142
    4243inline std::string toSTD(WKStringRef string)
  • trunk/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r69343 r69461  
    2525                BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */ = {isa = PBXBuildFile; fileRef = BCBD372E125ABBE600D2C29F /* icon.png */; };
    2626                BCBD3761125ABCFE00D2C29F /* FrameMIMETypePNG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */; };
     27                BCC8B95B12611F4700DE46A4 /* FailedLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */; };
    2728/* End PBXBuildFile section */
    2829
     
    7980                BCBD372E125ABBE600D2C29F /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
    8081                BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameMIMETypePNG.cpp; sourceTree = "<group>"; };
     82                BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FailedLoad.cpp; sourceTree = "<group>"; };
    8183/* End PBXFileReference section */
    8284
     
    159161                                BC90995D12567BC100083756 /* WKString.cpp */,
    160162                                BC9099931256ACF100083756 /* WKStringJSString.cpp */,
     163                                BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */,
    161164                        );
    162165                        path = WebKit2;
     
    262265                                BCBD3761125ABCFE00D2C29F /* FrameMIMETypePNG.cpp in Sources */,
    263266                                1A02C84F125D4A8400E3F4BD /* Find.cpp in Sources */,
     267                                BCC8B95B12611F4700DE46A4 /* FailedLoad.cpp in Sources */,
    264268                        );
    265269                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm

    r69116 r69461  
    4444}
    4545
     46WKURLRef URLForNonExistentResource()
     47{
     48    NSURL* nsURL = [NSURL URLWithString:@"file:///does-not-exist.html"];
     49    return WKURLCreateWithCFURL((CFURLRef)nsURL);
     50}
     51
    4652} // namespace Util
    4753} // namespace TestWebKitAPI
Note: See TracChangeset for help on using the changeset viewer.