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

Unified Diff: webkit/tools/test_shell/test_webview_delegate.cc

Issue 271087: LTTF: Implement WebFrameLoaderClient::dispatchUnableToImplementPolicy() and so on (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « webkit/tools/test_shell/test_webview_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_webview_delegate.cc
===================================================================
--- webkit/tools/test_shell/test_webview_delegate.cc (revision 29248)
+++ webkit/tools/test_shell/test_webview_delegate.cc (working copy)
@@ -657,6 +657,32 @@
return result;
}
+bool TestWebViewDelegate::canHandleRequest(const WebURLRequest& request) {
+ GURL url = request.url();
+ // Just reject the scheme used in
+ // LayoutTests/http/tests/misc/redirect-to-external-url.html
+ return url.scheme() != "spaceballs";
darin (slow to review) 2009/10/16 15:44:04 nit: it is recommended to use the SchemeIs functio
+}
+
+WebURLError TestWebViewDelegate::cannotShowURLError(
+ const WebURLRequest& request) {
+ WebURLError error;
+ // A WebKit's layout test expects the following values.
darin (slow to review) 2009/10/16 15:44:04 nit: no "'s" on WebKit here
+ // unableToImplementPolicyWithError() below prints them.
+ error.domain = WebString::fromUTF8("WebKitErrorDomain");
+ error.reason = 101;
+ error.unreachableURL = request.url();
+ return error;
+}
+
+void TestWebViewDelegate::unableToImplementPolicyWithError(
+ WebFrame* frame, const WebURLError& error) {
+ std::string domain = UTF16ToASCII(error.domain);
darin (slow to review) 2009/10/16 15:44:04 you could also use "error.domain.utf8()" here. ei
+ printf("Policy delegate: unable to implement policy with error domain '%s', "
+ "error code %d, in frame '%s'\n",
+ domain.data(), error.reason, frame->name().utf8().data());
+}
+
void TestWebViewDelegate::willPerformClientRedirect(
WebFrame* frame, const WebURL& from, const WebURL& to,
double interval, double fire_time) {
« no previous file with comments | « webkit/tools/test_shell/test_webview_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698