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

Unified Diff: jingle/glue/chrome_async_socket_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
« no previous file with comments | « no previous file | jingle/glue/proxy_resolving_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/glue/chrome_async_socket_unittest.cc
diff --git a/jingle/glue/chrome_async_socket_unittest.cc b/jingle/glue/chrome_async_socket_unittest.cc
index 0e3274b95f9384893eb2922ffa59ee7690158747..18b0d272d5d88722362fb442f97b81fd40863722 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();
« no previous file with comments | « no previous file | jingle/glue/proxy_resolving_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698