summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 16:50:27 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 16:50:27 +0000
commit8414dfb6314744fd5f0ddfaddf86f8373e403af8 (patch)
treeff346a0b8007d7bca8758c505dbb3ff8ab3fbc25
parent09fd86eb7e1f05843679afa2e9715c102c7bb3ad (diff)
downloadchromium_src-8414dfb6314744fd5f0ddfaddf86f8373e403af8.zip
chromium_src-8414dfb6314744fd5f0ddfaddf86f8373e403af8.tar.gz
chromium_src-8414dfb6314744fd5f0ddfaddf86f8373e403af8.tar.bz2
jingle: Update the calls from RunAllPending() to RunUntilIdle().
RunAllPending() is deprecated and we should switch to RunUntilIdle(). BUG=131220 TBR=ajwong@chromium.org Review URL: https://chromiumcodereview.appspot.com/11421172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170464 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--jingle/glue/chrome_async_socket_unittest.cc74
-rw-r--r--jingle/glue/proxy_resolving_client_socket_unittest.cc2
-rw-r--r--jingle/glue/task_pump_unittest.cc4
-rw-r--r--jingle/glue/thread_wrapper_unittest.cc6
-rw-r--r--jingle/notifier/base/xmpp_connection_unittest.cc10
-rw-r--r--jingle/notifier/communicator/single_login_attempt_unittest.cc2
-rw-r--r--jingle/notifier/listener/non_blocking_push_client_unittest.cc20
-rw-r--r--jingle/notifier/listener/xmpp_push_client_unittest.cc2
8 files changed, 60 insertions, 60 deletions
diff --git a/jingle/glue/chrome_async_socket_unittest.cc b/jingle/glue/chrome_async_socket_unittest.cc
index 0e3274b..18b0d27 100644
--- a/jingle/glue/chrome_async_socket_unittest.cc
+++ b/jingle/glue/chrome_async_socket_unittest.cc
@@ -178,7 +178,7 @@ class ChromeAsyncSocketTest
virtual void TearDown() {
// Run any tasks that we forgot to pump.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectClosed();
ExpectNoSignal();
chrome_async_socket_.reset();
@@ -338,7 +338,7 @@ class ChromeAsyncSocketTest
EXPECT_TRUE(chrome_async_socket_->Connect(addr_));
ExpectNonErrorState(ChromeAsyncSocket::STATE_CONNECTING);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
// We may not necessarily be open; may have been other events
// queued up.
ExpectSignalSocketState(
@@ -368,7 +368,7 @@ class ChromeAsyncSocketTest
EXPECT_EQ(kDummyData, DrainRead(1));
EXPECT_TRUE(chrome_async_socket_->StartTls("fakedomain.com"));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSSLConnectSignal();
ExpectNoSignal();
ExpectNonErrorState(ChromeAsyncSocket::STATE_TLS_OPEN);
@@ -506,7 +506,7 @@ TEST_F(ChromeAsyncSocketTest, ImmediateConnectCloseBeforeRead) {
SignalSocketState::NoError(
SIGNAL_CLOSE, ChromeAsyncSocket::STATE_CLOSED));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
TEST_F(ChromeAsyncSocketTest, HangingConnect) {
@@ -528,14 +528,14 @@ TEST_F(ChromeAsyncSocketTest, PendingConnect) {
ExpectNonErrorState(ChromeAsyncSocket::STATE_CONNECTING);
ExpectNoSignal();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectNonErrorState(ChromeAsyncSocket::STATE_OPEN);
ExpectSignalSocketState(
SignalSocketState::NoError(
SIGNAL_CONNECT, ChromeAsyncSocket::STATE_OPEN));
ExpectNoSignal();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
DoCloseOpenedNoError();
}
@@ -548,14 +548,14 @@ TEST_F(ChromeAsyncSocketTest, PendingConnectCloseBeforeRead) {
net::MockConnect(net::ASYNC, net::OK));
EXPECT_TRUE(chrome_async_socket_->Connect(addr_));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSignalSocketState(
SignalSocketState::NoError(
SIGNAL_CONNECT, ChromeAsyncSocket::STATE_OPEN));
DoCloseOpenedNoError();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
TEST_F(ChromeAsyncSocketTest, PendingConnectError) {
@@ -563,7 +563,7 @@ TEST_F(ChromeAsyncSocketTest, PendingConnectError) {
net::MockConnect(net::ASYNC, net::ERR_TIMED_OUT));
EXPECT_TRUE(chrome_async_socket_->Connect(addr_));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSignalSocketState(
SignalSocketState(
@@ -625,7 +625,7 @@ TEST_F(ChromeAsyncSocketTest, Read) {
EXPECT_EQ(kReadData, DrainRead(1));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
DoCloseOpenedNoError();
}
@@ -639,7 +639,7 @@ TEST_F(ChromeAsyncSocketTest, ReadTwice) {
EXPECT_EQ(kReadData, DrainRead(1));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
const char kReadData2[] = "mydatatoread2";
async_socket_data_provider_.AddRead(net::MockRead(kReadData2));
@@ -661,7 +661,7 @@ TEST_F(ChromeAsyncSocketTest, ReadError) {
EXPECT_EQ(kReadData, DrainRead(1));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
async_socket_data_provider_.AddRead(
net::MockRead(net::SYNCHRONOUS, net::ERR_TIMED_OUT));
@@ -695,7 +695,7 @@ TEST_F(ChromeAsyncSocketTest, PendingRead) {
EXPECT_EQ(kReadData, DrainRead(1));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
DoCloseOpenedNoError();
}
@@ -751,12 +751,12 @@ TEST_F(ChromeAsyncSocketTest, SyncWrite) {
DoOpenClosed();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8,
arraysize(kWriteData) - 8));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectNoSignal();
@@ -774,12 +774,12 @@ TEST_F(ChromeAsyncSocketTest, AsyncWrite) {
net::MockWrite(net::ASYNC, kWriteData + 8, arraysize(kWriteData) - 8));
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8,
arraysize(kWriteData) - 8));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectNoSignal();
@@ -797,12 +797,12 @@ TEST_F(ChromeAsyncSocketTest, AsyncWriteError) {
net::MockWrite(net::ASYNC, net::ERR_TIMED_OUT));
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8,
arraysize(kWriteData) - 8));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSignalSocketState(
SignalSocketState(
@@ -870,7 +870,7 @@ TEST_F(ChromeAsyncSocketTest, ImmediateSSLConnect) {
ExpectReadSignal();
EXPECT_TRUE(chrome_async_socket_->StartTls("fakedomain.com"));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSSLConnectSignal();
ExpectNoSignal();
ExpectNonErrorState(ChromeAsyncSocket::STATE_TLS_OPEN);
@@ -885,7 +885,7 @@ TEST_F(ChromeAsyncSocketTest, DoubleSSLConnect) {
ExpectReadSignal();
EXPECT_TRUE(chrome_async_socket_->StartTls("fakedomain.com"));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSSLConnectSignal();
ExpectNoSignal();
ExpectNonErrorState(ChromeAsyncSocket::STATE_TLS_OPEN);
@@ -909,7 +909,7 @@ TEST_F(ChromeAsyncSocketTest, FailedSSLConnect) {
ExpectReadSignal();
EXPECT_TRUE(chrome_async_socket_->StartTls("fakedomain.com"));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSignalSocketState(
SignalSocketState(
SIGNAL_CLOSE, ChromeAsyncSocket::STATE_CLOSED,
@@ -937,7 +937,7 @@ TEST_F(ChromeAsyncSocketTest, ReadDuringSSLConnecting) {
EXPECT_TRUE(chrome_async_socket_->Read(buf, sizeof(buf), &len_read));
EXPECT_EQ(0U, len_read);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSSLConnectSignal();
ExpectSSLReadSignal();
ExpectNoSignal();
@@ -968,11 +968,11 @@ TEST_F(ChromeAsyncSocketTest, WriteDuringSSLConnecting) {
// TODO(akalin): Figure out how to test that the write happens
// *after* the SSL connect.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSSLConnectSignal();
ExpectNoSignal();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
DoSSLCloseOpenedNoError();
}
@@ -1001,7 +1001,7 @@ TEST_F(ChromeAsyncSocketTest, SSLConnectDuringPostedWrite) {
EXPECT_FALSE(chrome_async_socket_->StartTls("fakedomain.com"));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
DoCloseOpened(
SignalSocketState(SIGNAL_CLOSE,
@@ -1016,14 +1016,14 @@ TEST_F(ChromeAsyncSocketTest, SSLConnectDuringPostedWrite) {
TEST_F(ChromeAsyncSocketTest, SSLRead) {
DoSSLOpenClosed();
async_socket_data_provider_.AddRead(net::MockRead(kReadData));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectSSLReadSignal();
ExpectNoSignal();
EXPECT_EQ(kReadData, DrainRead(1));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
DoSSLCloseOpenedNoError();
}
@@ -1039,12 +1039,12 @@ TEST_F(ChromeAsyncSocketTest, SSLSyncWrite) {
DoSSLOpenClosed();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8,
arraysize(kWriteData) - 8));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectNoSignal();
@@ -1062,12 +1062,12 @@ TEST_F(ChromeAsyncSocketTest, SSLAsyncWrite) {
net::MockWrite(net::ASYNC, kWriteData + 8, arraysize(kWriteData) - 8));
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData, 3));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 3, 5));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(chrome_async_socket_->Write(kWriteData + 8,
arraysize(kWriteData) - 8));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
ExpectNoSignal();
diff --git a/jingle/glue/proxy_resolving_client_socket_unittest.cc b/jingle/glue/proxy_resolving_client_socket_unittest.cc
index 662ba77..682c543 100644
--- a/jingle/glue/proxy_resolving_client_socket_unittest.cc
+++ b/jingle/glue/proxy_resolving_client_socket_unittest.cc
@@ -45,7 +45,7 @@ class ProxyResolvingClientSocketTest : public testing::Test {
virtual void TearDown() {
// Clear out any messages posted by ProxyResolvingClientSocket's
// destructor.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
MessageLoop message_loop_;
diff --git a/jingle/glue/task_pump_unittest.cc b/jingle/glue/task_pump_unittest.cc
index 416ce4d..614de1e 100644
--- a/jingle/glue/task_pump_unittest.cc
+++ b/jingle/glue/task_pump_unittest.cc
@@ -28,7 +28,7 @@ TEST_F(TaskPumpTest, Basic) {
EXPECT_CALL(*task, ProcessStart()).WillOnce(Return(TASK_STATE_DONE));
task->Start();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(TaskPumpTest, Stop) {
@@ -42,7 +42,7 @@ TEST_F(TaskPumpTest, Stop) {
task->Start();
task_pump.Stop();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
} // namespace
diff --git a/jingle/glue/thread_wrapper_unittest.cc b/jingle/glue/thread_wrapper_unittest.cc
index 31f1285..a1716a9 100644
--- a/jingle/glue/thread_wrapper_unittest.cc
+++ b/jingle/glue/thread_wrapper_unittest.cc
@@ -118,7 +118,7 @@ TEST_F(ThreadWrapperTest, Post) {
MatchMessage(&handler2_, kTestMessage1, data4)))
.WillOnce(DeleteMessageData());
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
TEST_F(ThreadWrapperTest, PostDelayed) {
@@ -174,7 +174,7 @@ TEST_F(ThreadWrapperTest, Clear) {
MatchMessage(&handler2_, kTestMessage2, null_data)))
.WillOnce(DeleteMessageData());
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
TEST_F(ThreadWrapperTest, ClearDelayed) {
@@ -299,7 +299,7 @@ TEST_F(ThreadWrapperTest, Dispose) {
bool deleted_;
thread_->Dispose(new DeletableObject(&deleted_));
EXPECT_FALSE(deleted_);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(deleted_);
}
diff --git a/jingle/notifier/base/xmpp_connection_unittest.cc b/jingle/notifier/base/xmpp_connection_unittest.cc
index c6f9c81..a230d29 100644
--- a/jingle/notifier/base/xmpp_connection_unittest.cc
+++ b/jingle/notifier/base/xmpp_connection_unittest.cc
@@ -82,7 +82,7 @@ class XmppConnectionTest : public testing::Test {
virtual void TearDown() {
// Clear out any messages posted by XmppConnection's destructor.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
// Needed by XmppConnection.
@@ -112,7 +112,7 @@ TEST_F(XmppConnectionTest, ImmediateFailure) {
// We need to do this *before* |xmpp_connection| gets destroyed or
// our delegate won't be called.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
TEST_F(XmppConnectionTest, PreAuthFailure) {
@@ -131,7 +131,7 @@ TEST_F(XmppConnectionTest, PreAuthFailure) {
// We need to do this *before* |xmpp_connection| gets destroyed or
// our delegate won't be called.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
TEST_F(XmppConnectionTest, FailureAfterPreAuth) {
@@ -150,7 +150,7 @@ TEST_F(XmppConnectionTest, FailureAfterPreAuth) {
// We need to do this *before* |xmpp_connection| gets destroyed or
// our delegate won't be called.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
TEST_F(XmppConnectionTest, RaisedError) {
@@ -247,7 +247,7 @@ TEST_F(XmppConnectionTest, TasksDontRunAfterXmppConnectionDestructor) {
}
// This should destroy |task_pump|, but |task| still shouldn't run.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
} // namespace notifier
diff --git a/jingle/notifier/communicator/single_login_attempt_unittest.cc b/jingle/notifier/communicator/single_login_attempt_unittest.cc
index bc6f2df..d32fad5 100644
--- a/jingle/notifier/communicator/single_login_attempt_unittest.cc
+++ b/jingle/notifier/communicator/single_login_attempt_unittest.cc
@@ -98,7 +98,7 @@ class SingleLoginAttemptTest : public ::testing::Test {
attempt_(login_settings_, &fake_delegate_) {}
virtual void TearDown() OVERRIDE {
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
void FireRedirect(buzz::XmlElement* redirect_error) {
diff --git a/jingle/notifier/listener/non_blocking_push_client_unittest.cc b/jingle/notifier/listener/non_blocking_push_client_unittest.cc
index 8908910..fea26fe 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));
}
diff --git a/jingle/notifier/listener/xmpp_push_client_unittest.cc b/jingle/notifier/listener/xmpp_push_client_unittest.cc
index c4d53de..8d4c669 100644
--- a/jingle/notifier/listener/xmpp_push_client_unittest.cc
+++ b/jingle/notifier/listener/xmpp_push_client_unittest.cc
@@ -47,7 +47,7 @@ class XmppPushClientTest : public testing::Test {
virtual void TearDown() OVERRIDE {
// Clear out any messages posted by XmppPushClient.
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
xmpp_push_client_->RemoveObserver(&mock_observer_);
xmpp_push_client_.reset();
}