| 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/weak_xmpp_client.h" | 5 #include "jingle/notifier/base/weak_xmpp_client.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 const buzz::XmppEngine::State kState = buzz::XmppEngine::STATE_OPEN; | 29 const buzz::XmppEngine::State kState = buzz::XmppEngine::STATE_OPEN; |
| 30 const char kInputLog[] = "input log"; | 30 const char kInputLog[] = "input log"; |
| 31 const char kOutputLog[] = "output log"; | 31 const char kOutputLog[] = "output log"; |
| 32 | 32 |
| 33 class WeakXmppClientTest : public testing::Test { | 33 class WeakXmppClientTest : public testing::Test { |
| 34 protected: | 34 protected: |
| 35 WeakXmppClientTest() : task_pump_(new jingle_glue::TaskPump()) {} | 35 WeakXmppClientTest() : task_pump_(new jingle_glue::TaskPump()) {} |
| 36 | 36 |
| 37 virtual ~WeakXmppClientTest() {} | 37 ~WeakXmppClientTest() override {} |
| 38 | 38 |
| 39 void ConnectSignals(buzz::XmppClient* xmpp_client) { | 39 void ConnectSignals(buzz::XmppClient* xmpp_client) { |
| 40 xmpp_client->SignalStateChange.connect( | 40 xmpp_client->SignalStateChange.connect( |
| 41 &mock_xmpp_delegate_, &MockXmppDelegate::OnStateChange); | 41 &mock_xmpp_delegate_, &MockXmppDelegate::OnStateChange); |
| 42 xmpp_client->SignalLogInput.connect( | 42 xmpp_client->SignalLogInput.connect( |
| 43 &mock_xmpp_delegate_, &MockXmppDelegate::OnInputLog); | 43 &mock_xmpp_delegate_, &MockXmppDelegate::OnInputLog); |
| 44 xmpp_client->SignalLogOutput.connect( | 44 xmpp_client->SignalLogOutput.connect( |
| 45 &mock_xmpp_delegate_, &MockXmppDelegate::OnOutputLog); | 45 &mock_xmpp_delegate_, &MockXmppDelegate::OnOutputLog); |
| 46 } | 46 } |
| 47 | 47 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 task_pump_.reset(); | 116 task_pump_.reset(); |
| 117 EXPECT_FALSE(weak_ptr.get()); | 117 EXPECT_FALSE(weak_ptr.get()); |
| 118 // |weak_xmpp_client| is truly invalid at this point so we can't | 118 // |weak_xmpp_client| is truly invalid at this point so we can't |
| 119 // RaiseSignals() with it. | 119 // RaiseSignals() with it. |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace | 122 } // namespace |
| 123 | 123 |
| 124 } // namespace notifier | 124 } // namespace notifier |
| OLD | NEW |