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

Unified Diff: jingle/notifier/communicator/single_login_attempt_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
Index: jingle/notifier/communicator/single_login_attempt_unittest.cc
diff --git a/jingle/notifier/communicator/single_login_attempt_unittest.cc b/jingle/notifier/communicator/single_login_attempt_unittest.cc
index 83f81ff9a56689c77c9897fc1d8065d65dfabf10..700b11789046071df87aeb34af744fddbd9d5150 100644
--- a/jingle/notifier/communicator/single_login_attempt_unittest.cc
+++ b/jingle/notifier/communicator/single_login_attempt_unittest.cc
@@ -12,6 +12,7 @@
#include "jingle/notifier/base/const_communicator.h"
#include "jingle/notifier/base/fake_base_task.h"
#include "jingle/notifier/communicator/login_settings.h"
+#include "net/base/mock_host_resolver.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "talk/xmllite/xmlelement.h"
@@ -62,12 +63,23 @@ class FakeDelegate : public SingleLoginAttempt::Delegate {
ServerInformation redirect_server_;
};
+class MyTestURLRequestContext : public TestURLRequestContext {
+ public:
+ MyTestURLRequestContext() : TestURLRequestContext(true) {
+ context_storage_.set_host_resolver(new net::HangingHostResolver());
+ Init();
+ }
+ virtual ~MyTestURLRequestContext() {}
+};
+
class SingleLoginAttemptTest : public ::testing::Test {
protected:
SingleLoginAttemptTest()
: login_settings_(
buzz::XmppClientSettings(),
- new TestURLRequestContextGetter(base::MessageLoopProxy::current()),
+ new TestURLRequestContextGetter(
+ base::MessageLoopProxy::current(),
+ scoped_ptr<TestURLRequestContext>(new MyTestURLRequestContext())),
ServerList(
1,
ServerInformation(
« no previous file with comments | « jingle/notifier/base/proxy_resolving_client_socket_unittest.cc ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698