Commit 21dd7f94 authored by carlosgc@webkit.org's avatar carlosgc@webkit.org
Browse files

[BlackBerry] Handle testRunner.setCustomPolicyDelegate()

https://bugs.webkit.org/show_bug.cgi?id=117982

Patch by Carlos Garcia Campos <cargarcia@blackberry.com> on 2013-06-26
Reviewed by Rob Buis.

Source/WebKit/blackberry:

Take custom policy into account when deciding the policy for
navigation actions.

Fixes test fast/loader/onload-policy-ignore-for-frame.html.

* Api/DumpRenderTreeClient.h:
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNavigationAction):
If custom policy is enabled ignore the navigation action when it's
not permissive.

Tools:

* DumpRenderTree/blackberry/DumpRenderTree.cpp:
(BlackBerry::WebKit::DumpRenderTree::DumpRenderTree): Initialize
m_policyDelegateIsPermissive.
(BlackBerry::WebKit::DumpRenderTree::resetToConsistentStateBeforeTesting):
Reset m_policyDelegateIsPermissive.
(BlackBerry::WebKit::DumpRenderTree::setCustomPolicyDelegate): Set
m_policyDelegateIsPermissive.
* DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:
(BlackBerry::WebKit::DumpRenderTree::policyDelegateEnabled):
Return whether custom policy is enabled.
(BlackBerry::WebKit::DumpRenderTree::policyDelegateIsPermissive):
Return whether custom policy is permissive.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 14792a6b
......@@ -60,6 +60,8 @@ public:
virtual void didDecidePolicyForResponse(const WebCore::ResourceResponse&) = 0;
virtual void didDispatchWillPerformClientRedirect() = 0;
virtual void didHandleOnloadEventsForFrame(WebCore::Frame*) = 0;
virtual bool policyDelegateIsPermissive() const = 0;
virtual bool policyDelegateEnabled() const = 0;
// ChromeClient delegates
virtual void addMessageToConsole(const String& message, unsigned lineNumber, unsigned columnNumber, const String& sourceID) = 0;
......
2013-06-26 Carlos Garcia Campos <cargarcia@blackberry.com>
[BlackBerry] Handle testRunner.setCustomPolicyDelegate()
https://bugs.webkit.org/show_bug.cgi?id=117982
Reviewed by Rob Buis.
Take custom policy into account when deciding the policy for
navigation actions.
Fixes test fast/loader/onload-policy-ignore-for-frame.html.
* Api/DumpRenderTreeClient.h:
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNavigationAction):
If custom policy is enabled ignore the navigation action when it's
not permissive.
2013-06-26 Kangil Han <kangil.han@samsung.com>
Adopt is/toHTMLAreaElement for code cleanup
......
......@@ -222,8 +222,11 @@ void FrameLoaderClientBlackBerry::dispatchDecidePolicyForNavigationAction(FrameP
if (decision == PolicyIgnore)
dispatchDidCancelClientRedirect();
if (m_webPagePrivate->m_dumpRenderTree)
if (m_webPagePrivate->m_dumpRenderTree) {
m_webPagePrivate->m_dumpRenderTree->didDecidePolicyForNavigationAction(action, request, m_frame);
if (m_webPagePrivate->m_dumpRenderTree->policyDelegateEnabled())
decision = m_webPagePrivate->m_dumpRenderTree->policyDelegateIsPermissive() ? PolicyUse : PolicyIgnore;
}
(m_frame->loader()->policyChecker()->*function)(decision);
}
......
2013-06-26 Carlos Garcia Campos <cargarcia@blackberry.com>
[BlackBerry] Handle testRunner.setCustomPolicyDelegate()
https://bugs.webkit.org/show_bug.cgi?id=117982
Reviewed by Rob Buis.
* DumpRenderTree/blackberry/DumpRenderTree.cpp:
(BlackBerry::WebKit::DumpRenderTree::DumpRenderTree): Initialize
m_policyDelegateIsPermissive.
(BlackBerry::WebKit::DumpRenderTree::resetToConsistentStateBeforeTesting):
Reset m_policyDelegateIsPermissive.
(BlackBerry::WebKit::DumpRenderTree::setCustomPolicyDelegate): Set
m_policyDelegateIsPermissive.
* DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:
(BlackBerry::WebKit::DumpRenderTree::policyDelegateEnabled):
Return whether custom policy is enabled.
(BlackBerry::WebKit::DumpRenderTree::policyDelegateIsPermissive):
Return whether custom policy is permissive.
2013-06-26 Anders Carlsson <andersca@apple.com>
Deprecate StringImpl::charactersWithNullTermination
......
......@@ -183,6 +183,7 @@ DumpRenderTree::DumpRenderTree(BlackBerry::WebKit::WebPage* page)
, m_workTimer(this, &DumpRenderTree::processWork)
, m_acceptsEditing(true)
, m_policyDelegateEnabled(false)
, m_policyDelegateIsPermissive(false)
{
const char* workerNumber = getenv("WORKER_NUMBER") ? getenv("WORKER_NUMBER") : "0";
String sdcardPath = SDCARD_PATH;
......@@ -298,6 +299,7 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting(const String& url, cons
topLoadingFrame = 0;
m_loadFinished = false;
m_policyDelegateEnabled = false;
m_policyDelegateIsPermissive = false;
waitForPolicy = false;
testDone = false;
WorkQueue::shared()->clear();
......@@ -969,7 +971,7 @@ bool DumpRenderTree::didReceiveAuthenticationChallenge(WebCore::Credential& cred
void DumpRenderTree::setCustomPolicyDelegate(bool setDelegate, bool permissive)
{
m_policyDelegateEnabled = setDelegate;
UNUSED_PARAM(permissive);
m_policyDelegateIsPermissive = permissive;
}
}
}
......
......@@ -77,6 +77,8 @@ public:
void didDispatchWillPerformClientRedirect();
void didHandleOnloadEventsForFrame(WebCore::Frame*);
void didReceiveResponseForFrame(WebCore::Frame*, const WebCore::ResourceResponse&);
bool policyDelegateEnabled() const { return m_policyDelegateEnabled; }
bool policyDelegateIsPermissive() const { return m_policyDelegateIsPermissive; }
// ChromeClient delegates
void addMessageToConsole(const String& message, unsigned lineNumber, const String& sourceID);
......@@ -148,6 +150,7 @@ private:
bool m_acceptsEditing;
bool m_loadFinished;
bool m_policyDelegateEnabled;
bool m_policyDelegateIsPermissive;
};
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment