| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "jingle/notifier/base/xmpp_connection.h" | 5 #include "jingle/notifier/base/xmpp_connection.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 class XmppConnectionTest : public testing::Test { | 75 class XmppConnectionTest : public testing::Test { |
| 76 protected: | 76 protected: |
| 77 XmppConnectionTest() | 77 XmppConnectionTest() |
| 78 : mock_pre_xmpp_auth_(new MockPreXmppAuth()) { | 78 : mock_pre_xmpp_auth_(new MockPreXmppAuth()) { |
| 79 scoped_ptr<base::MessagePump> pump(new base::MessagePumpDefault()); | 79 scoped_ptr<base::MessagePump> pump(new base::MessagePumpDefault()); |
| 80 message_loop_.reset(new base::MessageLoop(pump.Pass())); | 80 message_loop_.reset(new base::MessageLoop(pump.Pass())); |
| 81 | 81 |
| 82 url_request_context_getter_ = new net::TestURLRequestContextGetter( | 82 url_request_context_getter_ = new net::TestURLRequestContextGetter( |
| 83 message_loop_->message_loop_proxy()); | 83 message_loop_->task_runner()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 ~XmppConnectionTest() override {} | 86 ~XmppConnectionTest() override {} |
| 87 | 87 |
| 88 void TearDown() override { | 88 void TearDown() override { |
| 89 // Clear out any messages posted by XmppConnection's destructor. | 89 // Clear out any messages posted by XmppConnection's destructor. |
| 90 message_loop_->RunUntilIdle(); | 90 message_loop_->RunUntilIdle(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Needed by XmppConnection. | 93 // Needed by XmppConnection. |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 .WillByDefault(Return(TASK_STATE_ERROR)); | 249 .WillByDefault(Return(TASK_STATE_ERROR)); |
| 250 EXPECT_CALL(*task, ProcessStart()).Times(0); | 250 EXPECT_CALL(*task, ProcessStart()).Times(0); |
| 251 task->Start(); | 251 task->Start(); |
| 252 } | 252 } |
| 253 | 253 |
| 254 // This should destroy |task_pump|, but |task| still shouldn't run. | 254 // This should destroy |task_pump|, but |task| still shouldn't run. |
| 255 message_loop_->RunUntilIdle(); | 255 message_loop_->RunUntilIdle(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace notifier | 258 } // namespace notifier |
| OLD | NEW |