Title: [94812] trunk
Revision
94812
Author
bweinst...@apple.com
Date
2011-09-08 15:45:12 -0700 (Thu, 08 Sep 2011)

Log Message

Source/WebKit2: WebKit2: Assertion when calling didPerform*Redirect on null source/destination URL string
https://bugs.webkit.org/show_bug.cgi?id=67794
<rdar://problem/9892024>
        
Don't call didPerformClientRedirect or didPerformServerRedirect when source or destination URL string
is empty or null.
        
If we call didPerformClientRedirect or didPerformServerRedirect when the source or destination is null,
it causes an assert in WKURLCF::WKURLCopyCFURL when we try to convert the WKURLRef into a CFURLRef.

Reviewed by Brady Eidson.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::didPerformClientRedirect): Return early if the source or destination URL string is empty or null.
(WebKit::WebContext::didPerformServerRedirect): Ditto.

Tools: WebKit2: Assertion when calling didPerform*Redirect on null source/destination URL string
https://bugs.webkit.org/show_bug.cgi?id=67794
<rdar://problem/9892024>
        
Add a test that we don't send a didPerformServerRedirect when a load is cancelled from willSendRequest.

Reviewed by Brady Eidson.

* TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp: Added.
(TestWebKitAPI::didFinishLoadForFrame): Set flags on whether we've loaded the main frame, iframe, or both.
(TestWebKitAPI::didPerformServerRedirect): Set a flag for whether we've performed a server redirect.
(TestWebKitAPI::TEST): Set up a WKPageLoaderClient and WKContextHistoryClient, and load simple-iframe.html.
    Once both frames have loaded (main frame and blocked iframe), make sure that we have never called
    didPerformServerRedirect.

* TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp: Added.
(TestWebKitAPI::LoadCanceledNoServerRedirectCallbackTest::LoadCanceledNoServerRedirectCallbackTest): Initialize
    our InjectedBundleTest.
(TestWebKitAPI::LoadCanceledNoServerRedirectCallbackTest::willSendRequestForFrame): If we are dealing with a request
    from the main frame (the main resource in simple-iframe.html), allow it. If not (dealing with the iframe), block
    the request.
(TestWebKitAPI::LoadCanceledNoServerRedirectCallbackTest::didCreatePage): Set up the WKBundlePageResourceLoadClient.

* TestWebKitAPI/Tests/WebKit2/simple-iframe.html: Added.
        
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add new files.
* TestWebKitAPI/win/TestWebKitAPI.vcproj: Ditto.
* TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj: Ditto.
* TestWebKitAPI/win/copy-resources.cmd: Ditto.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (94811 => 94812)


--- trunk/Source/WebKit2/ChangeLog	2011-09-08 22:38:44 UTC (rev 94811)
+++ trunk/Source/WebKit2/ChangeLog	2011-09-08 22:45:12 UTC (rev 94812)
@@ -1,3 +1,21 @@
+2011-09-08  Brian Weinstein  <bweinst...@apple.com>
+
+        WebKit2: Assertion when calling didPerform*Redirect on null source/destination URL string
+        https://bugs.webkit.org/show_bug.cgi?id=67794
+        <rdar://problem/9892024>
+        
+        Don't call didPerformClientRedirect or didPerformServerRedirect when source or destination URL string
+        is empty or null.
+        
+        If we call didPerformClientRedirect or didPerformServerRedirect when the source or destination is null,
+        it causes an assert in WKURLCF::WKURLCopyCFURL when we try to convert the WKURLRef into a CFURLRef.
+
+        Reviewed by Brady Eidson.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::didPerformClientRedirect): Return early if the source or destination URL string is empty or null.
+        (WebKit::WebContext::didPerformServerRedirect): Ditto.
+
 2011-09-08  Sam Weinig  <s...@webkit.org>
 
         Remove the Completion object from JSC, I have never liked it

Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (94811 => 94812)


--- trunk/Source/WebKit2/UIProcess/WebContext.cpp	2011-09-08 22:38:44 UTC (rev 94811)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp	2011-09-08 22:45:12 UTC (rev 94812)
@@ -432,6 +432,9 @@
     WebPageProxy* page = m_process->webPage(pageID);
     if (!page)
         return;
