summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 08:00:02 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 08:00:02 +0000
commit3184770afa9cbcf49680bab5046c57a7ca035388 (patch)
tree13a9bc2a635bc23bcdab1368acaf3740dfafd406 /chrome/browser/net
parentcba313cf4f0dd47d76992947e711d41bd6448598 (diff)
downloadchromium_src-3184770afa9cbcf49680bab5046c57a7ca035388.zip
chromium_src-3184770afa9cbcf49680bab5046c57a7ca035388.tar.gz
chromium_src-3184770afa9cbcf49680bab5046c57a7ca035388.tar.bz2
Browser and unit test cases for patch submitted for Issue 23584 under
http://codereview.chromium.org/660264. BUG=23584 TEST=covered by unit tests and browser tests Original patch by Chamal De Silva <chamal.desilva@gmail.com> at http://codereview.chromium.org/669262/show Review URL: http://codereview.chromium.org/1562017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43934 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/url_request_mock_http_job.cc9
-rw-r--r--chrome/browser/net/url_request_mock_http_job.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/net/url_request_mock_http_job.cc b/chrome/browser/net/url_request_mock_http_job.cc
index ee516a5..a35cd1e 100644
--- a/chrome/browser/net/url_request_mock_http_job.cc
+++ b/chrome/browser/net/url_request_mock_http_job.cc
@@ -8,6 +8,7 @@
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
+#include "chrome/common/url_constants.h"
#include "net/base/net_util.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_filter.h"
@@ -45,6 +46,14 @@ GURL URLRequestMockHTTPJob::GetMockUrl(const FilePath& path) {
}
/* static */
+GURL URLRequestMockHTTPJob::GetMockViewSourceUrl(const FilePath& path) {
+ std::string url = chrome::kViewSourceScheme;
+ url.append(":");
+ url.append(GetMockUrl(path).spec());
+ return GURL(url);
+}
+
+/* static */
FilePath URLRequestMockHTTPJob::GetOnDiskPath(const FilePath& base_path,
URLRequest* request,
const std::string& scheme) {
diff --git a/chrome/browser/net/url_request_mock_http_job.h b/chrome/browser/net/url_request_mock_http_job.h
index 34f949b..b54dd37 100644
--- a/chrome/browser/net/url_request_mock_http_job.h
+++ b/chrome/browser/net/url_request_mock_http_job.h
@@ -30,6 +30,10 @@ class URLRequestMockHTTPJob : public URLRequestFileJob {
// Given the path to a file relative to base_path_, construct a mock URL.
static GURL GetMockUrl(const FilePath& path);
+ // Given the path to a file relative to base_path_,
+ // construct a mock URL for view source.
+ static GURL GetMockViewSourceUrl(const FilePath& path);
+
protected:
virtual ~URLRequestMockHTTPJob() { }