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/listener/xmpp_push_client.h" | 5 #include "jingle/notifier/listener/xmpp_push_client.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "jingle/notifier/base/fake_base_task.h" | 10 #include "jingle/notifier/base/fake_base_task.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 class XmppPushClientTest : public testing::Test { | 33 class XmppPushClientTest : public testing::Test { |
34 protected: | 34 protected: |
35 XmppPushClientTest() { | 35 XmppPushClientTest() { |
36 notifier_options_.request_context_getter = | 36 notifier_options_.request_context_getter = |
37 new net::TestURLRequestContextGetter( | 37 new net::TestURLRequestContextGetter( |
38 message_loop_.message_loop_proxy()); | 38 message_loop_.message_loop_proxy()); |
39 } | 39 } |
40 | 40 |
41 virtual ~XmppPushClientTest() {} | 41 virtual ~XmppPushClientTest() {} |
42 | 42 |
43 virtual void SetUp() OVERRIDE { | 43 virtual void SetUp() override { |
44 xmpp_push_client_.reset(new XmppPushClient(notifier_options_)); | 44 xmpp_push_client_.reset(new XmppPushClient(notifier_options_)); |
45 xmpp_push_client_->AddObserver(&mock_observer_); | 45 xmpp_push_client_->AddObserver(&mock_observer_); |
46 } | 46 } |
47 | 47 |
48 virtual void TearDown() OVERRIDE { | 48 virtual void TearDown() override { |
49 // Clear out any messages posted by XmppPushClient. | 49 // Clear out any messages posted by XmppPushClient. |
50 message_loop_.RunUntilIdle(); | 50 message_loop_.RunUntilIdle(); |
51 xmpp_push_client_->RemoveObserver(&mock_observer_); | 51 xmpp_push_client_->RemoveObserver(&mock_observer_); |
52 xmpp_push_client_.reset(); | 52 xmpp_push_client_.reset(); |
53 } | 53 } |
54 | 54 |
55 // The sockets created by the XMPP code expect an IO loop. | 55 // The sockets created by the XMPP code expect an IO loop. |
56 base::MessageLoopForIO message_loop_; | 56 base::MessageLoopForIO message_loop_; |
57 NotifierOptions notifier_options_; | 57 NotifierOptions notifier_options_; |
58 StrictMock<MockObserver> mock_observer_; | 58 StrictMock<MockObserver> mock_observer_; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 EXPECT_CALL(mock_observer_, OnNotificationsEnabled()); | 136 EXPECT_CALL(mock_observer_, OnNotificationsEnabled()); |
137 | 137 |
138 xmpp_push_client_->OnConnect(fake_base_task_.AsWeakPtr()); | 138 xmpp_push_client_->OnConnect(fake_base_task_.AsWeakPtr()); |
139 xmpp_push_client_->OnSubscribed(); | 139 xmpp_push_client_->OnSubscribed(); |
140 } | 140 } |
141 | 141 |
142 } // namespace | 142 } // namespace |
143 | 143 |
144 } // namespace notifier | 144 } // namespace notifier |
OLD | NEW |