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

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

Issue 15950011: content: Move kViewSourceScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « content/renderer/render_view_impl.cc ('k') | net/base/net_util.cc » ('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_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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 url.append(kMockHostname); 88 url.append(kMockHostname);
89 url.append("/"); 89 url.append("/");
90 std::string path_str = path.MaybeAsASCII(); 90 std::string path_str = path.MaybeAsASCII();
91 DCHECK(!path_str.empty()); // We only expect ASCII paths in tests. 91 DCHECK(!path_str.empty()); // We only expect ASCII paths in tests.
92 url.append(path_str); 92 url.append(path_str);
93 return GURL(url); 93 return GURL(url);
94 } 94 }
95 95
96 // static 96 // static
97 GURL URLRequestMockHTTPJob::GetMockViewSourceUrl(const base::FilePath& path) { 97 GURL URLRequestMockHTTPJob::GetMockViewSourceUrl(const base::FilePath& path) {
98 std::string url = chrome::kViewSourceScheme; 98 std::string url = kViewSourceScheme;
99 url.append(":"); 99 url.append(":");
100 url.append(GetMockUrl(path).spec()); 100 url.append(GetMockUrl(path).spec());
101 return GURL(url); 101 return GURL(url);
102 } 102 }
103 103
104 // static 104 // static
105 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 105 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
106 URLRequestMockHTTPJob::CreateProtocolHandler(const base::FilePath& base_path) { 106 URLRequestMockHTTPJob::CreateProtocolHandler(const base::FilePath& base_path) {
107 return scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>( 107 return scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(
108 new ProtocolHandler(base_path, false)); 108 new ProtocolHandler(base_path, false));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return net::URLRequestJob::GetResponseCode(); 162 return net::URLRequestJob::GetResponseCode();
163 } 163 }
164 164
165 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) { 165 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) {
166 net::HttpResponseInfo info; 166 net::HttpResponseInfo info;
167 GetResponseInfo(&info); 167 GetResponseInfo(&info);
168 return info.headers && info.headers->GetCharset(charset); 168 return info.headers && info.headers->GetCharset(charset);
169 } 169 }
170 170
171 } // namespace content 171 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698