| Index: jingle/notifier/base/xmpp_connection_unittest.cc
|
| diff --git a/jingle/notifier/base/xmpp_connection_unittest.cc b/jingle/notifier/base/xmpp_connection_unittest.cc
|
| index 3212abcbb8607ebd6b62b15716be237d4b8f664e..0573363cf309cc528c4f9cffab7142855a9ecae2 100644
|
| --- a/jingle/notifier/base/xmpp_connection_unittest.cc
|
| +++ b/jingle/notifier/base/xmpp_connection_unittest.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/message_loop/message_loop.h"
|
| +#include "base/message_loop/message_pump_default.h"
|
| #include "jingle/glue/mock_task.h"
|
| #include "jingle/glue/task_pump.h"
|
| #include "jingle/notifier/base/weak_xmpp_client.h"
|
| @@ -74,19 +75,23 @@
|
| class XmppConnectionTest : public testing::Test {
|
| protected:
|
| XmppConnectionTest()
|
| - : mock_pre_xmpp_auth_(new MockPreXmppAuth()),
|
| - url_request_context_getter_(new net::TestURLRequestContextGetter(
|
| - message_loop_.message_loop_proxy())) {}
|
| + : mock_pre_xmpp_auth_(new MockPreXmppAuth()) {
|
| + scoped_ptr<base::MessagePump> pump(new base::MessagePumpDefault());
|
| + message_loop_.reset(new base::MessageLoop(pump.Pass()));
|
| +
|
| + url_request_context_getter_ = new net::TestURLRequestContextGetter(
|
| + message_loop_->message_loop_proxy());
|
| + }
|
|
|
| virtual ~XmppConnectionTest() {}
|
|
|
| virtual void TearDown() {
|
| // Clear out any messages posted by XmppConnection's destructor.
|
| - message_loop_.RunUntilIdle();
|
| + message_loop_->RunUntilIdle();
|
| }
|
|
|
| // Needed by XmppConnection.
|
| - base::MessageLoop message_loop_;
|
| + scoped_ptr<base::MessageLoop> message_loop_;
|
| MockXmppConnectionDelegate mock_xmpp_connection_delegate_;
|
| scoped_ptr<MockPreXmppAuth> mock_pre_xmpp_auth_;
|
| scoped_refptr<net::TestURLRequestContextGetter> url_request_context_getter_;
|
| @@ -112,7 +117,7 @@
|
|
|
| // We need to do this *before* |xmpp_connection| gets destroyed or
|
| // our delegate won't be called.
|
| - message_loop_.RunUntilIdle();
|
| + message_loop_->RunUntilIdle();
|
| }
|
|
|
| TEST_F(XmppConnectionTest, PreAuthFailure) {
|
| @@ -131,7 +136,7 @@
|
|
|
| // We need to do this *before* |xmpp_connection| gets destroyed or
|
| // our delegate won't be called.
|
| - message_loop_.RunUntilIdle();
|
| + message_loop_->RunUntilIdle();
|
| }
|
|
|
| TEST_F(XmppConnectionTest, FailureAfterPreAuth) {
|
| @@ -150,7 +155,7 @@
|
|
|
| // We need to do this *before* |xmpp_connection| gets destroyed or
|
| // our delegate won't be called.
|
| - message_loop_.RunUntilIdle();
|
| + message_loop_->RunUntilIdle();
|
| }
|
|
|
| TEST_F(XmppConnectionTest, RaisedError) {
|
| @@ -247,7 +252,7 @@
|
| }
|
|
|
| // This should destroy |task_pump|, but |task| still shouldn't run.
|
| - message_loop_.RunUntilIdle();
|
| + message_loop_->RunUntilIdle();
|
| }
|
|
|
| } // namespace notifier
|
|
|