Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1734)

Unified Diff: Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp

Issue 14495011: Revert "Create errors (especially cancellation errors) internally to WebCore, rather" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
index 087c70273db94c54a353b8e8f053c6545660e10a..01ca2d4ca4b770dc07f52221b1f32d6148d92b26 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp
@@ -1252,6 +1252,25 @@ void WebTestProxyBase::willRequestResource(WebFrame* frame, const WebKit::WebCac
}
}
+bool WebTestProxyBase::canHandleRequest(WebFrame*, const WebURLRequest& request)
+{
+ GURL url = request.url();
+ // Just reject the scheme used in
+ // LayoutTests/http/tests/misc/redirect-to-external-url.html
+ return !url.SchemeIs("spaceballs");
+}
+
+WebURLError WebTestProxyBase::cannotHandleRequestError(WebFrame*, const WebURLRequest& request)
+{
+ WebURLError error;
+ // A WebKit layout test expects the following values.
+ // unableToImplementPolicyWithError() below prints them.
+ error.domain = WebString::fromUTF8("WebKitErrorDomain");
+ error.reason = 101;
+ error.unreachableURL = request.url();
+ return error;
+}
+
void WebTestProxyBase::didCreateDataSource(WebFrame*, WebDataSource* ds)
{
if (!m_testInterfaces->testRunner()->deferMainResourceDataLoad())
@@ -1382,6 +1401,15 @@ void WebTestProxyBase::didFailResourceLoad(WebFrame*, unsigned identifier, const
m_resourceIdentifierMap.erase(identifier);
}
+void WebTestProxyBase::unableToImplementPolicyWithError(WebKit::WebFrame* frame, const WebKit::WebURLError& error)
+{
+ char errorBuffer[40];
+ snprintf(errorBuffer, sizeof(errorBuffer), "%d", error.reason);
+ m_delegate->printMessage(string("Policy delegate: unable to implement policy with error domain '") + error.domain.utf8().data() +
+ "', error code " + errorBuffer +
+ ", in frame '" + frame->uniqueName().utf8().data() + "'\n");
+}
+
void WebTestProxyBase::didAddMessageToConsole(const WebConsoleMessage& message, const WebString& sourceName, unsigned sourceLine)
{
// This matches win DumpRenderTree's UIDelegate.cpp.
« no previous file with comments | « Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h ('k') | Tools/DumpRenderTree/chromium/WebViewHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698