+
+    if (sourceURLString.isEmpty() || destinationURLString.isEmpty())
+        return;
     
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
@@ -446,6 +449,9 @@
     if (!page)
         return;
     
+    if (sourceURLString.isEmpty() || destinationURLString.isEmpty())
+        return;
+    
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
     MESSAGE_CHECK(frame->page() == page);

Modified: trunk/Tools/ChangeLog (94811 => 94812)


--- trunk/Tools/ChangeLog	2011-09-08 22:38:44 UTC (rev 94811)
+++ trunk/Tools/ChangeLog	2011-09-08 22:45:12 UTC (rev 94812)
@@ -1,3 +1,35 @@
+2011-09-08  Brian Weinstein  <bweinst...@apple.com>
+
+        WebKit2: Assertion when calling didPerform*Redirect on null source/destination URL string
+        https://bugs.webkit.org/show_bug.cgi?id=67794
+        <rdar://problem/9892024>
+        
+        Add a test that we don't send a didPerformServerRedirect when a load is cancelled from willSendRequest.
+
+        Reviewed by Brady Eidson.
+
+        * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp: Added.
+        (TestWebKitAPI::didFinishLoadForFrame): Set flags on whether we've loaded the main frame, iframe, or both.
+        (TestWebKitAPI::didPerformServerRedirect): Set a flag for whether we've performed a server redirect.
+        (TestWebKitAPI::TEST): Set up a WKPageLoaderClient and WKContextHistoryClient, and load simple-iframe.html.
+            Once both frames have loaded (main frame and blocked iframe), make sure that we have never called
+            didPerformServerRedirect.
+
+        * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp: Added.
+        (TestWebKitAPI::LoadCanceledNoServerRedirectCallbackTest::LoadCanceledNoServerRedirectCallbackTest): Initialize
+            our InjectedBundleTest.
+        (TestWebKitAPI::LoadCanceledNoServerRedirectCallbackTest::willSendRequestForFrame): If we are dealing with a request
+            from the main frame (the main resource in simple-iframe.html), allow it. If not (dealing with the iframe), block
+            the request.
+        (TestWebKitAPI::LoadCanceledNoServerRedirectCallbackTest::didCreatePage): Set up the WKBundlePageResourceLoadClient.
+
+        * TestWebKitAPI/Tests/WebKit2/simple-iframe.html: Added.
+        
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add new files.
+        * TestWebKitAPI/win/TestWebKitAPI.vcproj: Ditto.
+        * TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj: Ditto.
+        * TestWebKitAPI/win/copy-resources.cmd: Ditto.
+
 2011-09-08  David Levin  <le...@chromium.org>
 
         check-webkit-style: Ref|Own Ptr& should be allowed as a parameter.

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (94811 => 94812)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2011-09-08 22:38:44 UTC (rev 94811)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2011-09-08 22:45:12 UTC (rev 94812)
@@ -17,6 +17,9 @@
 		333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */; };
 		33BE5AF5137B5A6C00705813 /* MouseMoveAfterCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */; };
 		33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */; };
+		33DC8911141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33DC8910141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp */; };
+		33DC8912141955FE00747EF7 /* simple-iframe.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 33DC890E1419539300747EF7 /* simple-iframe.html */; };
+		33DC89141419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */; };
 		33E79E06137B5FD900E32D99 /* mouse-move-listener.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */; };
 		37200B9213A16230007A4FAD /* VectorReverse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37200B9113A16230007A4FAD /* VectorReverse.cpp */; };
 		3799AD3A14120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */; };
@@ -108,6 +111,7 @@
 			dstPath = "";
 			dstSubfolderSpec = 7;
 			files = (
+				33DC8912141955FE00747EF7 /* simple-iframe.html in Copy Resources */,
 				1A9E52C913E65EF4006917F5 /* 18-characters.html in Copy Resources */,
 				C07E6CB213FD73930038B22B /* devicePixelRatio.html in Copy Resources */,
 				33E79E06137B5FD900E32D99 /* mouse-move-listener.html in Copy Resources */,
@@ -135,6 +139,9 @@
 		333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; };
 		33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash.cpp; sourceTree = "<group>"; };
 		33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash_Bundle.cpp; sourceTree = "<group>"; };
