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

Unified Diff: net/url_request/url_request_test_util.h

Issue 9562037: Move TestURLRequestContextGetter to url_request_test_util.{h,cc} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change comment Created 8 years, 10 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 | « net/net.gyp ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_test_util.h
diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h
index 29ecb983080e6d354c3a21b5864bc2d5330c72ab..258c448a1cac5955460b6702252b888eef0012c7 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -13,6 +13,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "base/message_loop_proxy.h"
#include "base/path_service.h"
#include "base/process_util.h"
#include "base/string_util.h"
@@ -35,6 +37,7 @@
#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
+#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_context_storage.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -73,6 +76,29 @@ class TestURLRequestContext : public net::URLRequestContext {
//-----------------------------------------------------------------------------
+// Used to return a dummy context, which lives on the message loop
+// given in the constructor.
+class TestURLRequestContextGetter : public net::URLRequestContextGetter {
+ public:
+ // |io_message_loop_proxy| must not be NULL.
+ explicit TestURLRequestContextGetter(
+ const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy);
+
+ // net::URLRequestContextGetter implementation.
+ virtual TestURLRequestContext* GetURLRequestContext() OVERRIDE;
+ virtual scoped_refptr<base::MessageLoopProxy>
+ GetIOMessageLoopProxy() const OVERRIDE;
+
+ protected:
+ virtual ~TestURLRequestContextGetter();
+
+ private:
+ const scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
+ scoped_refptr<TestURLRequestContext> context_;
+};
+
+//-----------------------------------------------------------------------------
+
class TestURLRequest : public net::URLRequest {
public:
TestURLRequest(const GURL& url, Delegate* delegate);
« no previous file with comments | « net/net.gyp ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698