2011-04-11 Sam Weinig <sam@webkit.org>
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2011 02:10:14 +0000 (02:10 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2011 02:10:14 +0000 (02:10 +0000)
        Reviewed by Anders Carlsson.

        REGRESSION(r77974): http/tests/security/aboutBlank/security-context-window-open.html is failing
        <rdar://problem/8981346>
        https://bugs.webkit.org/show_bug.cgi?id=54159

        * platform/mac-wk2/Skipped:
        Remove http/tests/security/aboutBlank/security-context-window-open.html from the skipped list.
2011-04-11  Sam Weinig  <sam@webkit.org>

        Reviewed by Anders Carlsson.

        REGRESSION(r77974): http/tests/security/aboutBlank/security-context-window-open.html is failing
        <rdar://problem/8981346>
        https://bugs.webkit.org/show_bug.cgi?id=54159

        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
        (WTR::InjectedBundlePage::InjectedBundlePage):
        (WTR::InjectedBundlePage::decidePolicyForNavigationAction):
        (WTR::InjectedBundlePage::decidePolicyForNewWindowAction):
        (WTR::InjectedBundlePage::decidePolicyForResponse):
        (WTR::InjectedBundlePage::unableToImplementPolicy):
        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
        Add short-circuited policy client which matches WebKit1.

        * WebKitTestRunner/TestController.cpp:
        (WTR::TestController::resetStateToConsistentValues):
        Clear the cache between tests to ensure consistent results.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83550 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/Skipped
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
Tools/WebKitTestRunner/TestController.cpp

index b9ff912..021d1ea 100644 (file)
@@ -1,3 +1,14 @@
+2011-04-11  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        REGRESSION(r77974): http/tests/security/aboutBlank/security-context-window-open.html is failing
+        <rdar://problem/8981346>
+        https://bugs.webkit.org/show_bug.cgi?id=54159
+
+        * platform/mac-wk2/Skipped:
+        Remove http/tests/security/aboutBlank/security-context-window-open.html from the skipped list.
+
 2011-04-11  Ryosuke Niwa  <rniwa@webkit.org>
 
         Reviewed by Tony Chang.
index e37481b..49b018a 100644 (file)
@@ -1492,10 +1492,6 @@ fast/dom/global-constructors.html
 # <rdar://problem/8735596>
 compositing/tiling/huge-layer-resize.html
 
-# REGRESSION(r77974): http/tests/security/aboutBlank/security-context-window-open.html is failing
-# <https://bugs.webkit.org/show_bug.cgi?id=54159>
-http/tests/security/aboutBlank/security-context-window-open.html
-
 # transitions/default-timing-function.html failing on WebKit2 since it was added
 # <https://bugs.webkit.org/show_bug.cgi?id=56531>
 transitions/default-timing-function.html
index 4bf19bb..9ee2c7b 100644 (file)
@@ -1,3 +1,24 @@
+2011-04-11  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        REGRESSION(r77974): http/tests/security/aboutBlank/security-context-window-open.html is failing
+        <rdar://problem/8981346>
+        https://bugs.webkit.org/show_bug.cgi?id=54159
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::InjectedBundlePage):
+        (WTR::InjectedBundlePage::decidePolicyForNavigationAction):
+        (WTR::InjectedBundlePage::decidePolicyForNewWindowAction):
+        (WTR::InjectedBundlePage::decidePolicyForResponse):
+        (WTR::InjectedBundlePage::unableToImplementPolicy):
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+        Add short-circuited policy client which matches WebKit1.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetStateToConsistentValues):
+        Clear the cache between tests to ensure consistent results.
+
 2011-04-11  George Guo  <George.Guo@nokia.com>
 
         Reviewed by Eric Seidel.
index 471552f..ee7d9fd 100644 (file)
@@ -202,6 +202,16 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
     };
     WKBundlePageSetResourceLoadClient(m_page, &resourceLoadClient);
 
