[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 14:28:00 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 13eb27075ccab3f553d1681debeeb62acd84ee59
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 9 23:18:54 2010 +0000

    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.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69461 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index be54086..6872db0 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,26 @@
 
         Reviewed by Dan Bernstein.
 
+        WKFrameGetFrameLoadState() returns kWKFrameLoadStateCommitted after the load has been stopped
+        <rdar://problem/8173667>
+        https://bugs.webkit.org/show_bug.cgi?id=47461
+
+        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.
+
+2010-10-09  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Dan Bernstein.
+
         Add WebKit2 version of runBeforeUnloadConfirmPanelWithMessage
         <rdar://problem/8447690>
         https://bugs.webkit.org/show_bug.cgi?id=47459
diff --git a/WebKit2/UIProcess/WebFrameProxy.cpp b/WebKit2/UIProcess/WebFrameProxy.cpp
index 30e0b79..00dc258 100644
--- a/WebKit2/UIProcess/WebFrameProxy.cpp
+++ b/WebKit2/UIProcess/WebFrameProxy.cpp
@@ -80,6 +80,11 @@ void WebFrameProxy::didReceiveServerRedirectForProvisionalLoad(const String& url
     m_provisionalURL = url;
 }
 
+void WebFrameProxy::didFailProvisionalLoad()
+{
+    m_loadState = LoadStateFinished;
+}
+
 void WebFrameProxy::didCommitLoad()
 {
     // FIXME: Add assertions.
@@ -94,6 +99,11 @@ void WebFrameProxy::didFinishLoad()
     m_loadState = LoadStateFinished;
 }
 
+void WebFrameProxy::didFailLoad()
+{
+    m_loadState = LoadStateFinished;
+}
+
 void WebFrameProxy::didReceiveTitle(const String&)
 {
 }
diff --git a/WebKit2/UIProcess/WebFrameProxy.h b/WebKit2/UIProcess/WebFrameProxy.h
index e2a5f5e..3fe41f4 100644
--- a/WebKit2/UIProcess/WebFrameProxy.h
+++ b/WebKit2/UIProcess/WebFrameProxy.h
@@ -82,8 +82,10 @@ public:
 
     void didStartProvisionalLoad(const String& url);
     void didReceiveServerRedirectForProvisionalLoad(const String& url);
+    void didFailProvisionalLoad();
     void didCommitLoad();
     void didFinishLoad();
+    void didFailLoad();
     void didReceiveTitle(const String&);
 
     void receivedPolicyDecision(WebCore::PolicyAction, uint64_t listenerID);
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 7a6f285..63dc757 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -644,6 +644,7 @@ void WebPageProxy::didFailProvisionalLoadForFrame(uint64_t frameID, CoreIPC::Arg
 
     WebFrameProxy* frame = process()->webFrame(frameID);
 
+    frame->didFailProvisionalLoad();
     m_loaderClient.didFailProvisionalLoadWithErrorForFrame(this, frame, userData.get());
 }
 
@@ -695,6 +696,7 @@ void WebPageProxy::didFailLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecode
         return;
 
     WebFrameProxy* frame = process()->webFrame(frameID);
+    frame->didFailLoad();
 
     m_loaderClient.didFailLoadWithErrorForFrame(this, frame, userData.get());
 }
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 2d45899..a8bfea9 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,26 @@
 
         Reviewed by Dan Bernstein.
 
+        WKFrameGetFrameLoadState() returns kWKFrameLoadStateCommitted after the load has been stopped
+        <rdar://problem/8173667>
+        https://bugs.webkit.org/show_bug.cgi?id=47461
+
+        * 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.
+
+2010-10-09  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Dan Bernstein.
+
         Add WebKit2 version of runBeforeUnloadConfirmPanelWithMessage
         <rdar://problem/8447690>
         https://bugs.webkit.org/show_bug.cgi?id=47459
diff --git a/WebKitTools/TestWebKitAPI/PlatformUtilities.h b/WebKitTools/TestWebKitAPI/PlatformUtilities.h
index fee3f05..2101259 100644
--- a/WebKitTools/TestWebKitAPI/PlatformUtilities.h
+++ b/WebKitTools/TestWebKitAPI/PlatformUtilities.h
@@ -38,6 +38,7 @@ namespace Util {
 void run(bool* done);
 
 WKURLRef createURLForResource(const char* resource, const char* extension);
+WKURLRef URLForNonExistentResource();
 
 inline std::string toSTD(WKStringRef string)
 {
diff --git a/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
index 82547e8..2d7b21d 100644
--- a/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
+++ b/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
@@ -24,6 +24,7 @@
 		BCBD3710125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */; };
 		BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */ = {isa = PBXBuildFile; fileRef = BCBD372E125ABBE600D2C29F /* icon.png */; };
 		BCBD3761125ABCFE00D2C29F /* FrameMIMETypePNG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */; };
+		BCC8B95B12611F4700DE46A4 /* FailedLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXCopyFilesBuildPhase section */
@@ -78,6 +79,7 @@
 		BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameMIMETypeHTML.cpp; sourceTree = "<group>"; };
 		BCBD372E125ABBE600D2C29F /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
 		BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameMIMETypePNG.cpp; sourceTree = "<group>"; };
+		BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FailedLoad.cpp; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -158,6 +160,7 @@
 				BC909779125571AB00083756 /* PageLoadBasic.cpp */,
 				BC90995D12567BC100083756 /* WKString.cpp */,
 				BC9099931256ACF100083756 /* WKStringJSString.cpp */,
+				BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */,
 			);
 			path = WebKit2;
 			sourceTree = "<group>";
@@ -261,6 +264,7 @@
 				BCBD3710125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp in Sources */,
 				BCBD3761125ABCFE00D2C29F /* FrameMIMETypePNG.cpp in Sources */,
 				1A02C84F125D4A8400E3F4BD /* Find.cpp in Sources */,
+				BCC8B95B12611F4700DE46A4 /* FailedLoad.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp
new file mode 100644
index 0000000..6685d59
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+// FIXME: This should also test the that the load state after didFailLoadWithErrorForFrame is kWKFrameLoadStateFinished
+
+static bool testDone;
+
+static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+    TEST_ASSERT(WKFrameGetFrameLoadState(frame) == kWKFrameLoadStateFinished);
+    testDone = true;
+}
+
+TEST(WebKit2, FailedLoad)
+{
+    WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+    WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+    PlatformWebView webView(pageNamespace.get());
+
+    WKPageLoaderClient loaderClient;
+    memset(&loaderClient, 0, sizeof(loaderClient));
+
+    loaderClient.version = 0;
+    loaderClient.clientInfo = 0;
+    loaderClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;
+    WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+    WKRetainPtr<WKURLRef> url(AdoptWK, Util::URLForNonExistentResource());
+    WKPageLoadURL(webView.page(), url.get());
+
+    Util::run(&testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm b/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
index 8b49ab1..b452950 100644
--- a/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
+++ b/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
@@ -43,5 +43,11 @@ WKURLRef createURLForResource(const char* resource, const char* extension)
     return WKURLCreateWithCFURL((CFURLRef)nsURL);
 }
 
+WKURLRef URLForNonExistentResource()
+{
+    NSURL* nsURL = [NSURL URLWithString:@"file:///does-not-exist.html"];
+    return WKURLCreateWithCFURL((CFURLRef)nsURL);
+}
+
 } // namespace Util
 } // namespace TestWebKitAPI

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list