Index: sync/notifier/p2p_notifier_unittest.cc |
diff --git a/sync/notifier/p2p_notifier_unittest.cc b/sync/notifier/p2p_notifier_unittest.cc |
index ea8543315777d70b34c9bdddf00b60c04b18dd6f..61831218e4062db6d8b122933ffc2b41c9edac0a 100644 |
--- a/sync/notifier/p2p_notifier_unittest.cc |
+++ b/sync/notifier/p2p_notifier_unittest.cc |
@@ -12,6 +12,7 @@ |
#include "jingle/notifier/base/fake_base_task.h" |
#include "jingle/notifier/base/notifier_options.h" |
#include "jingle/notifier/listener/push_client.h" |
+#include "net/base/mock_host_resolver.h" |
#include "net/url_request/url_request_test_util.h" |
#include "sync/notifier/mock_sync_notifier_observer.h" |
#include "sync/syncable/model_type.h" |
@@ -25,11 +26,22 @@ using ::testing::_; |
using ::testing::Mock; |
using ::testing::StrictMock; |
+class MyTestURLRequestContext : public TestURLRequestContext { |
+ public: |
+ MyTestURLRequestContext() : TestURLRequestContext(true) { |
+ context_storage_.set_host_resolver(new net::HangingHostResolver()); |
+ Init(); |
+ } |
+ virtual ~MyTestURLRequestContext() {} |
+}; |
+ |
class P2PNotifierTest : public testing::Test { |
protected: |
P2PNotifierTest() { |
notifier_options_.request_context_getter = |
- new TestURLRequestContextGetter(message_loop_.message_loop_proxy()); |
+ new TestURLRequestContextGetter( |
+ message_loop_.message_loop_proxy(), |
+ scoped_ptr<TestURLRequestContext>(new MyTestURLRequestContext())); |
} |
virtual ~P2PNotifierTest() {} |