summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 18:36:51 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 18:36:51 +0000
commitb4c62ebe8a5bce337c64f9776c225cafc6a51a16 (patch)
tree5fff0a30ab02ba08b8b9ff2dd2a675d36353c181 /net/http
parent90bb38d8b23ab609bd95b209b28df1eff5940cd5 (diff)
downloadchromium_src-b4c62ebe8a5bce337c64f9776c225cafc6a51a16.zip
chromium_src-b4c62ebe8a5bce337c64f9776c225cafc6a51a16.tar.gz
chromium_src-b4c62ebe8a5bce337c64f9776c225cafc6a51a16.tar.bz2
net: Update calls from RunAllPending() to RunUntilIdle().
RunAllPending() is deprecated and we should switch to RunUntilIdle(). BUG=131220 TBR=willchan@chromium.org Review URL: https://chromiumcodereview.appspot.com/11361263 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_cache_unittest.cc64
-rw-r--r--net/http/http_network_transaction_spdy2_unittest.cc42
-rw-r--r--net/http/http_network_transaction_spdy3_unittest.cc42
-rw-r--r--net/http/http_pipelined_connection_impl_unittest.cc14
-rw-r--r--net/http/http_pipelined_network_transaction_unittest.cc4
5 files changed, 83 insertions, 83 deletions
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index 425d60c..05ef842 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -966,7 +966,7 @@ TEST(HttpCache, SimpleGET_ManyReaders) {
}
// Allow all requests to move from the Create queue to the active entry.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The first request should be a writer at this point, and the subsequent
// requests should be pending.
@@ -1031,7 +1031,7 @@ TEST(HttpCache, SimpleGET_RacingReaders) {
}
// Allow all requests to move from the Create queue to the active entry.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The first request should be a writer at this point, and the subsequent
// requests should be pending.
@@ -1160,7 +1160,7 @@ TEST(HttpCache, FastNoStoreGET_DoneWithPending) {
}
// Allow all requests to move from the Create queue to the active entry.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The first request should be a writer at this point, and the subsequent
// requests should be pending.
@@ -1207,7 +1207,7 @@ TEST(HttpCache, SimpleGET_ManyWriters_CancelFirst) {
}
// Allow all requests to move from the Create queue to the active entry.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The first request should be a writer at this point, and the subsequent
// requests should be pending.
@@ -1322,7 +1322,7 @@ TEST(HttpCache, SimpleGET_CancelCreate) {
cache.disk_cache()->ReleaseAll();
delete c;
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, cache.disk_cache()->create_count());
}
@@ -1399,7 +1399,7 @@ TEST(HttpCache, SimpleGET_AbandonedCacheRead) {
// Make sure we pump any pending events, which should include a call to
// HttpCache::Transaction::OnCacheReadCompleted.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Tests that we can delete the HttpCache and deal with queued transactions
@@ -1468,14 +1468,14 @@ TEST(HttpCache, SimpleGET_WaitForBackend) {
&request2, context_list[2]->callback.callback(), net::BoundNetLog());
// Just to make sure that everything is still pending.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The first request should be creating the disk cache.
EXPECT_FALSE(context_list[0]->callback.have_result());
factory->FinishCreation();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(3, cache.network_layer()->transaction_count());
EXPECT_EQ(3, cache.disk_cache()->create_count());
@@ -1514,7 +1514,7 @@ TEST(HttpCache, SimpleGET_WaitForBackend_CancelCreate) {
&request2, context_list[2]->callback.callback(), net::BoundNetLog());
// Just to make sure that everything is still pending.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The first request should be creating the disk cache.
EXPECT_FALSE(context_list[0]->callback.have_result());
@@ -1554,7 +1554,7 @@ TEST(HttpCache, DeleteCacheWaitingForBackend) {
c->trans->Start(&request, c->callback.callback(), net::BoundNetLog());
// Just to make sure that everything is still pending.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The request should be creating the disk cache.
EXPECT_FALSE(c->callback.have_result());
@@ -1565,7 +1565,7 @@ TEST(HttpCache, DeleteCacheWaitingForBackend) {
disk_cache::Backend** backend = factory->backend();
cache.reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
*backend = NULL;
callback.Run(net::ERR_ABORTED);
@@ -1597,7 +1597,7 @@ TEST(HttpCache, DeleteCacheWaitingForBackend2) {
EXPECT_EQ(net::ERR_IO_PENDING, rv);
// Just to make sure that everything is still pending.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The request should be queued.
EXPECT_FALSE(c->callback.have_result());
@@ -1607,7 +1607,7 @@ TEST(HttpCache, DeleteCacheWaitingForBackend2) {
rv = cb.WaitForResult();
// The cache should be gone by now.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(net::OK, c->callback.GetResult(c->result));
EXPECT_FALSE(cb2.have_result());
}
@@ -2633,7 +2633,7 @@ TEST(HttpCache, RangeGET_OK) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure we are done with the previous transaction.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Write to the cache (30-39).
MockTransaction transaction(kRangeGET_TransactionOK);
@@ -2647,7 +2647,7 @@ TEST(HttpCache, RangeGET_OK) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure we are done with the previous transaction.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Write and read from the cache (20-59).
transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER;
@@ -2689,7 +2689,7 @@ TEST(HttpCache, RangeGET_SyncOK) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure we are done with the previous transaction.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Write to the cache (30-39).
transaction.request_headers = "Range: bytes = 30-39\r\n" EXTRA_HEADER;
@@ -2702,7 +2702,7 @@ TEST(HttpCache, RangeGET_SyncOK) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure we are done with the previous transaction.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Write and read from the cache (20-59).
transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER;
@@ -2900,7 +2900,7 @@ TEST(HttpCache, UnknownRangeGET_1) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure we are done with the previous transaction.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Write and read from the cache (60-79).
transaction.request_headers = "Range: bytes = 60-\r\n" EXTRA_HEADER;
@@ -2939,7 +2939,7 @@ TEST(HttpCache, UnknownRangeGET_2) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// Make sure we are done with the previous transaction.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Write and read from the cache (60-79).
transaction.request_headers = "Range: bytes = -20\r\n" EXTRA_HEADER;
@@ -3255,7 +3255,7 @@ TEST(HttpCache, RangeGET_Previous200) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
// The last transaction has finished so make sure the entry is deactivated.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Make a request for an invalid range.
MockTransaction transaction3(kRangeGET_TransactionOK);
@@ -3269,14 +3269,14 @@ TEST(HttpCache, RangeGET_Previous200) {
EXPECT_EQ(std::string::npos, headers.find("Content-Length: 80"));
// Make sure the entry is deactivated.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Even though the request was invalid, we should have the entry.
RunTransactionTest(cache.http_cache(), transaction2);
EXPECT_EQ(3, cache.disk_cache()->open_count());
// Make sure the entry is deactivated.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Now we should receive a range from the server and drop the stored entry.
handler.set_not_modified(false);
@@ -3492,14 +3492,14 @@ TEST(HttpCache, RangeGET_Cancel3) {
EXPECT_EQ(net::ERR_IO_PENDING, rv);
MockDiskEntry::IgnoreCallbacks(true);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
MockDiskEntry::IgnoreCallbacks(false);
// The new transaction is waiting for the query range callback.
delete c;
// And we should not crash when the callback is delivered.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(2, cache.network_layer()->transaction_count());
EXPECT_EQ(1, cache.disk_cache()->open_count());
@@ -4211,7 +4211,7 @@ TEST(HttpCache, GET_IncompleteResource_Cancel) {
EXPECT_EQ(1, cache.disk_cache()->open_count());
EXPECT_EQ(2, cache.disk_cache()->create_count());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
RemoveMockTransaction(&transaction);
}
@@ -4767,7 +4767,7 @@ TEST(HttpCache, WriteMetadata_OK) {
buf = NULL;
// Makes sure we finish pending operations.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
RunTransactionTestWithResponseInfo(cache.http_cache(), kSimpleGET_Transaction,
&response);
@@ -4800,7 +4800,7 @@ TEST(HttpCache, WriteMetadata_Fail) {
expected_time, buf, buf->size());
// Makes sure we finish pending operations.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
RunTransactionTestWithResponseInfo(cache.http_cache(), kSimpleGET_Transaction,
&response);
@@ -4830,7 +4830,7 @@ TEST(HttpCache, ReadMetadata) {
response.response_time, buf, buf->size());
// Makes sure we finish pending operations.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Start with a READ mode transaction.
MockTransaction trans1(kTypicalGET_Transaction);
@@ -4844,7 +4844,7 @@ TEST(HttpCache, ReadMetadata) {
EXPECT_EQ(1, cache.network_layer()->transaction_count());
EXPECT_EQ(2, cache.disk_cache()->open_count());
EXPECT_EQ(1, cache.disk_cache()->create_count());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Now make sure that the entry is re-validated with the server.
trans1.load_flags = net::LOAD_VALIDATE_CACHE;
@@ -4858,7 +4858,7 @@ TEST(HttpCache, ReadMetadata) {
EXPECT_EQ(2, cache.network_layer()->transaction_count());
EXPECT_EQ(3, cache.disk_cache()->open_count());
EXPECT_EQ(1, cache.disk_cache()->create_count());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
RemoveMockTransaction(&trans1);
// Now return 200 when validating the entry so the metadata will be lost.
@@ -4896,7 +4896,7 @@ TEST(HttpCache, FilterCompletion) {
}
// Make sure that the ActiveEntry is gone.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Read from the cache.
RunTransactionTest(cache.http_cache(), kSimpleGET_Transaction);
@@ -4934,7 +4934,7 @@ TEST(HttpCache, StopCachingDeletesEntry) {
}
// Make sure that the ActiveEntry is gone.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that the entry is gone.
RunTransactionTest(cache.http_cache(), kSimpleGET_Transaction);
diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc
index 25e1e34..62700e9 100644
--- a/net/http/http_network_transaction_spdy2_unittest.cc
+++ b/net/http/http_network_transaction_spdy2_unittest.cc
@@ -202,17 +202,17 @@ class HttpNetworkTransactionSpdy2Test : public PlatformTest {
virtual void SetUp() {
SpdySession::set_default_protocol(kProtoSPDY2);
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
virtual void TearDown() {
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
PlatformTest::TearDown();
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Either |write_failure| specifies a write failure or |read_failure|
@@ -3464,13 +3464,13 @@ TEST_F(HttpNetworkTransactionSpdy2Test,
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the TCPClientSocket was not added back to
// the pool.
EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session));
trans.reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Make sure that the socket didn't get recycled after calling the destructor.
EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session));
}
@@ -3524,7 +3524,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSocket) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session));
@@ -3583,7 +3583,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSSLSocket) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session));
@@ -3651,7 +3651,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleDeadSSLSocket) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session));
@@ -3678,7 +3678,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleDeadSSLSocket) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session));
@@ -3735,7 +3735,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSocketAfterZeroContentLength) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session));
@@ -3906,7 +3906,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, AuthIdentityInURL) {
EXPECT_EQ(100, response->headers->GetContentLength());
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Test the request-challenge-retry sequence for basic auth when there is an
@@ -4016,7 +4016,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, WrongAuthIdentityInURL) {
EXPECT_EQ(100, response->headers->GetContentLength());
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Test that previously tried username/passwords for a realm get re-used.
@@ -8857,7 +8857,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, SimpleCancel) {
EXPECT_EQ(ERR_IO_PENDING, rv);
trans.reset(); // Cancel the transaction here.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Test a basic GET request through a proxy.
@@ -9937,7 +9937,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionForHttp) {
TestCompletionCallback callback1;
EXPECT_EQ(ERR_IO_PENDING,
trans1.Start(&request1, callback1.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(OK, callback1.WaitForResult());
EXPECT_TRUE(trans1.GetResponseInfo()->was_fetched_via_spdy);
@@ -9952,7 +9952,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionForHttp) {
TestCompletionCallback callback2;
EXPECT_EQ(ERR_IO_PENDING,
trans2.Start(&request2, callback2.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(OK, callback2.WaitForResult());
EXPECT_FALSE(trans2.GetResponseInfo()->was_fetched_via_spdy);
@@ -10032,7 +10032,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionForHttpOverTunnel) {
TestCompletionCallback callback1;
EXPECT_EQ(ERR_IO_PENDING,
trans1.Start(&request1, callback1.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
data1.RunFor(4);
EXPECT_EQ(OK, callback1.WaitForResult());
@@ -10048,7 +10048,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionForHttpOverTunnel) {
TestCompletionCallback callback2;
EXPECT_EQ(ERR_IO_PENDING,
trans2.Start(&request2, callback2.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
data1.RunFor(3);
EXPECT_EQ(OK, callback2.WaitForResult());
@@ -10105,7 +10105,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseSpdySessionForHttpWhenForced) {
TestCompletionCallback callback1;
EXPECT_EQ(ERR_IO_PENDING,
trans1.Start(&request1, callback1.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(OK, callback1.WaitForResult());
EXPECT_TRUE(trans1.GetResponseInfo()->was_fetched_via_spdy);
@@ -10120,7 +10120,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseSpdySessionForHttpWhenForced) {
TestCompletionCallback callback2;
EXPECT_EQ(ERR_IO_PENDING,
trans2.Start(&request2, callback2.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(OK, callback2.WaitForResult());
EXPECT_TRUE(trans2.GetResponseInfo()->was_fetched_via_spdy);
@@ -10255,7 +10255,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionIfCertDoesNotMatch) {
TestCompletionCallback callback2;
EXPECT_EQ(ERR_IO_PENDING,
trans2.Start(&request2, callback2.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
data2->RunFor(3);
ASSERT_TRUE(callback2.have_result());
diff --git a/net/http/http_network_transaction_spdy3_unittest.cc b/net/http/http_network_transaction_spdy3_unittest.cc
index 734a5af..00e44f7 100644
--- a/net/http/http_network_transaction_spdy3_unittest.cc
+++ b/net/http/http_network_transaction_spdy3_unittest.cc
@@ -202,17 +202,17 @@ class HttpNetworkTransactionSpdy3Test : public PlatformTest {
virtual void SetUp() {
SpdySession::set_default_protocol(kProtoSPDY3);
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
virtual void TearDown() {
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
PlatformTest::TearDown();
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Either |write_failure| specifies a write failure or |read_failure|
@@ -3464,13 +3464,13 @@ TEST_F(HttpNetworkTransactionSpdy3Test,
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the TCPClientSocket was not added back to
// the pool.
EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session));
trans.reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Make sure that the socket didn't get recycled after calling the destructor.
EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session));
}
@@ -3524,7 +3524,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSocket) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session));
@@ -3583,7 +3583,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSSLSocket) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session));
@@ -3651,7 +3651,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleDeadSSLSocket) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session));
@@ -3678,7 +3678,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleDeadSSLSocket) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session));
@@ -3735,7 +3735,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSocketAfterZeroContentLength) {
// Empty the current queue. This is necessary because idle sockets are
// added to the connection pool asynchronously with a PostTask.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now check to make sure the socket was added back to the pool.
EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session));
@@ -3906,7 +3906,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, AuthIdentityInURL) {
EXPECT_EQ(100, response->headers->GetContentLength());
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Test the request-challenge-retry sequence for basic auth when there is an
@@ -4016,7 +4016,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, WrongAuthIdentityInURL) {
EXPECT_EQ(100, response->headers->GetContentLength());
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Test that previously tried username/passwords for a realm get re-used.
@@ -8856,7 +8856,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, SimpleCancel) {
EXPECT_EQ(ERR_IO_PENDING, rv);
trans.reset(); // Cancel the transaction here.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Test a basic GET request through a proxy.
@@ -9921,7 +9921,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionForHttp) {
TestCompletionCallback callback1;
EXPECT_EQ(ERR_IO_PENDING,
trans1.Start(&request1, callback1.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(OK, callback1.WaitForResult());
EXPECT_TRUE(trans1.GetResponseInfo()->was_fetched_via_spdy);
@@ -9936,7 +9936,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionForHttp) {
TestCompletionCallback callback2;
EXPECT_EQ(ERR_IO_PENDING,
trans2.Start(&request2, callback2.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(OK, callback2.WaitForResult());
EXPECT_FALSE(trans2.GetResponseInfo()->was_fetched_via_spdy);
@@ -10006,7 +10006,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionForHttpOverTunnel) {
TestCompletionCallback callback1;
EXPECT_EQ(ERR_IO_PENDING,
trans1.Start(&request1, callback1.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
data1.RunFor(4);
EXPECT_EQ(OK, callback1.WaitForResult());
@@ -10022,7 +10022,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionForHttpOverTunnel) {
TestCompletionCallback callback2;
EXPECT_EQ(ERR_IO_PENDING,
trans2.Start(&request2, callback2.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
data1.RunFor(3);
EXPECT_EQ(OK, callback2.WaitForResult());
@@ -10079,7 +10079,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseSpdySessionForHttpWhenForced) {
TestCompletionCallback callback1;
EXPECT_EQ(ERR_IO_PENDING,
trans1.Start(&request1, callback1.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(OK, callback1.WaitForResult());
EXPECT_TRUE(trans1.GetResponseInfo()->was_fetched_via_spdy);
@@ -10094,7 +10094,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseSpdySessionForHttpWhenForced) {
TestCompletionCallback callback2;
EXPECT_EQ(ERR_IO_PENDING,
trans2.Start(&request2, callback2.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(OK, callback2.WaitForResult());
EXPECT_TRUE(trans2.GetResponseInfo()->was_fetched_via_spdy);
@@ -10218,7 +10218,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionIfCertDoesNotMatch) {
TestCompletionCallback callback2;
EXPECT_EQ(ERR_IO_PENDING,
trans2.Start(&request2, callback2.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
data2->RunFor(3);
ASSERT_TRUE(callback2.have_result());
diff --git a/net/http/http_pipelined_connection_impl_unittest.cc b/net/http/http_pipelined_connection_impl_unittest.cc
index 0256efa..55c4de9 100644
--- a/net/http/http_pipelined_connection_impl_unittest.cc
+++ b/net/http/http_pipelined_connection_impl_unittest.cc
@@ -76,7 +76,7 @@ class HttpPipelinedConnectionImplTest : public testing::Test {
}
void TearDown() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void Initialize(MockRead* reads, size_t reads_count,
@@ -692,7 +692,7 @@ TEST_F(HttpPipelinedConnectionImplTest, AbortWhileSendingSecondRequest) {
data_->RunFor(1);
EXPECT_LE(OK, ok_callback.WaitForResult());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
aborted_stream->Close(true);
EXPECT_EQ(ERR_PIPELINE_EVICTION, evicted_callback.WaitForResult());
evicted_stream->Close(true);
@@ -938,7 +938,7 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseCalledBeforeReadCallback) {
// 2. InvokeUserCallback
SuddenCloseObserver observer(evicted_stream.get(), 2);
MessageLoop::current()->AddTaskObserver(&observer);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(evicted_callback.have_result());
}
@@ -1084,7 +1084,7 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseBeforeSendCallbackRuns) {
close_stream.reset();
close_callback.reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(HttpPipelinedConnectionImplTest, CloseBeforeReadCallbackRuns) {
@@ -1118,7 +1118,7 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseBeforeReadCallbackRuns) {
close_stream.reset();
close_callback.reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(HttpPipelinedConnectionImplTest, AbortWhileSendQueued) {
@@ -1520,7 +1520,7 @@ TEST_F(HttpPipelinedConnectionImplTest, OnPipelineHasCapacity) {
&response, callback_.callback()));
EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(0);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
stream->Close(false);
EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1);
@@ -1537,7 +1537,7 @@ TEST_F(HttpPipelinedConnectionImplTest, OnPipelineHasCapacityWithoutSend) {
scoped_ptr<HttpStream> stream(NewTestStream("ok.html"));
EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
stream->Close(false);
EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1);
diff --git a/net/http/http_pipelined_network_transaction_unittest.cc b/net/http/http_pipelined_network_transaction_unittest.cc
index d5d87d0..e616d2d 100644
--- a/net/http/http_pipelined_network_transaction_unittest.cc
+++ b/net/http/http_pipelined_network_transaction_unittest.cc
@@ -720,7 +720,7 @@ TEST_F(HttpPipelinedNetworkTransactionTest, PipelinesImmediatelyIfKnownGood) {
second_one_transaction.Start(
GetRequestInfo("second-pipeline-one.html"),
second_one_callback.callback(), BoundNetLog()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
HttpNetworkTransaction second_two_transaction(session_.get());
TestCompletionCallback second_two_callback;
@@ -826,7 +826,7 @@ TEST_F(HttpPipelinedNetworkTransactionTest, OpenPipelinesWhileBinding) {
DataRunnerObserver observer(data_vector_[0], 3);
MessageLoop::current()->AddTaskObserver(&observer);
data_vector_[0]->SetStop(4);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
data_vector_[0]->SetStop(10);
EXPECT_EQ(OK, one_callback.WaitForResult());