Title: [131229] trunk/Tools
Revision
131229
Author
[email protected]
Date
2012-10-12 15:02:54 -0700 (Fri, 12 Oct 2012)

Log Message

[Qt][WK2] REGRESSION(r131057): It made plugins/plugin-document-back-forward.html timeout
https://bugs.webkit.org/show_bug.cgi?id=99152

Patch by Mikhail Pozdnyakov <[email protected]> on 2012-10-12
Reviewed by Simon Fraser.

Even though Response was already checked in WTR WKBundlePagePolicyClient decidePolicyForResponse callback,
this check did not take plugins into consideration when deciding whether we can show the given MIME type or not
so added another check in WTR UI process which also includes plugins.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::decidePolicyForResponse):
* WebKitTestRunner/TestController.h:
(TestController):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (131228 => 131229)


--- trunk/Tools/ChangeLog	2012-10-12 22:00:45 UTC (rev 131228)
+++ trunk/Tools/ChangeLog	2012-10-12 22:02:54 UTC (rev 131229)
@@ -1,3 +1,19 @@
+2012-10-12  Mikhail Pozdnyakov  <[email protected]>
+
+        [Qt][WK2] REGRESSION(r131057): It made plugins/plugin-document-back-forward.html timeout
+        https://bugs.webkit.org/show_bug.cgi?id=99152
+
+        Reviewed by Simon Fraser.
+
+        Even though Response was already checked in WTR WKBundlePagePolicyClient decidePolicyForResponse callback,
+        this check did not take plugins into consideration when deciding whether we can show the given MIME type or not
+        so added another check in WTR UI process which also includes plugins.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::decidePolicyForResponse):
+        * WebKitTestRunner/TestController.h:
+        (TestController):
+
 2012-10-12  Rob Buis  <[email protected]>
 
         [BlackBerry] Add tests of WebSocketEnabled preference

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (131228 => 131229)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2012-10-12 22:00:45 UTC (rev 131228)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2012-10-12 22:02:54 UTC (rev 131229)
@@ -1070,14 +1070,21 @@
     WKFramePolicyListenerUse(listener);
 }
 
-void TestController::decidePolicyForResponse(WKPageRef, WKFrameRef, WKURLResponseRef, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo)
+void TestController::decidePolicyForResponse(WKPageRef, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo)
 {
-    static_cast<TestController*>(const_cast<void*>(clientInfo))->decidePolicyForResponse(listener);
+    static_cast<TestController*>(const_cast<void*>(clientInfo))->decidePolicyForResponse(frame, response, listener);
 }
 
-void TestController::decidePolicyForResponse(WKFramePolicyListenerRef listener)
+void TestController::decidePolicyForResponse(WKFrameRef frame, WKURLResponseRef response, WKFramePolicyListenerRef listener)
 {
-    // Response was already checked by WKBundlePagePolicyClient, so if we are here we're supposed to ignore.
+    // Even though Response was already checked by WKBundlePagePolicyClient, the check did not include plugins
+    // so we have to re-check again.
+    WKRetainPtr<WKStringRef> wkMIMEType(AdoptWK, WKURLResponseCopyMIMEType(response));
+    if (WKFrameCanShowMIMEType(frame, wkMIMEType.get())) {
+        WKFramePolicyListenerUse(listener);
+        return;
+    }
+
     WKFramePolicyListenerIgnore(listener);
 }
 

Modified: trunk/Tools/WebKitTestRunner/TestController.h (131228 => 131229)


--- trunk/Tools/WebKitTestRunner/TestController.h	2012-10-12 22:00:45 UTC (rev 131228)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2012-10-12 22:02:54 UTC (rev 131229)
@@ -118,7 +118,7 @@
     void decidePolicyForNavigationAction(WKFramePolicyListenerRef);
 
     static void decidePolicyForResponse(WKPageRef, WKFrameRef, WKURLResponseRef, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
-    void decidePolicyForResponse(WKFramePolicyListenerRef);
+    void decidePolicyForResponse(WKFrameRef, WKURLResponseRef, WKFramePolicyListenerRef);
 
     static WKPageRef createOtherPage(WKPageRef oldPage, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to