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

Unified Diff: chrome/browser/policy/cloud/test_request_interceptor.cc

Issue 16102004: Adding browsertest to verify that updating forced-installed extensions is possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/cloud/test_request_interceptor.h ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/cloud/test_request_interceptor.cc
diff --git a/chrome/browser/policy/cloud/test_request_interceptor.cc b/chrome/browser/policy/cloud/test_request_interceptor.cc
index 7805a26e565b74209336a4e41fe106ab397cf505..b36b63dd375ec3d19541b27332fd8f2962a8ef2e 100644
--- a/chrome/browser/policy/cloud/test_request_interceptor.cc
+++ b/chrome/browser/policy/cloud/test_request_interceptor.cc
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_utils.h"
+#include "content/test/net/url_request_mock_http_job.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
#include "net/base/upload_bytes_element_reader.h"
@@ -54,6 +55,15 @@ net::URLRequestJob* BadRequestJobCallback(
request, network_delegate, headers, std::string(), true);
}
+net::URLRequestJob* FileJobCallback(const base::FilePath& file_path,
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) {
+ return new content::URLRequestMockHTTPJob(
+ request,
+ network_delegate,
+ file_path);
+}
+
// Parses the upload data in |request| into |request_msg|, and validates the
// request. The query string in the URL must contain the |expected_type| for
// the "request" parameter. Returns true if all checks succeeded, and the
@@ -254,4 +264,10 @@ TestRequestInterceptor::JobCallback TestRequestInterceptor::RegisterJob(
return base::Bind(&RegisterJobCallback, expected_type, expect_reregister);
}
+// static
+TestRequestInterceptor::JobCallback TestRequestInterceptor::FileJob(
+ const base::FilePath& file_path) {
+ return base::Bind(&FileJobCallback, file_path);
+}
+
} // namespace policy
« no previous file with comments | « chrome/browser/policy/cloud/test_request_interceptor.h ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698