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

Unified Diff: net/url_request/url_request_test_util.h

Issue 10408067: [net] Switch TestURLRequestContext to use MockCachingHostResolver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to trunk. Created 8 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 | « net/socket_stream/socket_stream_unittest.cc ('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 e1f72bb7ce8434311c9ffdd440ac7030198d7d46..26ce942f73d008357f48a7643e8945a8a71e044c 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -23,7 +23,6 @@
#include "base/utf_string_conversions.h"
#include "googleurl/src/url_util.h"
#include "net/base/cert_verifier.h"
-#include "net/base/host_resolver.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/network_delegate.h"
@@ -52,22 +51,14 @@ class TestURLRequestContext : public net::URLRequestContext {
// URLRequestContext before it is constructed completely. If
// |delay_initialization| is true, Init() needs be be called manually.
explicit TestURLRequestContext(bool delay_initialization);
- // We need this constructor because TestURLRequestContext("foo") actually
- // calls the boolean constructor rather than the std::string constructor.
- explicit TestURLRequestContext(const char* proxy);
- explicit TestURLRequestContext(const std::string& proxy);
- TestURLRequestContext(const std::string& proxy,
- net::HostResolver* host_resolver);
virtual ~TestURLRequestContext();
- // Configures the proxy server, must not be called after Init().
- void SetProxyFromString(const std::string& proxy);
- void SetProxyDirect();
-
void Init();
private:
bool initialized_;
+
+ protected:
net::URLRequestContextStorage context_storage_;
};
@@ -81,6 +72,11 @@ class TestURLRequestContextGetter : public net::URLRequestContextGetter {
explicit TestURLRequestContextGetter(
const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy);
+ // Use to pass a pre-initialized |context|.
+ TestURLRequestContextGetter(
+ const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy,
+ scoped_ptr<TestURLRequestContext> context);
+
// net::URLRequestContextGetter implementation.
virtual TestURLRequestContext* GetURLRequestContext() OVERRIDE;
virtual scoped_refptr<base::MessageLoopProxy>
« no previous file with comments | « net/socket_stream/socket_stream_unittest.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698