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

Side by Side Diff: content/test/net/url_request_failed_job.cc

Issue 11346016: Move remaining content test code into the content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « content/test/net/url_request_failed_job.h ('k') | content/test/net/url_request_mock_http_job.h » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/test/net/url_request_failed_job.h" 5 #include "content/test/net/url_request_failed_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
12 #include "net/url_request/url_request.h" 12 #include "net/url_request/url_request.h"
13 #include "net/url_request/url_request_filter.h" 13 #include "net/url_request/url_request_filter.h"
14 14
15 namespace content {
15 namespace { 16 namespace {
16 17
17 const char kMockHostname[] = "mock.failed.request"; 18 const char kMockHostname[] = "mock.failed.request";
18 19
19 // Gets the numeric net error code from URL of the form: 20 // Gets the numeric net error code from URL of the form:
20 // scheme://kMockHostname/error_code. The error code must be a valid 21 // scheme://kMockHostname/error_code. The error code must be a valid
21 // net error code, and not net::OK or net::ERR_IO_PENDING. 22 // net error code, and not net::OK or net::ERR_IO_PENDING.
22 int GetErrorCode(net::URLRequest* request) { 23 int GetErrorCode(net::URLRequest* request) {
23 int net_error; 24 int net_error;
24 std::string path = request->url().path(); 25 std::string path = request->url().path();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 net::NetworkDelegate* network_delegate, 83 net::NetworkDelegate* network_delegate,
83 const std::string& scheme) { 84 const std::string& scheme) {
84 return new URLRequestFailedJob( 85 return new URLRequestFailedJob(
85 request, network_delegate, GetErrorCode(request)); 86 request, network_delegate, GetErrorCode(request));
86 } 87 }
87 88
88 void URLRequestFailedJob::StartAsync() { 89 void URLRequestFailedJob::StartAsync() {
89 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, 90 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED,
90 net_error_)); 91 net_error_));
91 } 92 }
93
94 } // namespace content
OLDNEW
« no previous file with comments | « content/test/net/url_request_failed_job.h ('k') | content/test/net/url_request_mock_http_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698