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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/tools/test_shell/test_webview_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains the implementation of TestWebViewDelegate, which serves 5 // This file contains the implementation of TestWebViewDelegate, which serves
6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to
7 // have initialized a MessageLoop before these methods are called. 7 // have initialized a MessageLoop before these methods are called.
8 8
9 #include "config.h" 9 #include "config.h"
10 10
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 result = WebKit::WebNavigationPolicyIgnore; 650 result = WebKit::WebNavigationPolicyIgnore;
651 } 651 }
652 if (policy_delegate_should_notify_done_) 652 if (policy_delegate_should_notify_done_)
653 shell_->layout_test_controller()->PolicyDelegateDone(); 653 shell_->layout_test_controller()->PolicyDelegateDone();
654 } else { 654 } else {
655 result = default_policy; 655 result = default_policy;
656 } 656 }
657 return result; 657 return result;
658 } 658 }
659 659
660 bool TestWebViewDelegate::canHandleRequest(const WebURLRequest& request) {
661 GURL url = request.url();
662 // Just reject the scheme used in
663 // LayoutTests/http/tests/misc/redirect-to-external-url.html
664 return url.scheme() != "spaceballs";
darin (slow to review) 2009/10/16 15:44:04 nit: it is recommended to use the SchemeIs functio
665 }
666
667 WebURLError TestWebViewDelegate::cannotShowURLError(
668 const WebURLRequest& request) {
669 WebURLError error;
670 // 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
671 // unableToImplementPolicyWithError() below prints them.
672 error.domain = WebString::fromUTF8("WebKitErrorDomain");
673 error.reason = 101;
674 error.unreachableURL = request.url();
675 return error;
676 }
677
678 void TestWebViewDelegate::unableToImplementPolicyWithError(
679 WebFrame* frame, const WebURLError& error) {
680 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
681 printf("Policy delegate: unable to implement policy with error domain '%s', "
682 "error code %d, in frame '%s'\n",
683 domain.data(), error.reason, frame->name().utf8().data());
684 }
685
660 void TestWebViewDelegate::willPerformClientRedirect( 686 void TestWebViewDelegate::willPerformClientRedirect(
661 WebFrame* frame, const WebURL& from, const WebURL& to, 687 WebFrame* frame, const WebURL& from, const WebURL& to,
662 double interval, double fire_time) { 688 double interval, double fire_time) {
663 if (shell_->ShouldDumpFrameLoadCallbacks()) { 689 if (shell_->ShouldDumpFrameLoadCallbacks()) {
664 printf("%S - willPerformClientRedirectToURL: %s \n", 690 printf("%S - willPerformClientRedirectToURL: %s \n",
665 GetFrameDescription(frame).c_str(), 691 GetFrameDescription(frame).c_str(),
666 to.spec().data()); 692 to.spec().data());
667 } 693 }
668 } 694 }
669 695
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 } 1138 }
1113 1139
1114 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { 1140 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) {
1115 fake_rect_ = rect; 1141 fake_rect_ = rect;
1116 using_fake_rect_ = true; 1142 using_fake_rect_ = true;
1117 } 1143 }
1118 1144
1119 WebRect TestWebViewDelegate::fake_window_rect() { 1145 WebRect TestWebViewDelegate::fake_window_rect() {
1120 return fake_rect_; 1146 return fake_rect_;
1121 } 1147 }
OLDNEW
« 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