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

Unified Diff: sync/notifier/p2p_notifier_unittest.cc

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 | « sync/notifier/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {}
« no previous file with comments | « sync/notifier/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698