+		33DC890E1419539300747EF7 /* simple-iframe.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "simple-iframe.html"; sourceTree = "<group>"; };
+		33DC8910141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadCanceledNoServerRedirectCallback.cpp; sourceTree = "<group>"; };
+		33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadCanceledNoServerRedirectCallback_Bundle.cpp; sourceTree = "<group>"; };
 		33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "mouse-move-listener.html"; sourceTree = "<group>"; };
 		37200B9113A16230007A4FAD /* VectorReverse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VectorReverse.cpp; path = WTF/VectorReverse.cpp; sourceTree = "<group>"; };
 		3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringByEvaluatingJavaScriptFromString.mm; sourceTree = "<group>"; };
@@ -339,6 +346,8 @@
 				4BFDFFA61314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp */,
 				BC575AAC126E83B9006F0F12 /* InjectedBundleBasic.cpp */,
 				BC575AAF126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp */,
+				33DC8910141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp */,
+				33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */,
 				33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */,
 				33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */,
 				BC909779125571AB00083756 /* PageLoadBasic.cpp */,
@@ -376,6 +385,7 @@
 				33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */,
 				1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */,
 				C0ADBE8412FCA6B600D2C129 /* simple-form.html */,
+				33DC890E1419539300747EF7 /* simple-iframe.html */,
 				BC909778125571AB00083756 /* simple.html */,
 				C02B7882126615410026BF0F /* spacebar-scrolling.html */,
 			);
@@ -570,6 +580,7 @@
 				A7A966DB140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp in Sources */,
 				939BA91714103412001A01BD /* DeviceScaleFactorOnBack.mm in Sources */,
 				3799AD3A14120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm in Sources */,
+				33DC8911141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -588,6 +599,7 @@
 				BC246D9C132F1FF000B56D7C /* CanHandleRequest_Bundle.cpp in Sources */,
 				33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */,
 				1AEDE22613E5E7E700E62FE8 /* InjectedBundleControllerMac.mm in Sources */,