+    WKBundlePagePolicyClient policyClient = {
+        0,
+        this,
+        decidePolicyForNavigationAction,
+        decidePolicyForNewWindowAction,
+        decidePolicyForResponse,
+        unableToImplementPolicy
+    };
+    WKBundlePageSetPolicyClient(m_page, &policyClient);
+
     WKBundlePageUIClient uiClient = {
         0,
         this,
@@ -669,6 +679,48 @@ void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRe
 {
 }
 
+
+// Policy Client Callbacks
+
+WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNavigationAction(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleNavigationActionRef navigationAction, WKURLRequestRef request, WKTypeRef* userData, const void* clientInfo)
+{
+    return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->decidePolicyForNavigationAction(page, frame, navigationAction, request, userData);
+}
+
+WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNewWindowAction(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleNavigationActionRef navigationAction, WKURLRequestRef request, WKStringRef frameName, WKTypeRef* userData, const void* clientInfo)
+{
+    return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->decidePolicyForNewWindowAction(page, frame, navigationAction, request, frameName, userData);
+}
+
+WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForResponse(WKBundlePageRef page, WKBundleFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, WKTypeRef* userData, const void* clientInfo)
+{
+    return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->decidePolicyForResponse(page, frame, response, request, userData);
+}
+
+void InjectedBundlePage::unableToImplementPolicy(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef error, WKTypeRef* userData, const void* clientInfo)
+{
+    static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->unableToImplementPolicy(page, frame, error, userData);
+}
+
+WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNavigationAction(WKBundlePageRef, WKBundleFrameRef, WKBundleNavigationActionRef, WKURLRequestRef request, WKTypeRef*)
+{
+    return WKBundlePagePolicyActionUse;
+}
+
+WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNewWindowAction(WKBundlePageRef, WKBundleFrameRef, WKBundleNavigationActionRef, WKURLRequestRef, WKStringRef, WKTypeRef*)
+{
+    return WKBundlePagePolicyActionUse;
+}
+
+WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForResponse(WKBundlePageRef, WKBundleFrameRef, WKURLResponseRef, WKURLRequestRef, WKTypeRef*)
+{
+    return WKBundlePagePolicyActionUse;
+}
+
+void InjectedBundlePage::unableToImplementPolicy(WKBundlePageRef, WKBundleFrameRef, WKErrorRef, WKTypeRef*)
+{
+}
+
 // UI Client Callbacks
 
 void InjectedBundlePage::willAddMessageToConsole(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo)
index 2c3e9df..2236bd1 100644 (file)
@@ -94,6 +94,16 @@ private:
     void didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier);
     void didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef);
 
+    // WKBundlePagePolicyClient
+    static WKBundlePagePolicyAction decidePolicyForNavigationAction(WKBundlePageRef, WKBundleFrameRef, WKBundleNavigationActionRef, WKURLRequestRef, WKTypeRef*, const void*);
+    static WKBundlePagePolicyAction decidePolicyForNewWindowAction(WKBundlePageRef, WKBundleFrameRef, WKBundleNavigationActionRef, WKURLRequestRef, WKStringRef frameName, WKTypeRef*, const void*);
+    static WKBundlePagePolicyAction decidePolicyForResponse(WKBundlePageRef, WKBundleFrameRef, WKURLResponseRef, WKURLRequestRef, WKTypeRef*, const void*);
+    static void unableToImplementPolicy(WKBundlePageRef, WKBundleFrameRef, WKErrorRef, WKTypeRef*, const void*);
+    WKBundlePagePolicyAction decidePolicyForNavigationAction(WKBundlePageRef, WKBundleFrameRef, WKBundleNavigationActionRef, WKURLRequestRef, WKTypeRef*);
+    WKBundlePagePolicyAction decidePolicyForNewWindowAction(WKBundlePageRef, WKBundleFrameRef, WKBundleNavigationActionRef, WKURLRequestRef, WKStringRef frameName, WKTypeRef*);
+    WKBundlePagePolicyAction decidePolicyForResponse(WKBundlePageRef, WKBundleFrameRef, WKURLResponseRef, WKURLRequestRef, WKTypeRef*);
+    void unableToImplementPolicy(WKBundlePageRef, WKBundleFrameRef, WKErrorRef, WKTypeRef*);
+
     // UI Client
     static void willAddMessageToConsole(WKBundlePageRef, WKStringRef message, uint32_t lineNumber, const void* clientInfo);
     static void willSetStatusbarText(WKBundlePageRef, WKStringRef statusbarText, const void* clientInfo);
index 6093afc..c6203c1 100644 (file)
@@ -33,6 +33,7 @@
 #include <WebKit2/WKContextPrivate.h>
 #include <WebKit2/WKPageGroup.h>
 #include <WebKit2/WKPreferencesPrivate.h>
+#include <WebKit2/WKResourceCacheManager.h>
 #include <WebKit2/WKRetainPtr.h>
 #include <wtf/PassOwnPtr.h>
 
@@ -377,6 +378,9 @@ bool TestController::resetStateToConsistentValues()
     WKPreferencesSetSansSerifFontFamily(preferences, sansSerifFontFamily);
     WKPreferencesSetSerifFontFamily(preferences, serifFontFamily);
 
+    WKResourceCacheManagerRef cacheManager = WKContextGetResourceCacheManager(m_context.get());
+    WKResourceCacheManagerClearCacheForAllOrigins(cacheManager, WKResourceCachesToClearAll);
+
     m_mainWebView->focus();
 
     // Reset main page back to about:blank