Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: jingle/notifier/listener/xmpp_push_client_unittest.cc

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 7 #include <memory>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h"
11 #include "jingle/notifier/base/fake_base_task.h" 12 #include "jingle/notifier/base/fake_base_task.h"
12 #include "jingle/notifier/base/notifier_options.h" 13 #include "jingle/notifier/base/notifier_options.h"
13 #include "jingle/notifier/listener/push_client_observer.h" 14 #include "jingle/notifier/listener/push_client_observer.h"
14 #include "net/url_request/url_request_test_util.h" 15 #include "net/url_request/url_request_test_util.h"
15 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 18
18 namespace notifier { 19 namespace notifier {
19 20
20 namespace { 21 namespace {
(...skipping 20 matching lines...) Expand all
41 42
42 ~XmppPushClientTest() override {} 43 ~XmppPushClientTest() override {}
43 44
44 void SetUp() override { 45 void SetUp() override {
45 xmpp_push_client_.reset(new XmppPushClient(notifier_options_)); 46 xmpp_push_client_.reset(new XmppPushClient(notifier_options_));
46 xmpp_push_client_->AddObserver(&mock_observer_); 47 xmpp_push_client_->AddObserver(&mock_observer_);
47 } 48 }
48 49
49 void TearDown() override { 50 void TearDown() override {
50 // Clear out any messages posted by XmppPushClient. 51 // Clear out any messages posted by XmppPushClient.
51 message_loop_.RunUntilIdle(); 52 base::RunLoop().RunUntilIdle();
52 xmpp_push_client_->RemoveObserver(&mock_observer_); 53 xmpp_push_client_->RemoveObserver(&mock_observer_);
53 xmpp_push_client_.reset(); 54 xmpp_push_client_.reset();
54 } 55 }
55 56
56 // The sockets created by the XMPP code expect an IO loop. 57 // The sockets created by the XMPP code expect an IO loop.
57 base::MessageLoopForIO message_loop_; 58 base::MessageLoopForIO message_loop_;
58 NotifierOptions notifier_options_; 59 NotifierOptions notifier_options_;
59 StrictMock<MockObserver> mock_observer_; 60 StrictMock<MockObserver> mock_observer_;
60 std::unique_ptr<XmppPushClient> xmpp_push_client_; 61 std::unique_ptr<XmppPushClient> xmpp_push_client_;
61 FakeBaseTask fake_base_task_; 62 FakeBaseTask fake_base_task_;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 137
137 EXPECT_CALL(mock_observer_, OnNotificationsEnabled()); 138 EXPECT_CALL(mock_observer_, OnNotificationsEnabled());
138 139
139 xmpp_push_client_->OnConnect(fake_base_task_.AsWeakPtr()); 140 xmpp_push_client_->OnConnect(fake_base_task_.AsWeakPtr());
140 xmpp_push_client_->OnSubscribed(); 141 xmpp_push_client_->OnSubscribed();
141 } 142 }
142 143
143 } // namespace 144 } // namespace
144 145
145 } // namespace notifier 146 } // namespace notifier
OLDNEW
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698