WKTR doesn't implement dumpWillCacheResponse()

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

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-05
Reviewed by Kenneth Rohde Christiansen.

Tools:

Define shouldCacheResponse() callback in resource
load client and provide implementation for
dumpWillCacheResponse() in WebKitTestRunner.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::shouldCacheResponse):
(WTR):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
(InjectedBundlePage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::TestRunner):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::dumpWillCacheResponse):
(WTR::TestRunner::shouldDumpWillCacheResponse):
(TestRunner):

LayoutTests:

Unskip http/tests/misc/willCacheResponse-delegate-callback.html
now that WebKitTestRunner implements dumpWillCacheResponse().

* platform/efl-wk2/TestExpectations:
* platform/wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 478c5093
2012-09-05 Christophe Dumez <christophe.dumez@intel.com>
WKTR doesn't implement dumpWillCacheResponse()
https://bugs.webkit.org/show_bug.cgi?id=94607
Reviewed by Kenneth Rohde Christiansen.
Unskip http/tests/misc/willCacheResponse-delegate-callback.html
now that WebKitTestRunner implements dumpWillCacheResponse().
* platform/efl-wk2/TestExpectations:
* platform/wk2/Skipped:
2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com>
[DRT] LTC:: Move printing related APIs from LayoutTestController to Internals
......@@ -234,9 +234,6 @@ BUGWK87088 : fast/js/names.html = TEXT PASS
BUGWK84589 : http/tests/security/cross-frame-access-call.html = TEXT PASS
BUGWK94194 : http/tests/security/frameNavigation/inactive-function-in-popup-navigate-child.html = TEXT PASS
// WTR doesn't implement dumpWillCacheResponse()
BUGWK94607 : http/tests/misc/willCacheResponse-delegate-callback.html = TEXT
// Unclassified failures
BUGWKEFL : editing/execCommand/delete-selection-has-style.html = TEXT
BUGWKEFL : editing/execCommand/format-block-multiple-paragraphs-in-pre.html = TEXT
......
......@@ -654,10 +654,6 @@ inspector/geolocation-error.html
inspector/geolocation-success.html
inspector/geolocation-watchPosition.html
# WKTR doesn't implement dumpWillCacheResponse()
# https://bugs.webkit.org/show_bug.cgi?id=94607
http/tests/misc/willCacheResponse-delegate-callback.html
### END OF (1) Classified failures with bug reports
########################################
......
2012-09-05 Christophe Dumez <christophe.dumez@intel.com>
WKTR doesn't implement dumpWillCacheResponse()
https://bugs.webkit.org/show_bug.cgi?id=94607
Reviewed by Kenneth Rohde Christiansen.
Define shouldCacheResponse() callback in resource
load client and provide implementation for
dumpWillCacheResponse() in WebKitTestRunner.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::shouldCacheResponse):
(WTR):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
(InjectedBundlePage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::TestRunner):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::dumpWillCacheResponse):
(WTR::TestRunner::shouldDumpWillCacheResponse):
(TestRunner):
2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com>
[DRT] LTC:: Move printing related APIs from LayoutTestController to Internals
......
......@@ -46,6 +46,7 @@ module WTR {
void dumpProgressFinishedCallback();
void dumpResourceLoadCallbacks();
void dumpResourceResponseMIMETypes();
void dumpWillCacheResponse();
// Special options.
void keepWebHistory();
......
......@@ -317,7 +317,7 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
didReceiveContentLengthForResource,
didFinishLoadForResource,
didFailLoadForResource,
0, // shouldCacheResponse
shouldCacheResponse,
0 // shouldUseCredentialStorage
};
WKBundlePageSetResourceLoadClient(m_page, &resourceLoadClient);
......@@ -706,6 +706,11 @@ void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef page, WKBundleFr
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailLoadForResource(page, frame, identifier, error);
}
bool InjectedBundlePage::shouldCacheResponse(WKBundlePageRef page, WKBundleFrameRef frame, uint64_t identifier, const void* clientInfo)
{
return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldCacheResponse(page, frame, identifier);
}
void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame)
{
if (!InjectedBundle::shared().isTestRunning())
......@@ -1204,6 +1209,21 @@ void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRe
InjectedBundle::shared().stringBuilder()->append("\n");
}
bool InjectedBundlePage::shouldCacheResponse(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier)
{
if (!InjectedBundle::shared().isTestRunning())
return true;
if (!InjectedBundle::shared().testRunner()->shouldDumpWillCacheResponse())
return true;
InjectedBundle::shared().stringBuilder()->append(WTF::String::number(identifier));
InjectedBundle::shared().stringBuilder()->append(" - willCacheResponse: called\n");
// The default behavior is the cache the response.
return true;
}
// Policy Client Callbacks
......
......@@ -77,6 +77,7 @@ private:
static void didReceiveContentLengthForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, uint64_t length, const void*);
static void didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, const void*);
static void didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef, const void*);
static bool shouldCacheResponse(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, const void*);
static void didReceiveIntentForFrame(WKBundlePageRef, WKBundleFrameRef, WKBundleIntentRequestRef, WKTypeRef*, const void*);
static void registerIntentServiceForFrame(WKBundlePageRef, WKBundleFrameRef, WKIntentServiceInfoRef, WKTypeRef*, const void*);
......@@ -105,6 +106,7 @@ private:
void didReceiveContentLengthForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, uint64_t length);
void didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier);
void didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef);
bool shouldCacheResponse(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier);
// WKBundlePagePolicyClient
static WKBundlePagePolicyAction decidePolicyForNavigationAction(WKBundlePageRef, WKBundleFrameRef, WKBundleNavigationActionRef, WKURLRequestRef, WKTypeRef*, const void*);
......
......@@ -79,6 +79,7 @@ TestRunner::TestRunner()
, m_dumpProgressFinishedCallback(false)
, m_dumpResourceLoadCallbacks(false)
, m_dumpResourceResponseMIMETypes(false)
, m_dumpWillCacheResponse(false)
, m_waitToDump(false)
, m_testRepaint(false)
, m_testRepaintSweepHorizontally(false)
......
......@@ -81,6 +81,7 @@ public:
void dumpProgressFinishedCallback() { setShouldDumpProgressFinishedCallback(true); }
void dumpResourceLoadCallbacks() { m_dumpResourceLoadCallbacks = true; }
void dumpResourceResponseMIMETypes() { m_dumpResourceResponseMIMETypes = true; }
void dumpWillCacheResponse() { m_dumpWillCacheResponse = true; }
void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
void setShouldDumpProgressFinishedCallback(bool value) { m_dumpProgressFinishedCallback = value; }
......@@ -164,6 +165,7 @@ public:
bool shouldDumpProgressFinishedCallback() const { return m_dumpProgressFinishedCallback; }
bool shouldDumpResourceLoadCallbacks() const { return m_dumpResourceLoadCallbacks; }
bool shouldDumpResourceResponseMIMETypes() const { return m_dumpResourceResponseMIMETypes; }
bool shouldDumpWillCacheResponse() const { return m_dumpWillCacheResponse; }
bool isPolicyDelegateEnabled() const { return m_policyDelegateEnabled; }
bool isPolicyDelegatePermissive() const { return m_policyDelegatePermissive; }
......@@ -257,6 +259,7 @@ private:
bool m_dumpProgressFinishedCallback;
bool m_dumpResourceLoadCallbacks;
bool m_dumpResourceResponseMIMETypes;
bool m_dumpWillCacheResponse;
bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
bool m_testRepaint;
bool m_testRepaintSweepHorizontally;
......
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