Diff
Modified: trunk/LayoutTests/ChangeLog (125592 => 125593)
--- trunk/LayoutTests/ChangeLog 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/LayoutTests/ChangeLog 2012-08-14 19:49:40 UTC (rev 125593)
@@ -1,3 +1,14 @@
+2012-08-14 Mikhail Pozdnyakov <[email protected]>
+
+ WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks
+ https://bugs.webkit.org/show_bug.cgi?id=42332
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Unskipped correspondong test cases.
+
+ * platform/wk2/Skipped:
+
2012-08-14 Adam Barth <[email protected]>
DOMWindow::document() should not reach through Frame
Modified: trunk/LayoutTests/platform/wk2/Skipped (125592 => 125593)
--- trunk/LayoutTests/platform/wk2/Skipped 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/LayoutTests/platform/wk2/Skipped 2012-08-14 19:49:40 UTC (rev 125593)
@@ -386,35 +386,6 @@
webarchive/loading/missing-data.html
http/tests/security/xssAuditor/script-tag-with-callbacks.html
-# WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks
-# <https://bugs.webkit.org/show_bug.cgi?id=42332>
-fast/images/support-broken-image-delegate.html
-fast/loader/file-protocol-fragment.html
-fast/loader/main-document-url-for-non-http-loads.html
-fast/loader/user-style-sheet-resource-load-callbacks.html
-http/tests/loading/307-after-303-after-post.html
-http/tests/loading/pdf-commit-load-callbacks.html
-http/tests/loading/redirect-methods.html
-http/tests/misc/favicon-loads-with-images-disabled.html
-http/tests/misc/favicon-loads-with-icon-loading-override.html
-http/tests/misc/link-rel-icon-beforeload.html
-http/tests/misc/will-send-request-returns-null-on-redirect.html
-http/tests/misc/willCacheResponse-delegate-callback.html
-http/tests/misc/window-dot-stop.html
-http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
-http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html
-http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
-http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html
-http/tests/security/XFrameOptions/x-frame-options-deny.html
-http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-allow.html
-http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html
-http/tests/xmlhttprequest/abort-should-cancel-load.html
-security/block-test-no-port.html
-security/block-test.html
-webarchive/loading/cache-expired-subresource.html
-webarchive/loading/test-loading-archive.html
-webarchive/loading/test-loading-archive-subresource-null-mimetype.html
-
# WebKitTestRunner needs textInputController
# <https://bugs.webkit.org/show_bug.cgi?id=42337>
editing/input/setting-input-value-cancel-ime-composition.html
@@ -798,12 +769,25 @@
########################################
### START OF (2) Classified failures without bug reports (yet)
+# WebKitTestRunner needs layoutTestController.shouldPaintBrockenImage
+fast/images/support-broken-image-delegate.html
+
+# WebKitTestRunner needs layoutTestController.setWillSendRequestReturnNullOnRedirect
+http/tests/misc/will-send-request-returns-null-on-redirect.html
+
+# WebKitTestRunner needs ReceiveServerRedirectForProvisionalLoadForFrame logging
+http/tests/loading/307-after-303-after-post.html
+http/tests/loading/redirect-methods.html
+
# WebKitTestrunner needs layoutTestController.dumpSourceAsWebArchive
webarchive/doctype.html
webarchive/archive-empty-frame-source.html
# WebKitTestRunner needs layoutTestController.setIconDatabaseEnabled
webarchive/test-link-rel-icon.html
+http/tests/misc/favicon-loads-with-images-disabled.html
+http/tests/misc/favicon-loads-with-icon-loading-override.html
+http/tests/misc/link-rel-icon-beforeload.html
# WebKitTestRunner should dump text/plain content as text
http/tests/incremental/slow-utf8-text.pl
@@ -1044,6 +1028,9 @@
platform/mac/fast/loader/file-url-mimetypes-2.html
platform/mac/fast/loader/file-url-mimetypes-3.html
platform/mac/fast/loader/file-url-mimetypes.html
+webarchive/loading/cache-expired-subresource.html
+webarchive/loading/test-loading-archive.html
+webarchive/loading/test-loading-archive-subresource-null-mimetype.html
### END OF (2) Classified failures without bug reports (yet)
########################################
@@ -1303,6 +1290,10 @@
# https://bugs.webkit.org/show_bug.cgi?id=81616
fast/harness/page-cache-crash-on-data-urls.html
+# Wrong logging order
+fast/loader/file-protocol-fragment.html
+http/tests/loading/pdf-commit-load-callbacks.html
+
### END OF (3) Unclassified failures
########################################
Modified: trunk/Source/WebCore/ChangeLog (125592 => 125593)
--- trunk/Source/WebCore/ChangeLog 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebCore/ChangeLog 2012-08-14 19:49:40 UTC (rev 125593)
@@ -1,3 +1,14 @@
+2012-08-14 Mikhail Pozdnyakov <[email protected]>
+
+ WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks
+ https://bugs.webkit.org/show_bug.cgi?id=42332
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Provide build for mac.
+
+ * WebCore.exp.in: Added __ZNK7WebCore19ResourceRequestBase20firstPartyForCookiesEv.
+
2012-08-14 Adam Barth <[email protected]>
DOMWindow::document() should not reach through Frame
Modified: trunk/Source/WebCore/WebCore.exp.in (125592 => 125593)
--- trunk/Source/WebCore/WebCore.exp.in 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebCore/WebCore.exp.in 2012-08-14 19:49:40 UTC (rev 125593)
@@ -1216,6 +1216,7 @@
__ZNK7WebCore18PlatformPasteboard11changeCountEv
__ZNK7WebCore19AnimationController24numberOfActiveAnimationsEPNS_8DocumentE
__ZNK7WebCore19InspectorController12getHighlightEPNS_9HighlightE
+__ZNK7WebCore19ResourceRequestBase20firstPartyForCookiesEv
__ZNK7WebCore19ResourceRequestBase10httpMethodEv
__ZNK7WebCore19ResourceRequestBase15httpHeaderFieldEPKc
__ZNK7WebCore19ResourceRequestBase3urlEv
Modified: trunk/Source/WebKit2/ChangeLog (125592 => 125593)
--- trunk/Source/WebKit2/ChangeLog 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebKit2/ChangeLog 2012-08-14 19:49:40 UTC (rev 125593)
@@ -1,3 +1,27 @@
+2012-08-14 Mikhail Pozdnyakov <[email protected]>
+
+ WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks
+ https://bugs.webkit.org/show_bug.cgi?id=42332
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added new getters to WKURL, WKURLRequest, WKURLResponse so that it is possible
+ to dump information necessary for the tests passing.
+
+ * Shared/API/c/WKURL.cpp:
+ (WKURLCopyPath):
+ * Shared/API/c/WKURL.h:
+ * Shared/API/c/WKURLRequest.cpp:
+ (WKURLRequestCopyFirstPartyForCookies):
+ (WKURLRequestCopyHTTPMethod):
+ * Shared/API/c/WKURLRequest.h:
+ * Shared/API/c/WKURLResponse.cpp:
+ (WKURLResponseHTTPStatusCode):
+ * Shared/API/c/WKURLResponse.h:
+ * Shared/WebURL.h:
+ (WebKit::WebURL::path):
+ (WebURL):
+
2012-08-14 Allan Sandfeld Jensen <[email protected]>
[Qt] UpdateAtlas is wasting memory
Modified: trunk/Source/WebKit2/Shared/API/c/WKURL.cpp (125592 => 125593)
--- trunk/Source/WebKit2/Shared/API/c/WKURL.cpp 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebKit2/Shared/API/c/WKURL.cpp 2012-08-14 19:49:40 UTC (rev 125593)
@@ -60,6 +60,11 @@
return toCopiedAPI(toImpl(url)->protocol());
}
+WK_EXPORT WKStringRef WKURLCopyPath(WKURLRef url)
+{
+ return toCopiedAPI(toImpl(url)->path());
+}
+
WKStringRef WKURLCopyLastPathComponent(WKURLRef url)
{
return toCopiedAPI(toImpl(url)->lastPathComponent());
Modified: trunk/Source/WebKit2/Shared/API/c/WKURL.h (125592 => 125593)
--- trunk/Source/WebKit2/Shared/API/c/WKURL.h 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebKit2/Shared/API/c/WKURL.h 2012-08-14 19:49:40 UTC (rev 125593)
@@ -39,6 +39,7 @@
WK_EXPORT WKStringRef WKURLCopyString(WKURLRef url);
WK_EXPORT WKStringRef WKURLCopyHostName(WKURLRef url);
WK_EXPORT WKStringRef WKURLCopyScheme(WKURLRef url);
+WK_EXPORT WKStringRef WKURLCopyPath(WKURLRef url);
WK_EXPORT WKStringRef WKURLCopyLastPathComponent(WKURLRef url);
WK_EXPORT bool WKURLIsEqual(WKURLRef a, WKURLRef b);
Modified: trunk/Source/WebKit2/Shared/API/c/WKURLRequest.cpp (125592 => 125593)
--- trunk/Source/WebKit2/Shared/API/c/WKURLRequest.cpp 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebKit2/Shared/API/c/WKURLRequest.cpp 2012-08-14 19:49:40 UTC (rev 125593)
@@ -48,6 +48,16 @@
return toCopiedURLAPI(toImpl(requestRef)->url());
}
+WKURLRef WKURLRequestCopyFirstPartyForCookies(WKURLRequestRef requestRef)
+{
+ return toCopiedURLAPI(toImpl(requestRef)->resourceRequest().firstPartyForCookies());
+}
+
+WKStringRef WKURLRequestCopyHTTPMethod(WKURLRequestRef requestRef)
+{
+ return toCopiedAPI(toImpl(requestRef)->resourceRequest().httpMethod());
+}
+
void WKURLRequestSetDefaultTimeoutInterval(double timeoutInterval)
{
WebURLRequest::setDefaultTimeoutInterval(timeoutInterval);
Modified: trunk/Source/WebKit2/Shared/API/c/WKURLRequest.h (125592 => 125593)
--- trunk/Source/WebKit2/Shared/API/c/WKURLRequest.h 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebKit2/Shared/API/c/WKURLRequest.h 2012-08-14 19:49:40 UTC (rev 125593)
@@ -38,6 +38,10 @@
WK_EXPORT WKURLRef WKURLRequestCopyURL(WKURLRequestRef);
+WK_EXPORT WKURLRef WKURLRequestCopyFirstPartyForCookies(WKURLRequestRef);
+
+WK_EXPORT WKStringRef WKURLRequestCopyHTTPMethod(WKURLRequestRef);
+
WK_EXPORT void WKURLRequestSetDefaultTimeoutInterval(double);
#ifdef __cplusplus
Modified: trunk/Source/WebKit2/Shared/API/c/WKURLResponse.cpp (125592 => 125593)
--- trunk/Source/WebKit2/Shared/API/c/WKURLResponse.cpp 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebKit2/Shared/API/c/WKURLResponse.cpp 2012-08-14 19:49:40 UTC (rev 125593)
@@ -46,3 +46,8 @@
{
return toCopiedAPI(toImpl(responseRef)->resourceResponse().mimeType());
}
+
+int32_t WKURLResponseHTTPStatusCode(WKURLResponseRef responseRef)
+{
+ return toImpl(responseRef)->resourceResponse().httpStatusCode();
+}
Modified: trunk/Source/WebKit2/Shared/API/c/WKURLResponse.h (125592 => 125593)
--- trunk/Source/WebKit2/Shared/API/c/WKURLResponse.h 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebKit2/Shared/API/c/WKURLResponse.h 2012-08-14 19:49:40 UTC (rev 125593)
@@ -38,6 +38,8 @@
WK_EXPORT WKStringRef WKURLResponseCopyMIMEType(WKURLResponseRef);
+WK_EXPORT int32_t WKURLResponseHTTPStatusCode(WKURLResponseRef);
+
#ifdef __cplusplus
}
#endif
Modified: trunk/Source/WebKit2/Shared/WebURL.h (125592 => 125593)
--- trunk/Source/WebKit2/Shared/WebURL.h 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Source/WebKit2/Shared/WebURL.h 2012-08-14 19:49:40 UTC (rev 125593)
@@ -63,6 +63,12 @@
return m_parsedURL->isValid() ? m_parsedURL->protocol() : String();
}
+ String path() const
+ {
+ parseURLIfNecessary();
+ return m_parsedURL->isValid() ? m_parsedURL->path() : String();
+ }
+
String lastPathComponent() const
{
parseURLIfNecessary();
Modified: trunk/Tools/ChangeLog (125592 => 125593)
--- trunk/Tools/ChangeLog 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Tools/ChangeLog 2012-08-14 19:49:40 UTC (rev 125593)
@@ -1,3 +1,34 @@
+2012-08-14 Mikhail Pozdnyakov <[email protected]>
+
+ WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks
+ https://bugs.webkit.org/show_bug.cgi?id=42332
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Added Resource Callbacks logging. Several aux dumping functions are added.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::isFileScheme):
+ (WTR):
+ (WTR::pathSuitableForTestResult):
+ (WTR::urlSuitableForTestResult):
+ (WTR::InjectedBundlePage::resetAfterTest):
+ (WTR::dumpRequestDescriptionSuitableForTestResult):
+ (WTR::dumpResponseDescriptionSuitableForTestResult):
+ (WTR::dumpErrorDescriptionSuitableForTestResult):
+ (WTR::InjectedBundlePage::didInitiateLoadForResource):
+ (WTR::InjectedBundlePage::willSendRequestForFrame):
+ (WTR::InjectedBundlePage::didReceiveResponseForResource):
+ (WTR::InjectedBundlePage::didFinishLoadForResource):
+ (WTR::InjectedBundlePage::didFailLoadForResource):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpResourceLoadCallbacks):
+ (WTR::LayoutTestController::shouldDumpResourceLoadCallbacks):
+ (LayoutTestController):
+
2012-08-14 Alexis Menard <[email protected]>
Update INdT build bot to Mountain Lion.
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl (125592 => 125593)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl 2012-08-14 19:49:40 UTC (rev 125593)
@@ -44,6 +44,7 @@
void dumpFullScreenCallbacks();
void dumpFrameLoadCallbacks();
void dumpProgressFinishedCallback();
+ void dumpResourceLoadCallbacks();
void dumpResourceResponseMIMETypes();
// Special options.
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (125592 => 125593)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp 2012-08-14 19:49:40 UTC (rev 125593)
@@ -42,6 +42,7 @@
#include <WebKit2/WKBundleNodeHandlePrivate.h>
#include <WebKit2/WKBundlePagePrivate.h>
#include <WebKit2/WKURLRequest.h>
+#include <wtf/HashMap.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
@@ -215,6 +216,58 @@
return stringBuilder.toString();
}
+static inline bool isLocalFileScheme(WKStringRef scheme)
+{
+ return WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "file");
+}
+
+static const char divider = '/';
+
+static inline WTF::String pathSuitableForTestResult(WKURLRef fileUrl)
+{
+ if (!fileUrl)
+ return String();
+
+ WKRetainPtr<WKStringRef> schemeString = adoptWK(WKURLCopyScheme(fileUrl));
+ if (!isLocalFileScheme(schemeString.get()))
+ return toWTFString(adoptWK(WKURLCopyString(fileUrl)));
+
+ String pathString = toWTFString(adoptWK(WKURLCopyPath(fileUrl)));
+ WTF::StringBuilder stringBuilder;
+
+ // Remove the leading path from file urls.
+ const size_t indexBaseName = pathString.reverseFind(divider);
+ if (indexBaseName != notFound) {
+ const size_t indexDirName = pathString.reverseFind(divider, indexBaseName - 1);
+ if (indexDirName != notFound)
+ stringBuilder.append(pathString.substring(indexDirName + 1, indexBaseName - indexDirName - 1));
+ stringBuilder.append(divider);
+ stringBuilder.append(pathString.substring(indexBaseName + 1)); // Filename.
+ } else {
+ stringBuilder.append(divider);
+ stringBuilder.append(pathString); // Return "/pathString".
+ }
+
+ return stringBuilder.toString();
+}
+
+static inline WTF::String urlSuitableForTestResult(WKURLRef fileUrl)
+{
+ if (!fileUrl)
+ return String();
+
+ WKRetainPtr<WKStringRef> schemeString = adoptWK(WKURLCopyScheme(fileUrl));
+ if (!isLocalFileScheme(schemeString.get()))
+ return toWTFString(adoptWK(WKURLCopyString(fileUrl)));
+
+ WTF::String urlString = toWTFString(adoptWK(WKURLCopyString(fileUrl)));
+ const size_t indexBaseName = urlString.reverseFind(divider);
+
+ return (indexBaseName == notFound) ? urlString : urlString.substring(indexBaseName + 1);
+}
+
+static HashMap<uint64_t, String> assignedUrlsCache;
+
InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
: m_page(page)
, m_world(AdoptWK, WKBundleScriptWorldCreateWorld())
@@ -366,6 +419,7 @@
#else
WebCoreTestSupport::resetInternalsObject(context);
#endif
+ assignedUrlsCache.clear();
}
// Loader Client Callbacks
@@ -396,6 +450,70 @@
InjectedBundle::shared().stringBuilder()->append("\"");
}
+static inline void dumpRequestDescriptionSuitableForTestResult(WKURLRequestRef request)
+{
+ WKRetainPtr<WKURLRef> url = ""
+ WKRetainPtr<WKURLRef> firstParty = adoptWK(WKURLRequestCopyFirstPartyForCookies(request));
+ WKRetainPtr<WKStringRef> httpMethod = adoptWK(WKURLRequestCopyHTTPMethod(request));
+
+ InjectedBundle::shared().stringBuilder()->append("<NSURLRequest URL ");
+ InjectedBundle::shared().stringBuilder()->append(pathSuitableForTestResult(url.get()));
+ InjectedBundle::shared().stringBuilder()->append(", main document URL ");
+ InjectedBundle::shared().stringBuilder()->append(urlSuitableForTestResult(firstParty.get()));
+ InjectedBundle::shared().stringBuilder()->append(", http method ");
+
+ if (WKStringIsEmpty(httpMethod.get()))
+ InjectedBundle::shared().stringBuilder()->append("(none)");
+ else
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(httpMethod));
+
+ InjectedBundle::shared().stringBuilder()->append(">");
+}
+
+static inline void dumpResponseDescriptionSuitableForTestResult(WKURLResponseRef response)
+{
+ WKRetainPtr<WKURLRef> url = ""
+ if (!url) {
+ InjectedBundle::shared().stringBuilder()->append("(null)");
+ return;
+ }
+ InjectedBundle::shared().stringBuilder()->append("<NSURLResponse ");
+ InjectedBundle::shared().stringBuilder()->append(pathSuitableForTestResult(url.get()));
+ InjectedBundle::shared().stringBuilder()->append(", http status code ");
+ InjectedBundle::shared().stringBuilder()->append(WTF::String::number(WKURLResponseHTTPStatusCode(response)));
+ InjectedBundle::shared().stringBuilder()->append(">");
+}
+
+static inline void dumpErrorDescriptionSuitableForTestResult(WKErrorRef error)
+{
+ WKRetainPtr<WKStringRef> errorDomain = adoptWK(WKErrorCopyDomain(error));
+ int errorCode = WKErrorGetErrorCode(error);
+
+ // We need to do some error mapping here to match the test expectations (Mac error names are expected).
+ if (WKStringIsEqualToUTF8CString(errorDomain.get(), "WebKitNetworkError")) {
+ errorDomain = adoptWK(WKStringCreateWithUTF8CString("NSURLErrorDomain"));
+ errorCode = -999;
+ }
+
+ if (WKStringIsEqualToUTF8CString(errorDomain.get(), "WebKitPolicyError"))
+ errorDomain = adoptWK(WKStringCreateWithUTF8CString("WebKitErrorDomain"));
+
+ InjectedBundle::shared().stringBuilder()->append("<NSError domain ");
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(errorDomain));
+ InjectedBundle::shared().stringBuilder()->append(", code ");
+ InjectedBundle::shared().stringBuilder()->append(String::number(errorCode));
+
+ WKRetainPtr<WKURLRef> url = ""
+ if (url.get()) {
+ WKRetainPtr<WKStringRef> urlString = adoptWK(WKURLCopyString(url.get()));
+ InjectedBundle::shared().stringBuilder()->append(", failing URL \"");
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(urlString));
+ InjectedBundle::shared().stringBuilder()->append("\"");
+ }
+
+ InjectedBundle::shared().stringBuilder()->append(">");
+}
+
void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didStartProvisionalLoadForFrame(frame);
@@ -938,8 +1056,16 @@
{
}
-void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef, bool)
+void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef request, bool)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().layoutTestController()->shouldDumpResourceLoadCallbacks())
+ return;
+
+ WKRetainPtr<WKURLRef> url = ""
+ assignedUrlsCache.add(identifier, pathSuitableForTestResult(url.get()));
}
// Resource Load Client Callbacks
@@ -954,11 +1080,23 @@
return WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "http") || WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "https");
}
-WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t, WKURLRequestRef request, WKURLResponseRef)
+WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t identifier, WKURLRequestRef request, WKURLResponseRef response)
{
if (InjectedBundle::shared().isTestRunning() && InjectedBundle::shared().layoutTestController()->willSendRequestReturnsNull())
return 0;
+ if (InjectedBundle::shared().isTestRunning()
+ && InjectedBundle::shared().layoutTestController()->shouldDumpResourceLoadCallbacks()) {
+ InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier)
+ ? assignedUrlsCache.get(identifier)
+ : "<unknown>");
+ InjectedBundle::shared().stringBuilder()->append(" - willSendRequest ");
+ dumpRequestDescriptionSuitableForTestResult(request);
+ InjectedBundle::shared().stringBuilder()->append(" redirectResponse ");
+ dumpResponseDescriptionSuitableForTestResult(response);
+ InjectedBundle::shared().stringBuilder()->append("\n");
+ }
+
WKRetainPtr<WKURLRef> url = ""
WKRetainPtr<WKStringRef> host = adoptWK(WKURLCopyHostName(url.get()));
WKRetainPtr<WKStringRef> scheme = adoptWK(WKURLCopyScheme(url.get()));
@@ -990,11 +1128,21 @@
return request;
}
-void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKURLResponseRef response)
+void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLResponseRef response)
{
if (!InjectedBundle::shared().isTestRunning())
return;
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpResourceLoadCallbacks()) {
+ InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier)
+ ? assignedUrlsCache.get(identifier)
+ : "<unknown>");
+ InjectedBundle::shared().stringBuilder()->append(" - didReceiveResponse ");
+ dumpResponseDescriptionSuitableForTestResult(response);
+ InjectedBundle::shared().stringBuilder()->append("\n");
+ }
+
+
if (!InjectedBundle::shared().layoutTestController()->shouldDumpResourceResponseMIMETypes())
return;
@@ -1012,12 +1160,35 @@
{
}
-void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t)
+void InjectedBundlePage::didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().layoutTestController()->shouldDumpResourceLoadCallbacks())
+ return;
+
+ InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier)
+ ? assignedUrlsCache.get(identifier)
+ : "<unknown>");
+ InjectedBundle::shared().stringBuilder()->append(" - didFinishLoading\n");
}
-void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKErrorRef)
+void InjectedBundlePage::didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKErrorRef error)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().layoutTestController()->shouldDumpResourceLoadCallbacks())
+ return;
+
+ InjectedBundle::shared().stringBuilder()->append(assignedUrlsCache.contains(identifier)
+ ? assignedUrlsCache.get(identifier)
+ : "<unknown>");
+ InjectedBundle::shared().stringBuilder()->append(" - didFailLoadingWithError: ");
+
+ dumpErrorDescriptionSuitableForTestResult(error);
+ InjectedBundle::shared().stringBuilder()->append("\n");
}
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp (125592 => 125593)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp 2012-08-14 19:49:40 UTC (rev 125593)
@@ -77,6 +77,7 @@
, m_dumpFullScreenCallbacks(false)
, m_dumpFrameLoadCallbacks(false)
, m_dumpProgressFinishedCallback(false)
+ , m_dumpResourceLoadCallbacks(false)
, m_dumpResourceResponseMIMETypes(false)
, m_waitToDump(false)
, m_testRepaint(false)
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h (125592 => 125593)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h 2012-08-14 19:47:59 UTC (rev 125592)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h 2012-08-14 19:49:40 UTC (rev 125593)
@@ -79,6 +79,7 @@
void dumpFullScreenCallbacks() { m_dumpFullScreenCallbacks = true; }
void dumpFrameLoadCallbacks() { setShouldDumpFrameLoadCallbacks(true); }
void dumpProgressFinishedCallback() { setShouldDumpProgressFinishedCallback(true); }
+ void dumpResourceLoadCallbacks() { m_dumpResourceLoadCallbacks = true; }
void dumpResourceResponseMIMETypes() { m_dumpResourceResponseMIMETypes = true; }
void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
@@ -163,6 +164,7 @@
bool shouldDumpFullScreenCallbacks() const { return m_dumpFullScreenCallbacks; }
bool shouldDumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; }
bool shouldDumpProgressFinishedCallback() const { return m_dumpProgressFinishedCallback; }
+ bool shouldDumpResourceLoadCallbacks() const { return m_dumpResourceLoadCallbacks; }
bool shouldDumpResourceResponseMIMETypes() const { return m_dumpResourceResponseMIMETypes; }
bool isPolicyDelegateEnabled() const { return m_policyDelegateEnabled; }
@@ -249,6 +251,7 @@
bool m_dumpFullScreenCallbacks;
bool m_dumpFrameLoadCallbacks;
bool m_dumpProgressFinishedCallback;
+ bool m_dumpResourceLoadCallbacks;
bool m_dumpResourceResponseMIMETypes;
bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
bool m_testRepaint;