+				33DC89141419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp (0 => 94812)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp	2011-09-08 22:45:12 UTC (rev 94812)
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2011 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 "_javascript_Test.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+
+#include <WebKit2/WKContext.h>
+#include <WebKit2/WKFrame.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool loadedMainFrame;
+static bool loadedIFrame;
+static bool loadedAllFrames;
+
+static bool performedServerRedirect;
+
+static void didFinishLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef, const void*)
+{
+    if (WKFrameIsMainFrame(frame))
+        loadedMainFrame = true;
+    else
+        loadedIFrame = true;
+
+    loadedAllFrames = loadedMainFrame && loadedIFrame;
+}
+
+static void didPerformServerRedirect(WKContextRef context, WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo)
+{
+    performedServerRedirect = true;
+}
+
+TEST(WebKit2, LoadCanceledNoServerRedirectCallback)
+{
+    WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("LoadCanceledNoServerRedirectCallbackTest"));
+    
+    WKContextInjectedBundleClient injectedBundleClient;
+    memset(&injectedBundleClient, 0, sizeof(injectedBundleClient));
+    injectedBundleClient.version = 0;
+    injectedBundleClient.clientInfo = 0;
+    WKContextSetInjectedBundleClient(context.get(), &injectedBundleClient);
+
+    PlatformWebView webView(context.get());
+
+    WKPageLoaderClient loaderClient;
+    memset(&loaderClient, 0, sizeof(loaderClient));
+    
+    loaderClient.version = 0;
+    loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+    WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+    
+    WKContextHistoryClient historyClient;
+    memset(&historyClient, 0, sizeof(historyClient));
+    
+    historyClient.version = 0;
+    historyClient.didPerformServerRedirect = didPerformServerRedirect;
+    WKContextSetHistoryClient(context.get(), &historyClient);
+
+    WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple-iframe", "html"));
+    WKPageLoadURL(webView.page(), url.get());
+    Util::run(&loadedAllFrames);
+    
+    // We shouldn't have performed a server redirect when the iframe load was cancelled.
+    EXPECT_FALSE(performedServerRedirect);
+}
+
+} // namespace TestWebKitAPI

Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp (0 => 94812)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp	2011-09-08 22:45:12 UTC (rev 94812)
@@ -0,0 +1,71 @@
+/*
+ * 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 "InjectedBundleTest.h"
+#include "PlatformUtilities.h"
+#include "Test.h"
+
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundleFrame.h>
+#include <WebKit2/WKRetainPtr.h>
+
+#include <wtf/Assertions.h>
+
+namespace TestWebKitAPI {
+    
+class LoadCanceledNoServerRedirectCallbackTest : public InjectedBundleTest {
+public:
+    LoadCanceledNoServerRedirectCallbackTest(const std::string& identifier)
+        : InjectedBundleTest(identifier)
+    {
+    }
+    
+    static WKURLRequestRef willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t resourceIdentifier, WKURLRequestRef request, WKURLResponseRef redirectResponse, const void *clientInfo)
+    {
+        // Allow the loading of the main resource, but don't allow the loading of an iframe, return null from willSendRequest.
+        if (WKBundleFrameIsMainFrame(frame)) {
+            WKRetainPtr<WKURLRequestRef> newRequest = request;
+            return newRequest.leakRef();
+        }
+        
+        return 0;
+    }
+
+    virtual void didCreatePage(WKBundleRef bundle, WKBundlePageRef page)
+    {
+        WKBundlePageResourceLoadClient resourceLoadClient;
+        memset(&resourceLoadClient, 0, sizeof(resourceLoadClient));
+        
+        resourceLoadClient.version = 0;
+        resourceLoadClient.willSendRequestForFrame = willSendRequestForFrame;
+
+        WKBundlePageSetResourceLoadClient(page, &resourceLoadClient);
+
+    }
+};
+
+static InjectedBundleTest::Register<LoadCanceledNoServerRedirectCallbackTest> registrar("LoadCanceledNoServerRedirectCallbackTest");
+
+} // namespace TestWebKitAPI

Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2/simple-iframe.html (0 => 94812)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/simple-iframe.html	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/simple-iframe.html	2011-09-08 22:45:12 UTC (rev 94812)
@@ -0,0 +1,6 @@
+<html>
+<body>
+  Simple HTML file.
+  <iframe src=""
+</body>
+</html>

Modified: trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj (94811 => 94812)


--- trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj	2011-09-08 22:38:44 UTC (rev 94811)
+++ trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj	2011-09-08 22:45:12 UTC (rev 94812)
@@ -484,6 +484,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\Tests\WebKit2\LoadCanceledNoServerRedirectCallback.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\Tests\WebKit2\mouse-move-listener.html"
 					>
 				</File>
@@ -520,6 +524,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\Tests\WebKit2\simple-iframe.html"
+					>
+				</File>
+				<File
 					RelativePath="..\Tests\WebKit2\simple.html"
 					>
 				</File>

Modified: trunk/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj (94811 => 94812)


--- trunk/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj	2011-09-08 22:38:44 UTC (rev 94811)
+++ trunk/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj	2011-09-08 22:45:12 UTC (rev 94812)
@@ -420,6 +420,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\Tests\WebKit2\LoadCanceledNoServerRedirectCallback_Bundle.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\Tests\WebKit2\MouseMoveAfterCrash_Bundle.cpp"
 					>
 				</File>

Modified: trunk/Tools/TestWebKitAPI/win/copy-resources.cmd (94811 => 94812)


--- trunk/Tools/TestWebKitAPI/win/copy-resources.cmd	2011-09-08 22:38:44 UTC (rev 94811)
+++ trunk/Tools/TestWebKitAPI/win/copy-resources.cmd	2011-09-08 22:45:12 UTC (rev 94812)
@@ -16,6 +16,7 @@
     ..\Tests\WebKit2\simple.html
     ..\Tests\WebKit2\simple-accelerated-compositing.html
     ..\Tests\WebKit2\simple-form.html
+    ..\Tests\WebKit2\simple-iframe.html
     ..\Tests\WebKit2\spacebar-scrolling.html
 ) do (
     xcopy /y /d %%f "%ResourcesDirectory%"
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to