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

Unified Diff: jingle/notifier/listener/non_blocking_push_client_unittest.cc

Issue 11421172: jingle: Update the calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 8908910e78ee3a2b2999351958e10b1b93c93b7a..fea26fea3be3db88b11ccec60cf93113e75fe567 100644
--- a/jingle/notifier/listener/non_blocking_push_client_unittest.cc
+++ b/jingle/notifier/listener/non_blocking_push_client_unittest.cc
@@ -34,17 +34,17 @@ class NonBlockingPushClientTest : public testing::Test {
base::Unretained(this))));
push_client_->AddObserver(&fake_observer_);
// Pump message loop to run CreateFakePushClient.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
virtual void TearDown() OVERRIDE {
// Clear out any pending notifications before removing observers.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
push_client_->RemoveObserver(&fake_observer_);
push_client_.reset();
// Then pump message loop to run
// NonBlockingPushClient::DestroyOnDelegateThread().
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
scoped_ptr<PushClient> CreateFakePushClient() {
@@ -71,7 +71,7 @@ TEST_F(NonBlockingPushClientTest, UpdateSubscriptions) {
push_client_->UpdateSubscriptions(subscriptions);
EXPECT_TRUE(fake_push_client_->subscriptions().empty());
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(
SubscriptionListsEqual(
fake_push_client_->subscriptions(), subscriptions));
@@ -85,7 +85,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_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_EQ(kEmail, fake_push_client_->email());
EXPECT_EQ(kToken, fake_push_client_->token());
}
@@ -106,7 +106,7 @@ TEST_F(NonBlockingPushClientTest, SendNotification) {
push_client_->SendNotification(notification);
EXPECT_TRUE(fake_push_client_->sent_notifications().empty());
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ASSERT_EQ(1u, fake_push_client_->sent_notifications().size());
EXPECT_TRUE(
fake_push_client_->sent_notifications()[0].Equals(notification));
@@ -116,7 +116,7 @@ TEST_F(NonBlockingPushClientTest, SendNotification) {
TEST_F(NonBlockingPushClientTest, SendPing) {
push_client_->SendPing();
EXPECT_EQ(0, fake_push_client_->sent_pings());
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ASSERT_EQ(1, fake_push_client_->sent_pings());
}
@@ -126,12 +126,12 @@ TEST_F(NonBlockingPushClientTest, NotificationStateChange) {
EXPECT_EQ(DEFAULT_NOTIFICATION_ERROR,
fake_observer_.last_notifications_disabled_reason());
fake_push_client_->EnableNotifications();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_EQ(NO_NOTIFICATION_ERROR,
fake_observer_.last_notifications_disabled_reason());
fake_push_client_->DisableNotifications(
NOTIFICATION_CREDENTIALS_REJECTED);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_EQ(NOTIFICATION_CREDENTIALS_REJECTED,
fake_observer_.last_notifications_disabled_reason());
}
@@ -141,7 +141,7 @@ TEST_F(NonBlockingPushClientTest, OnIncomingNotification) {
const Notification notification = MakeTestNotification();
fake_push_client_->SimulateIncomingNotification(notification);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(
fake_observer_.last_incoming_notification().Equals(notification));
}
« no previous file with comments | « jingle/notifier/communicator/single_login_attempt_unittest.cc ('k') | jingle/notifier/listener/xmpp_push_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698