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

Unified Diff: chrome/test/test_url_request_context_getter.h

Issue 6250198: More out-of-lining of test code, along with a bunch of GMOCK objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix the gyp files this time Created 9 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
Index: chrome/test/test_url_request_context_getter.h
diff --git a/chrome/test/test_url_request_context_getter.h b/chrome/test/test_url_request_context_getter.h
index 43ff9741635ff24508b61b8ceaa89e6c319f3910..ee309e0b5f0038fd42e6c845ef1e55748ce81299 100644
--- a/chrome/test/test_url_request_context_getter.h
+++ b/chrome/test/test_url_request_context_getter.h
@@ -7,9 +7,11 @@
#pragma once
#include "base/ref_counted.h"
-#include "chrome/browser/browser_thread.h"
#include "chrome/common/net/url_request_context_getter.h"
-#include "net/url_request/url_request_test_util.h"
+
+namespace base {
+class MessageLoopProxy;
+}
// Used to return a dummy context (normally the context is on the IO thread).
// The one here can be run on the main test thread. Note that this can lead to
@@ -18,14 +20,12 @@
// special trait that deletes it on the IO thread.
class TestURLRequestContextGetter : public URLRequestContextGetter {
public:
- virtual net::URLRequestContext* GetURLRequestContext() {
- if (!context_)
- context_ = new TestURLRequestContext();
- return context_.get();
- }
- virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const {
- return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
- }
+ TestURLRequestContextGetter();
+ virtual ~TestURLRequestContextGetter();
+
+ // URLRequestContextGetter:
+ virtual net::URLRequestContext* GetURLRequestContext();
+ virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const;
private:
scoped_refptr<net::URLRequestContext> context_;

Powered by Google App Engine
This is Rietveld 408576698