Skip to content

Instantly share code, notes, and snippets.

@Smith1123
Created August 19, 2011 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Smith1123/1156343 to your computer and use it in GitHub Desktop.
Save Smith1123/1156343 to your computer and use it in GitHub Desktop.
setCustomPolicyDelegate
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
index f1468d0..a62c850 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
@@ -44,6 +44,7 @@ module WTR {
// Special options.
void keepWebHistory();
+ void setCustomPolicyDelegate(in boolean enabled, in boolean permissive);
void setAcceptsEditing(in boolean value);
void setCanOpenWindows(in boolean value);
void setCloseRemainingWindowsWhenComplete(in boolean value);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index 9c80ad0..5173cd5 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -750,15 +750,13 @@ WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNavigationAction(WKB
if (!InjectedBundle::shared().layoutTestController()->isPolicyDelegateEnabled())
return WKBundlePagePolicyActionUse;
- if (InjectedBundle::shared().layoutTestController()->waitToDump()) {
- InjectedBundle::shared().os() << "Policy delegate: attempt to load " << adoptWK(WKURLRequestCopyURL(request)) << " with navigation type \'" << navigationTypeToString(WKBundleNavigationActionGetNavigationType(navigationAction)) << "\'";
- WKBundleHitTestResultRef hitTestResultRef = WKBundleNavigationActionCopyHitTestResult(navigationAction);
- if (hitTestResultRef)
- InjectedBundle::shared().os() << " originating from " << dumpPath(m_page, m_world.get(), WKBundleHitTestResultCopyNodeHandle(hitTestResultRef));
-
- InjectedBundle::shared().os() << "\n";
- InjectedBundle::shared().layoutTestController()->notifyDone();
- }
+ InjectedBundle::shared().os() << "Policy delegate: attempt to load " << adoptWK(WKURLRequestCopyURL(request)) << " with navigation type \'" << navigationTypeToString(WKBundleNavigationActionGetNavigationType(navigationAction)) << "\'";
+ WKBundleHitTestResultRef hitTestResultRef = WKBundleNavigationActionCopyHitTestResult(navigationAction);
+ if (hitTestResultRef)
+ InjectedBundle::shared().os() << " originating from " << dumpPath(m_page, m_world.get(), WKBundleHitTestResultCopyNodeHandle(hitTestResultRef));
+
+ InjectedBundle::shared().os() << "\n";
+ InjectedBundle::shared().layoutTestController()->notifyDone();
if (InjectedBundle::shared().layoutTestController()->isPolicyDelegatePermissive())
return WKBundlePagePolicyActionUse;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment