Chromium Code Reviews| 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) { |