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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_->message_loop_proxy()); |
84 } | 84 } |
85 | 85 |
86 virtual ~XmppConnectionTest() {} | 86 ~XmppConnectionTest() override {} |
87 | 87 |
88 virtual void TearDown() { | 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. |
94 scoped_ptr<base::MessageLoop> message_loop_; | 94 scoped_ptr<base::MessageLoop> message_loop_; |
95 MockXmppConnectionDelegate mock_xmpp_connection_delegate_; | 95 MockXmppConnectionDelegate mock_xmpp_connection_delegate_; |
96 scoped_ptr<MockPreXmppAuth> mock_pre_xmpp_auth_; | 96 scoped_ptr<MockPreXmppAuth> mock_pre_xmpp_auth_; |
97 scoped_refptr<net::TestURLRequestContextGetter> url_request_context_getter_; | 97 scoped_refptr<net::TestURLRequestContextGetter> url_request_context_getter_; |
98 }; | 98 }; |
(...skipping 150 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 |