Fixed multiple API test failures after r158764.
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Nov 2013 23:53:02 +0000 (23:53 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Nov 2013 23:53:02 +0000 (23:53 +0000)
Reviewed by Sam Weinig.

* UIProcess/API/mac/WKBrowsingContextController.mm:
(setUpPagePolicyClient): If the delegate isn’t set or doesn’t respond to a selector, respond
with WKFramePolicyListenerUse().

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm

index 0705c7e..0dd81dc 100644 (file)
@@ -1,3 +1,13 @@
+2013-11-06  Dan Bernstein  <mitz@apple.com>
+
+        Fixed multiple API test failures after r158764.
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/API/mac/WKBrowsingContextController.mm:
+        (setUpPagePolicyClient): If the delegate isn’t set or doesn’t respond to a selector, respond
+        with WKFramePolicyListenerUse().
+
 2013-11-06  Anders Carlsson  <andersca@apple.com>
 
         Move allowed classes handling to decodeObject
index f869ba7..85e5458 100644 (file)
@@ -630,7 +630,8 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
             };
             
             [browsingContext.policyDelegate browsingContextController:browsingContext decidePolicyForNavigationAction:actionDictionary decisionHandler:makePolicyDecisionBlock(listener)];
-        }
+        } else
+            WKFramePolicyListenerUse(listener);
     };
 
     policyClient.decidePolicyForNewWindowAction = [](WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
@@ -647,8 +648,8 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
             };
             
             [browsingContext.policyDelegate browsingContextController:browsingContext decidePolicyForNewWindowAction:actionDictionary decisionHandler:makePolicyDecisionBlock(listener)];
-        }
-
+        } else
+            WKFramePolicyListenerUse(listener);
     };
 
     policyClient.decidePolicyForResponse = [](WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
@@ -662,7 +663,8 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
             };
 
             [browsingContext.policyDelegate browsingContextController:browsingContext decidePolicyForResponseAction:actionDictionary decisionHandler:makePolicyDecisionBlock(listener)];
-        }
+        } else
+            WKFramePolicyListenerUse(listener);
     };
 
     WKPageSetPagePolicyClient(pageRef, &policyClient);