[EFL][DRT] EFL's DRT navigation_policy_decision implementation

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

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-05-31
Reviewed by Tor Arne Vestbø.

Tools:

Added navigation_policy_decision implementation for DumpRenderTreeView.
Added LayoutTestController::setCustomPolicyDelegate implementation.
Modified LayoutTestController::waitForPolicyDelegate.

* DumpRenderTree/efl/DumpRenderTree.cpp:
* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):
* DumpRenderTree/efl/DumpRenderTreeEfl.h:
* DumpRenderTree/efl/DumpRenderTreeView.cpp:
(navigationTypeToString): aux function
(onNavigationPolicyDecision): navigation_policy_decision implementation
(drtViewAdd):
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::setCustomPolicyDelegate):
(LayoutTestController::waitForPolicyDelegate):

LayoutTests:

Unskipped corresponding tests. Those still not passing are put into
test_expectations.txt.

* platform/efl/Skipped:
* platform/efl/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent db644939
2012-05-31 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
[EFL][DRT] EFL's DRT navigation_policy_decision implementation
https://bugs.webkit.org/show_bug.cgi?id=85006
Reviewed by Tor Arne Vestbø.
Unskipped corresponding tests. Those still not passing are put into
test_expectations.txt.
* platform/efl/Skipped:
* platform/efl/test_expectations.txt:
2012-05-31 Jussi Kukkonen <jussi.kukkonen@intel.com>
[EFL][DRT] LayoutTestController does not implement clearApplicationCacheForOrigin
......
......@@ -115,13 +115,6 @@ fast/history/visited-generated-content-test.html
fast/history/visited-link-background-color.html
fast/history/window-open.html
# EFL's LayoutTestController does not implement setCustomPolicyDelegate
fast/loader/javascript-url-hierarchical-execution.html
fast/loader/onload-policy-ignore-for-frame.html
fast/loader/policy-delegate-action-hit-test-zoomed.html
fast/loader/reload-policy-delegate.html
http/tests/download
# EFL's LayoutTestController does not implement setScrollbarPolicy
fast/overflow/scrollbar-restored-and-then-locked.html
......@@ -207,37 +200,9 @@ fast/html/set-text-direction.html
# https://bugs.webkit.org/show_bug.cgi?id=40361
editing/text-iterator/findString-selection-disabled.html
# EFL's DRT (DumpRenderTreeView) needs to implement navigation_policy_decision
fast/encoding/mailto-always-utf-8.html
fast/forms/mailto/advanced-get.html
fast/forms/mailto/advanced-put.html
fast/forms/mailto/formenctype-attribute-button-html.html
fast/forms/mailto/formenctype-attribute-input-html.html
fast/forms/mailto/get-multiple-items-text-plain.html
fast/forms/mailto/get-multiple-items-x-www-form-urlencoded.html
fast/forms/mailto/get-multiple-items.html
fast/forms/mailto/get-non-ascii-always-utf-8.html
fast/forms/mailto/get-non-ascii-text-plain-latin-1.html
fast/forms/mailto/get-non-ascii-text-plain.html
fast/forms/mailto/get-non-ascii.html
fast/forms/mailto/get-overwrite-query.html
fast/forms/mailto/post-append-query.html
fast/forms/mailto/post-multiple-items-multipart-form-data.html
fast/forms/mailto/post-multiple-items-text-plain.html
fast/forms/mailto/post-multiple-items-x-www-form-urlencoded.html
fast/forms/mailto/post-multiple-items.html
fast/forms/mailto/post-text-plain-with-accept-charset.html
fast/forms/mailto/post-text-plain.html
# Need to add functionality to DumpRenderTree to handle error pages
fast/history/back-forward-reset-after-error-handling.html
# Missing delegates: tests failing because of missing policy delegate callbacks.
fast/loader/onload-policy-ignore-for-frame.html
fast/loader/policy-delegate-action-hit-test-zoomed.html
fast/loader/reload-policy-delegate.html
fast/loader/stop-provisional-loads.html
# Relies on WebKit API [WebView _loadBackForwardListFromOtherView:]
fast/loader/crash-copying-backforwardlist.html
......@@ -887,6 +852,8 @@ fast/forms/input-paste-undo.html
fast/forms/input-placeholder-visibility-1.html
fast/forms/input-step-as-double.html
fast/forms/input-text-scroll-left-on-blur.html
fast/forms/mailto/advanced-get.html
fast/forms/mailto/advanced-put.html
fast/forms/number/spin-button-events.html
fast/forms/number/spin-in-multi-column.html
fast/forms/placeholder-position.html
......
......@@ -354,6 +354,16 @@ BUGWK61540 : http/tests/security/isolatedWorld/cross-origin-xhr.html = FAIL
//__worldID is undefined in isolated world
BUGWKEFL SKIP : http/tests/security/isolatedWorld/didClearWindowObject.html = FAIL
// Needs custom policy delegate enhancement to log downloads - EFL port is missing api for getting header fields from HTTP responses.
BUGWK87974 : http/tests/download = FAIL
// Needs custom policy delegate enhancement to log DOM node info - EFL port is missing DOM node abstraction
BUGWK87972 : fast/loader/stop-provisional-loads.html = FAIL
BUGWK87972 : fast/loader/policy-delegate-action-hit-test-zoomed.html = FAIL
BUGWK87972 : fast/encoding/mailto-always-utf-8.html = FAIL
BUGWK87972 : fast/forms/mailto/formenctype-attribute-button-html.html = FAIL
BUGWK87972 : fast/forms/mailto/formenctype-attribute-input-html.html = FAIL
// EFL's LayoutTestController does not implement layerTreeAsText
BUGWK82294 : compositing/animation/animation-compositing.html = TEXT
BUGWK82294 : compositing/geometry/ancestor-overflow-change.html = TEXT
......
2012-05-31 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
[EFL][DRT] EFL's DRT navigation_policy_decision implementation
https://bugs.webkit.org/show_bug.cgi?id=85006
Reviewed by Tor Arne Vestbø.
Added navigation_policy_decision implementation for DumpRenderTreeView.
Added LayoutTestController::setCustomPolicyDelegate implementation.
Modified LayoutTestController::waitForPolicyDelegate.
* DumpRenderTree/efl/DumpRenderTree.cpp:
* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):
* DumpRenderTree/efl/DumpRenderTreeEfl.h:
* DumpRenderTree/efl/DumpRenderTreeView.cpp:
(navigationTypeToString): aux function
(onNavigationPolicyDecision): navigation_policy_decision implementation
(drtViewAdd):
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::setCustomPolicyDelegate):
(LayoutTestController::waitForPolicyDelegate):
2012-05-31 Jussi Kukkonen <jussi.kukkonen@intel.com>
[EFL][DRT] LayoutTestController does not implement clearApplicationCacheForOrigin
......
......@@ -54,6 +54,8 @@
OwnPtr<DumpRenderTreeChrome> browser;
Evas_Object* topLoadingFrame = 0;
bool waitForPolicy = false;
bool policyDelegateEnabled = false;
bool policyDelegatePermissive = false;
Ecore_Timer* waitToDumpWatchdog = 0;
extern Ewk_History_Item* prevTestBFItem;
......
......@@ -273,6 +273,9 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
ewk_intent_request_unref(m_currentIntentRequest);
m_currentIntentRequest = 0;
}
policyDelegateEnabled = false;
policyDelegatePermissive = false;
}
static CString pathSuitableForTestResult(const char* uriString)
......
......@@ -36,6 +36,8 @@ class DumpRenderTreeChrome;
extern OwnPtr<DumpRenderTreeChrome> browser;
extern Evas_Object* topLoadingFrame;
extern bool waitForPolicy;
extern bool policyDelegateEnabled;
extern bool policyDelegatePermissive;
extern Ecore_Timer* waitToDumpWatchdog;
#endif /* DumpRenderTreeEfl_h */
......@@ -28,6 +28,7 @@
#include "DumpRenderTree.h"
#include "DumpRenderTreeChrome.h"
#include "DumpRenderTreeEfl.h"
#include "LayoutTestController.h"
#include <EWebKit.h>
#include <Ecore.h>
......@@ -152,6 +153,40 @@ static bool chooseAndInitializeAppropriateSmartClass(Ewk_View_Smart_Class* api)
return shouldUseSingleBackingStore() ? ewk_view_single_smart_set(api) : ewk_view_tiled_smart_set(api);
}
// Taken from the file "WebKit/Tools/DumpRenderTree/chromium/WebViewHost.cpp".
static inline const char* navigationTypeToString(const Ewk_Navigation_Type type)
{
switch (type) {
case EWK_NAVIGATION_TYPE_LINK_CLICKED:
return "link clicked";
case EWK_NAVIGATION_TYPE_FORM_SUBMITTED:
return "form submitted";
case EWK_NAVIGATION_TYPE_BACK_FORWARD:
return "back/forward";
case EWK_NAVIGATION_TYPE_RELOAD:
return "reload";
case EWK_NAVIGATION_TYPE_FORM_RESUBMITTED:
return "form resubmitted";
case EWK_NAVIGATION_TYPE_OTHER:
return "other";
}
return "illegal value";
}
static Eina_Bool onNavigationPolicyDecision(Ewk_View_Smart_Data*, Ewk_Frame_Resource_Request* request, Ewk_Navigation_Type navigationType)
{
if (!policyDelegateEnabled)
return true;
printf("Policy delegate: attempt to load %s with navigation type '%s'\n", urlSuitableForTestResult(request->url).utf8().data(),
navigationTypeToString(navigationType));
if (gLayoutTestController)
gLayoutTestController->notifyDone();
return policyDelegatePermissive;
}
Evas_Object* drtViewAdd(Evas* evas)
{
static Ewk_View_Smart_Class api = EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("DRT_View");
......@@ -170,6 +205,7 @@ Evas_Object* drtViewAdd(Evas* evas)
api.window_close = onWindowClose;
api.exceeded_application_cache_quota = onExceededApplicationCacheQuota;
api.exceeded_database_quota = onExceededDatabaseQuota;
api.navigation_policy_decision = onNavigationPolicyDecision;
return evas_object_smart_add(evas, evas_smart_class_new(&api.sc));
}
......@@ -202,13 +202,15 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
ewk_cookies_policy_set(alwaysAcceptCookies ? EWK_COOKIE_JAR_ACCEPT_ALWAYS : EWK_COOKIE_JAR_ACCEPT_NEVER);
}
void LayoutTestController::setCustomPolicyDelegate(bool, bool)
void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive)
{
notImplemented();
policyDelegateEnabled = enabled;
policyDelegatePermissive = permissive;
}
void LayoutTestController::waitForPolicyDelegate()
{
setCustomPolicyDelegate(true, false);
waitForPolicy = true;
setWaitToDump(true);
}
......
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