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

Side by Side Diff: webkit/tools/test_shell/test_webview_delegate.cc

Issue 5012005: Modify GetErrorDescription to give a -1004 on NETWORK_ACCESS_DENIED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/tools/test_shell/test_webview_delegate.h" 9 #include "webkit/tools/test_shell/test_webview_delegate.h"
10 10
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 218
219 std::string GetErrorDescription(const WebURLError& error) { 219 std::string GetErrorDescription(const WebURLError& error) {
220 std::string domain = UTF16ToASCII(error.domain); 220 std::string domain = UTF16ToASCII(error.domain);
221 int code = error.reason; 221 int code = error.reason;
222 222
223 if (domain == net::kErrorDomain) { 223 if (domain == net::kErrorDomain) {
224 domain = "NSURLErrorDomain"; 224 domain = "NSURLErrorDomain";
225 switch (error.reason) { 225 switch (error.reason) {
226 case net::ERR_ABORTED: 226 case net::ERR_ABORTED:
227 // NSURLErrorCancelled
227 code = -999; 228 code = -999;
228 break; 229 break;
229 case net::ERR_UNSAFE_PORT: 230 case net::ERR_UNSAFE_PORT:
230 // Our unsafe port checking happens at the network stack level, but we 231 // Our unsafe port checking happens at the network stack level, but we
231 // make this translation here to match the behavior of stock WebKit. 232 // make this translation here to match the behavior of stock WebKit.
232 domain = "WebKitErrorDomain"; 233 domain = "WebKitErrorDomain";
233 code = 103; 234 code = 103;
234 break; 235 break;
235 case net::ERR_ADDRESS_INVALID: 236 case net::ERR_ADDRESS_INVALID:
236 case net::ERR_ADDRESS_UNREACHABLE: 237 case net::ERR_ADDRESS_UNREACHABLE:
238 case net::ERR_NETWORK_ACCESS_DENIED:
239 // NSURLErrorCannotConnectToHost
237 code = -1004; 240 code = -1004;
238 break; 241 break;
239 } 242 }
240 } else { 243 } else {
241 DLOG(WARNING) << "Unknown error domain"; 244 DLOG(WARNING) << "Unknown error domain";
242 } 245 }
243 246
244 return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">", 247 return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">",
245 domain.c_str(), code, error.unreachableURL.spec().data()); 248 domain.c_str(), code, error.unreachableURL.spec().data());
246 } 249 }
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 } 1350 }
1348 1351
1349 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { 1352 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) {
1350 fake_rect_ = rect; 1353 fake_rect_ = rect;
1351 using_fake_rect_ = true; 1354 using_fake_rect_ = true;
1352 } 1355 }
1353 1356
1354 WebRect TestWebViewDelegate::fake_window_rect() { 1357 WebRect TestWebViewDelegate::fake_window_rect() {
1355 return fake_rect_; 1358 return fake_rect_;
1356 } 1359 }
OLDNEW
« webkit/support/webkit_support.cc ('K') | « webkit/tools/layout_tests/test_expectations.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698