OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/fake_base_task.h" | 5 #include "jingle/notifier/base/fake_base_task.h" |
6 #include "jingle/notifier/base/weak_xmpp_client.h" | 6 #include "jingle/notifier/base/weak_xmpp_client.h" |
7 #include "talk/xmpp/asyncsocket.h" | 7 #include "talk/xmpp/asyncsocket.h" |
8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
9 | 9 |
10 namespace notifier { | 10 namespace notifier { |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Owned by |weak_xmpp_client|. | 36 // Owned by |weak_xmpp_client|. |
37 MockAsyncSocket* mock_async_socket = new MockAsyncSocket(); | 37 MockAsyncSocket* mock_async_socket = new MockAsyncSocket(); |
38 EXPECT_CALL(*mock_async_socket, Connect(_)).WillOnce(Return(true)); | 38 EXPECT_CALL(*mock_async_socket, Connect(_)).WillOnce(Return(true)); |
39 weak_xmpp_client->Connect(settings, "en", mock_async_socket, NULL); | 39 weak_xmpp_client->Connect(settings, "en", mock_async_socket, NULL); |
40 // Initialize the XMPP client. | 40 // Initialize the XMPP client. |
41 task_pump_.RunTasks(); | 41 task_pump_.RunTasks(); |
42 | 42 |
43 base_task_ = weak_xmpp_client->AsWeakPtr(); | 43 base_task_ = weak_xmpp_client->AsWeakPtr(); |
44 } | 44 } |
45 | 45 |
| 46 FakeBaseTask::~FakeBaseTask() {} |
| 47 |
46 base::WeakPtr<talk_base::Task> FakeBaseTask::AsWeakPtr() { | 48 base::WeakPtr<talk_base::Task> FakeBaseTask::AsWeakPtr() { |
47 return base_task_; | 49 return base_task_; |
48 } | 50 } |
49 | 51 |
50 } // namespace notifier | 52 } // namespace notifier |
OLD | NEW |