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

Side by Side Diff: content/test/net/url_request_mock_http_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
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_mock_http_job.h" 5 #include "content/test/net/url_request_mock_http_job.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 11 matching lines...) Expand all
22 22
23 // This is the file path leading to the root of the directory to use as the 23 // This is the file path leading to the root of the directory to use as the
24 // root of the http server. This returns a reference that can be assigned to. 24 // root of the http server. This returns a reference that can be assigned to.
25 FilePath& BasePath() { 25 FilePath& BasePath() {
26 CR_DEFINE_STATIC_LOCAL(FilePath, base_path, ()); 26 CR_DEFINE_STATIC_LOCAL(FilePath, base_path, ());
27 return base_path; 27 return base_path;
28 } 28 }
29 29
30 } // namespace 30 } // namespace
31 31
32 namespace content {
33
32 // static 34 // static
33 net::URLRequestJob* URLRequestMockHTTPJob::Factory( 35 net::URLRequestJob* URLRequestMockHTTPJob::Factory(
34 net::URLRequest* request, 36 net::URLRequest* request,
35 net::NetworkDelegate* network_delegate, 37 net::NetworkDelegate* network_delegate,
36 const std::string& scheme) { 38 const std::string& scheme) {
37 return new URLRequestMockHTTPJob(request, 39 return new URLRequestMockHTTPJob(request,
38 network_delegate, 40 network_delegate,
39 GetOnDiskPath(BasePath(), request, scheme)); 41 GetOnDiskPath(BasePath(), request, scheme));
40 } 42 }
41 43
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 if (info.headers) 134 if (info.headers)
133 return info.headers->response_code(); 135 return info.headers->response_code();
134 return net::URLRequestJob::GetResponseCode(); 136 return net::URLRequestJob::GetResponseCode();
135 } 137 }
136 138
137 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) { 139 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) {
138 net::HttpResponseInfo info; 140 net::HttpResponseInfo info;
139 GetResponseInfo(&info); 141 GetResponseInfo(&info);
140 return info.headers && info.headers->GetCharset(charset); 142 return info.headers && info.headers->GetCharset(charset);
141 } 143 }
144
145 } // namespace content
OLDNEW
« no previous file with comments | « content/test/net/url_request_mock_http_job.h ('k') | content/test/net/url_request_slow_download_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698