Index: jingle/notifier/listener/non_blocking_push_client_unittest.cc |
diff --git a/jingle/notifier/listener/non_blocking_push_client_unittest.cc b/jingle/notifier/listener/non_blocking_push_client_unittest.cc |
index 8d12d75c4e6eaf66cc92ff48b57ed17be608acf6..f7826d3b5f8c6feb4270208ebbf4a486dc55dcf5 100644 |
--- a/jingle/notifier/listener/non_blocking_push_client_unittest.cc |
+++ b/jingle/notifier/listener/non_blocking_push_client_unittest.cc |
@@ -9,6 +9,7 @@ |
#include "base/compiler_specific.h" |
#include "base/message_loop/message_loop.h" |
+#include "base/run_loop.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "jingle/notifier/base/fake_base_task.h" |
#include "jingle/notifier/listener/fake_push_client.h" |
@@ -35,17 +36,17 @@ class NonBlockingPushClientTest : public testing::Test { |
base::Unretained(this)))); |
push_client_->AddObserver(&fake_observer_); |
// Pump message loop to run CreateFakePushClient. |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
} |
void TearDown() override { |
// Clear out any pending notifications before removing observers. |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
push_client_->RemoveObserver(&fake_observer_); |
push_client_.reset(); |
// Then pump message loop to run |
// NonBlockingPushClient::DestroyOnDelegateThread(). |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
} |
std::unique_ptr<PushClient> CreateFakePushClient() { |
@@ -72,7 +73,7 @@ TEST_F(NonBlockingPushClientTest, UpdateSubscriptions) { |
push_client_->UpdateSubscriptions(subscriptions); |
EXPECT_TRUE(fake_push_client_->subscriptions().empty()); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
EXPECT_TRUE( |
SubscriptionListsEqual( |
fake_push_client_->subscriptions(), subscriptions)); |
@@ -86,7 +87,7 @@ TEST_F(NonBlockingPushClientTest, UpdateCredentials) { |
push_client_->UpdateCredentials(kEmail, kToken); |
EXPECT_TRUE(fake_push_client_->email().empty()); |
EXPECT_TRUE(fake_push_client_->token().empty()); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
EXPECT_EQ(kEmail, fake_push_client_->email()); |
EXPECT_EQ(kToken, fake_push_client_->token()); |
} |
@@ -107,7 +108,7 @@ TEST_F(NonBlockingPushClientTest, SendNotification) { |
push_client_->SendNotification(notification); |
EXPECT_TRUE(fake_push_client_->sent_notifications().empty()); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
ASSERT_EQ(1u, fake_push_client_->sent_notifications().size()); |
EXPECT_TRUE( |
fake_push_client_->sent_notifications()[0].Equals(notification)); |
@@ -117,7 +118,7 @@ TEST_F(NonBlockingPushClientTest, SendNotification) { |
TEST_F(NonBlockingPushClientTest, SendPing) { |
push_client_->SendPing(); |
EXPECT_EQ(0, fake_push_client_->sent_pings()); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
ASSERT_EQ(1, fake_push_client_->sent_pings()); |
} |
@@ -127,12 +128,12 @@ TEST_F(NonBlockingPushClientTest, NotificationStateChange) { |
EXPECT_EQ(DEFAULT_NOTIFICATION_ERROR, |
fake_observer_.last_notifications_disabled_reason()); |
fake_push_client_->EnableNotifications(); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
EXPECT_EQ(NO_NOTIFICATION_ERROR, |
fake_observer_.last_notifications_disabled_reason()); |
fake_push_client_->DisableNotifications( |
NOTIFICATION_CREDENTIALS_REJECTED); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
EXPECT_EQ(NOTIFICATION_CREDENTIALS_REJECTED, |
fake_observer_.last_notifications_disabled_reason()); |
} |
@@ -142,7 +143,7 @@ TEST_F(NonBlockingPushClientTest, OnIncomingNotification) { |
const Notification notification = MakeTestNotification(); |
fake_push_client_->SimulateIncomingNotification(notification); |
- message_loop_.RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
EXPECT_TRUE( |
fake_observer_.last_incoming_notification().Equals(notification)); |
} |