net: Update calls from RunAllPending() to RunUntilIdle().
RunAllPending() is deprecated and we should switch to RunUntilIdle().
BUG=131220
[email protected]
Review URL: https://chromiumcodereview.appspot.com/11361263
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167705 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/android/network_change_notifier_android_unittest.cc b/net/android/network_change_notifier_android_unittest.cc
index 356ac4c..9b86470 100644
--- a/net/android/network_change_notifier_android_unittest.cc
+++ b/net/android/network_change_notifier_android_unittest.cc
@@ -80,21 +80,21 @@
observer()->current_connection());
ForceConnectivityState(false);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, observer()->times_connection_type_has_been_changed());
EXPECT_EQ(NetworkChangeNotifier::CONNECTION_NONE,
observer()->current_connection());
ForceConnectivityState(false);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, observer()->times_connection_type_has_been_changed());
EXPECT_EQ(NetworkChangeNotifier::CONNECTION_NONE,
observer()->current_connection());
ForceConnectivityState(true);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(2, observer()->times_connection_type_has_been_changed());
EXPECT_EQ(NetworkChangeNotifier::CONNECTION_UNKNOWN,
diff --git a/net/base/directory_lister_unittest.cc b/net/base/directory_lister_unittest.cc
index 82c4b56..7f82a66 100644
--- a/net/base/directory_lister_unittest.cc
+++ b/net/base/directory_lister_unittest.cc
@@ -126,7 +126,7 @@
lister.Cancel();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(num_files, delegate.num_files());
}
diff --git a/net/base/file_stream_unittest.cc b/net/base/file_stream_unittest.cc
index f9882c8..22d342799 100644
--- a/net/base/file_stream_unittest.cc
+++ b/net/base/file_stream_unittest.cc
@@ -240,7 +240,7 @@
if (rv < 0) {
EXPECT_EQ(ERR_IO_PENDING, rv);
// The callback should not be called if the request is cancelled.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(callback.have_result());
} else {
EXPECT_EQ(std::string(kTestData, rv), std::string(buf->data(), rv));
@@ -458,7 +458,7 @@
if (rv < 0) {
EXPECT_EQ(ERR_IO_PENDING, rv);
// The callback should not be called if the request is cancelled.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(callback.have_result());
} else {
ok = file_util::GetFileSize(temp_file_path(), &file_size);
diff --git a/net/base/host_resolver_impl_unittest.cc b/net/base/host_resolver_impl_unittest.cc
index 0bad1d3..1f48f6c 100644
--- a/net/base/host_resolver_impl_unittest.cc
+++ b/net/base/host_resolver_impl_unittest.cc
@@ -823,7 +823,7 @@
// Flush cache by triggering an IP address change.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending(); // Notification happens async.
+ MessageLoop::current()->RunUntilIdle(); // Notification happens async.
// Resolve "host1" again -- this time it won't be served from cache, so it
// will complete asynchronously.
@@ -840,7 +840,7 @@
EXPECT_TRUE(proc_->WaitFor(1u));
// Triggering an IP address change.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending(); // Notification happens async.
+ MessageLoop::current()->RunUntilIdle(); // Notification happens async.
proc_->SignalAll();
EXPECT_EQ(ERR_ABORTED, req->WaitForResult());
@@ -858,7 +858,7 @@
EXPECT_TRUE(proc_->WaitFor(1u));
// Triggering an IP address change.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending(); // Notification happens async.
+ MessageLoop::current()->RunUntilIdle(); // Notification happens async.
proc_->SignalMultiple(3u); // Let the false-start go so that we can catch it.
EXPECT_EQ(ERR_ABORTED, requests_[0]->WaitForResult());
@@ -902,7 +902,7 @@
// Trigger an IP address change.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
// This should abort all running jobs.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(ERR_ABORTED, requests_[0]->result());
EXPECT_EQ(ERR_ABORTED, requests_[1]->result());
EXPECT_EQ(ERR_ABORTED, requests_[2]->result());
@@ -1211,7 +1211,7 @@
resolver_proc->WaitForAllAttemptsToFinish(
base::TimeDelta::FromMilliseconds(60000));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(resolver_proc->total_attempts_resolved(), kTotalAttempts);
EXPECT_EQ(resolver_proc->resolved_attempt_number(), kAttemptNumberToResolve);
@@ -1266,7 +1266,7 @@
void ChangeDnsConfig(const DnsConfig& config) {
NetworkChangeNotifier::SetDnsConfig(config);
// Notification is delivered asynchronously.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
MockDnsClientRuleList dns_rules_;
diff --git a/net/base/network_change_notifier_linux_unittest.cc b/net/base/network_change_notifier_linux_unittest.cc
index 10dda96..8fc9631a 100644
--- a/net/base/network_change_notifier_linux_unittest.cc
+++ b/net/base/network_change_notifier_linux_unittest.cc
@@ -76,7 +76,7 @@
event.Wait();
// Run any tasks queued on the main thread, e.g. by
// ObserverListThreadSafe.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void SendResponse(uint32 state) {
diff --git a/net/base/network_change_notifier_win_unittest.cc b/net/base/network_change_notifier_win_unittest.cc
index 4ade0e03..a418ba7 100644
--- a/net/base/network_change_notifier_win_unittest.cc
+++ b/net/base/network_change_notifier_win_unittest.cc
@@ -89,7 +89,7 @@
// If a task to notify observers of the IP address change event was
// incorrectly posted, make sure it gets run to trigger a failure.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Calls WatchForAddressChange, and simulates a WatchForAddressChangeInternal
@@ -112,7 +112,7 @@
// If a task to notify observers of the IP address change event was
// incorrectly posted, make sure it gets run.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Simulates a network change event, resulting in a call to OnObjectSignaled.
@@ -132,7 +132,7 @@
EXPECT_EQ(0, network_change_notifier_.sequential_failures());
// Run the task to notify observers of the IP address change event.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Simulates a network change event, resulting in a call to OnObjectSignaled.
@@ -154,7 +154,7 @@
EXPECT_LT(0, network_change_notifier_.sequential_failures());
// Run the task to notify observers of the IP address change event.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Runs the message loop until WatchForAddressChange is called again, as a
@@ -204,7 +204,7 @@
// If a task to notify observers of the IP address change event was
// incorrectly posted, make sure it gets run.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
private:
diff --git a/net/base/nss_cert_database_unittest.cc b/net/base/nss_cert_database_unittest.cc
index a3f6096..c88962d 100644
--- a/net/base/nss_cert_database_unittest.cc
+++ b/net/base/nss_cert_database_unittest.cc
@@ -59,7 +59,7 @@
// Run the message loop to process any observer callbacks (e.g. for the
// ClientSocketFactory singleton) so that the scoped ref ptrs created in
// NSSCertDatabase::NotifyObservers* get released.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(0U, ListCertsInSlot(slot_->os_module_handle()).size());
}
diff --git a/net/base/server_bound_cert_service_unittest.cc b/net/base/server_bound_cert_service_unittest.cc
index f09b47c..211b4baf 100644
--- a/net/base/server_bound_cert_service_unittest.cc
+++ b/net/base/server_bound_cert_service_unittest.cc
@@ -346,7 +346,7 @@
sequenced_worker_pool_->FlushForTesting();
// Wait for reply from ServerBoundCertServiceWorker to be posted back to the
// ServerBoundCertService.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Even though the original request was cancelled, the service will still
// store the result, it just doesn't call the callback.
@@ -381,7 +381,7 @@
// ServerBoundCertServiceWorker should not post anything back to the
// non-existant ServerBoundCertService, but run the loop just to be sure it
// doesn't.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// If we got here without crashing or a valgrind error, it worked.
}
diff --git a/net/base/upload_data_stream_unittest.cc b/net/base/upload_data_stream_unittest.cc
index afd1fb53..950511d 100644
--- a/net/base/upload_data_stream_unittest.cc
+++ b/net/base/upload_data_stream_unittest.cc
@@ -310,7 +310,7 @@
MockCompletionCallback mock_callback;
EXPECT_CALL(mock_callback, Run(OK)).Times(1);
EXPECT_EQ(stream.Init(mock_callback.CreateCallback()), ERR_IO_PENDING);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Init() of a reader fails asynchronously.
@@ -329,7 +329,7 @@
MockCompletionCallback mock_callback;
EXPECT_CALL(mock_callback, Run(ERR_FAILED)).Times(1);
EXPECT_EQ(stream.Init(mock_callback.CreateCallback()), ERR_IO_PENDING);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Init() of a reader fails synchronously.
@@ -352,7 +352,7 @@
MockCompletionCallback mock_callback;
EXPECT_CALL(mock_callback, Run(ERR_FAILED)).Times(1);
EXPECT_EQ(stream.Init(mock_callback.CreateCallback()), ERR_IO_PENDING);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Read with a buffer whose size is same as the data.
@@ -408,7 +408,7 @@
MockCompletionCallback mock_callback;
EXPECT_CALL(mock_callback, Run(OK)).Times(1);
EXPECT_EQ(ERR_IO_PENDING, stream.Init(mock_callback.CreateCallback()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
scoped_refptr<IOBuffer> buf = new IOBuffer(kTestBufferSize);
@@ -416,19 +416,19 @@
EXPECT_CALL(mock_callback, Run(kTestDataSize)).Times(0);
EXPECT_EQ(static_cast<int>(kTestDataSize),
stream.Read(buf, kTestDataSize, mock_callback.CreateCallback()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Consume the second element.
EXPECT_CALL(mock_callback, Run(kTestDataSize)).Times(1);
EXPECT_EQ(ERR_IO_PENDING,
stream.Read(buf, kTestDataSize, mock_callback.CreateCallback()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Consume the third and the fourth elements.
EXPECT_CALL(mock_callback, Run(kTestDataSize*2)).Times(1);
EXPECT_EQ(ERR_IO_PENDING,
stream.Read(buf, kTestDataSize*2, mock_callback.CreateCallback()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void UploadDataStreamTest::FileChangedHelper(const FilePath& file_path,
diff --git a/net/cookies/cookie_monster_perftest.cc b/net/cookies/cookie_monster_perftest.cc
index 7e755f06..727671f 100644
--- a/net/cookies/cookie_monster_perftest.cc
+++ b/net/cookies/cookie_monster_perftest.cc
@@ -65,7 +65,7 @@
// Therefore, callbacks will actually always complete synchronously. If the
// tests get more advanced we need to add other means of signaling
// completion.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(has_run_);
has_run_ = false;
}
@@ -164,7 +164,7 @@
PerfTimeLogger timer3("Cookie_monster_deleteall_single_host");
cm->DeleteAllAsync(CookieMonster::DeleteCallback());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
timer3.Done();
}
@@ -197,7 +197,7 @@
PerfTimeLogger timer3("Cookie_monster_deleteall_many_hosts");
cm->DeleteAllAsync(CookieMonster::DeleteCallback());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
timer3.Done();
}
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index af9d316..f4de594 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -1878,14 +1878,14 @@
// Before initialization, FlushStore() should just run the callback.
cm->FlushStore(base::Bind(&CallbackCounter::Callback, counter.get()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(0, store->flush_count());
ASSERT_EQ(1, counter->callback_count());
// NULL callback is safe.
cm->FlushStore(base::Closure());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(0, store->flush_count());
ASSERT_EQ(1, counter->callback_count());
@@ -1893,14 +1893,14 @@
// After initialization, FlushStore() should delegate to the store.
GetAllCookies(cm); // Force init.
cm->FlushStore(base::Bind(&CallbackCounter::Callback, counter.get()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(1, store->flush_count());
ASSERT_EQ(2, counter->callback_count());
// NULL callback is still safe.
cm->FlushStore(base::Closure());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(2, store->flush_count());
ASSERT_EQ(2, counter->callback_count());
@@ -1909,12 +1909,12 @@
cm = new CookieMonster(NULL, NULL);
GetAllCookies(cm); // Force init.
cm->FlushStore(base::Closure());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(2, counter->callback_count());
cm->FlushStore(base::Bind(&CallbackCounter::Callback, counter.get()));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(3, counter->callback_count());
}
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index b6fa920..6c59733 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -237,7 +237,7 @@
delete cache;
}
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Testst that re-creating the cache performs the expected cleanup.
@@ -331,7 +331,7 @@
}
}
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
#if defined(OS_WIN)
// Wait for the actual operation to complete, or we'll keep a file handle that
@@ -383,7 +383,7 @@
delete cache;
}
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(DiskCacheBackendTest, ShutdownWithPendingIO) {
@@ -424,7 +424,7 @@
EXPECT_FALSE(cb.have_result());
}
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(DiskCacheBackendTest, ShutdownWithPendingCreate) {
@@ -876,7 +876,7 @@
// If we evicted the entry in less than 20mS, we have one entry in the cache;
// if it took more than that, we posted a task and we'll delete the second
// entry too.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// This may be not thread-safe in general, but for now it's OK so add some
// ThreadSanitizer annotations to ignore data races on cache_.
@@ -943,7 +943,7 @@
FlushQueueForTest();
// We may abort the eviction before cleaning up everything.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
FlushQueueForTest();
// If it's not clear enough: we may still have eviction tasks running at this
// time, so the number of entries is changing while we read it.
@@ -2277,7 +2277,7 @@
ASSERT_EQ(0, cache_->GetEntryCount());
// We should stop posting tasks at some point (if we post any).
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
disk_cache::Entry *entry3, *entry4;
ASSERT_EQ(net::OK, CreateEntry("third", &entry3));
diff --git a/net/disk_cache/disk_cache_perftest.cc b/net/disk_cache/disk_cache_perftest.cc
index e6b7dce..029277f 100644
--- a/net/disk_cache/disk_cache_perftest.cc
+++ b/net/disk_cache/disk_cache_perftest.cc
@@ -179,7 +179,7 @@
EXPECT_TRUE(TimeWrite(num_entries, cache, &entries));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
delete cache;
ASSERT_TRUE(file_util::EvictFileFromSystemCache(
@@ -202,7 +202,7 @@
EXPECT_TRUE(TimeRead(num_entries, cache, entries, false));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
delete cache;
}
@@ -245,6 +245,6 @@
}
timer2.Done();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
delete[] address;
}
diff --git a/net/disk_cache/disk_cache_test_base.cc b/net/disk_cache/disk_cache_test_base.cc
index 608b729c..76470a0 100644
--- a/net/disk_cache/disk_cache_test_base.cc
+++ b/net/disk_cache/disk_cache_test_base.cc
@@ -41,7 +41,7 @@
}
void DiskCacheTest::TearDown() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
DiskCacheTestWithCache::DiskCacheTestWithCache()
@@ -222,7 +222,7 @@
}
void DiskCacheTestWithCache::TearDown() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
delete cache_;
if (cache_thread_.IsRunning())
cache_thread_.Stop();
diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc
index 5ff7d93..7a581bd 100644
--- a/net/disk_cache/entry_unittest.cc
+++ b/net/disk_cache/entry_unittest.cc
@@ -1841,7 +1841,7 @@
// Make sure we do all needed work. This may fail for entry2 if between Close
// and DoomEntry the system decides to remove all traces of the file from the
// system cache so we don't see that there is pending IO.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
if (memory_only_) {
EXPECT_EQ(0, cache_->GetEntryCount());
@@ -1851,7 +1851,7 @@
// (it's always async on Posix so it is easy to miss). Unfortunately we
// don't have any signal to watch for so we can only wait.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(500));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
EXPECT_EQ(0, cache_->GetEntryCount());
}
diff --git a/net/dns/dns_transaction_unittest.cc b/net/dns/dns_transaction_unittest.cc
index 379664e..0c5563a 100644
--- a/net/dns/dns_transaction_unittest.cc
+++ b/net/dns/dns_transaction_unittest.cc
@@ -273,7 +273,7 @@
bool Run(DnsTransactionFactory* factory) {
StartTransaction(factory);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
return has_completed();
}
@@ -465,7 +465,7 @@
TransactionHelper helper1(kT1HostName, kT1Qtype, kT1RecordCount);
helper1.StartTransaction(transaction_factory_.get());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(helper0.has_completed());
EXPECT_TRUE(helper1.has_completed());
@@ -484,7 +484,7 @@
helper0.Cancel();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(helper0.has_completed());
EXPECT_TRUE(helper1.has_completed());
@@ -500,7 +500,7 @@
// Destroying the client does not affect running requests.
transaction_factory_.reset(NULL);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(helper0.has_completed());
}
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 @@
}
// 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 @@
}
// 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 @@
}
// 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 @@
}
// 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 @@
cache.disk_cache()->ReleaseAll();
delete c;
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, cache.disk_cache()->create_count());
}
@@ -1399,7 +1399,7 @@
// 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 @@
&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 @@
&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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
// 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 @@
}
// 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 @@
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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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..55c4de93 100644
--- a/net/http/http_pipelined_connection_impl_unittest.cc
+++ b/net/http/http_pipelined_connection_impl_unittest.cc
@@ -76,7 +76,7 @@
}
void TearDown() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void Initialize(MockRead* reads, size_t reads_count,
@@ -692,7 +692,7 @@
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 @@
// 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 @@
close_stream.reset();
close_callback.reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(HttpPipelinedConnectionImplTest, CloseBeforeReadCallbackRuns) {
@@ -1118,7 +1118,7 @@
close_stream.reset();
close_callback.reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(HttpPipelinedConnectionImplTest, AbortWhileSendQueued) {
@@ -1520,7 +1520,7 @@
&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 @@
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 @@
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 @@
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());
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
index 2e9bd4ce..480f2f6 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
@@ -146,7 +146,7 @@
void FinishTestAllowCleanup() {
fetcher_->FinishTest();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TestCompletionCallback callback_;
@@ -203,7 +203,7 @@
FetcherClient client;
client.RunTest();
client.fetcher_->Cancel();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_FALSE(client.fetcher_->DidFinish());
ASSERT_TRUE(client.fetcher_->WasCancelled());
EXPECT_EQ(ERR_ABORTED, client.fetcher_->GetResult());
@@ -221,10 +221,10 @@
int max_loops = 4;
while (!client.fetcher_->IsWaitingForFetcher() && max_loops--) {
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
client.fetcher_->Cancel();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_FALSE(client.fetcher_->DidFinish());
ASSERT_TRUE(client.fetcher_->WasCancelled());
EXPECT_EQ(ERR_ABORTED, client.fetcher_->GetResult());
diff --git a/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc b/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc
index bbe28fb..7d474fc 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc
+++ b/net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc
@@ -99,9 +99,9 @@
void WaitUntilDone() {
while (!finished_) {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Attempts to give worker threads time to finish. This is currently
@@ -145,7 +145,7 @@
// exercises the code without stubbing out dependencies.
RealFetchTester fetcher;
fetcher.RunTestWithCancel();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Attempt to avoid Valgrind leak reports in case worker thread is
// still running.
@@ -387,16 +387,16 @@
void RunMessageLoopUntilComplete() {
while (!finished_) {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void RunMessageLoopUntilWorkerDone() {
DCHECK(fetcher_.adapter_query_.get());
while (!fetcher_.worker_finished_event_.TimedWait(
base::TimeDelta::FromMilliseconds(10))) {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
}
diff --git a/net/proxy/multi_threaded_proxy_resolver_unittest.cc b/net/proxy/multi_threaded_proxy_resolver_unittest.cc
index fc0f438..dbd2f5d7 100644
--- a/net/proxy/multi_threaded_proxy_resolver_unittest.cc
+++ b/net/proxy/multi_threaded_proxy_resolver_unittest.cc
@@ -573,7 +573,7 @@
resolver.reset();
// Give any posted tasks a chance to run (in case there is badness).
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Check that none of the outstanding requests were completed.
EXPECT_FALSE(callback0.have_result());
@@ -657,7 +657,7 @@
ASSERT_EQ(1u, factory->resolvers().size());
EXPECT_EQ(1, factory->resolvers()[0]->request_count());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now start 8 requests in parallel -- this will cause the maximum of
// three threads to be provisioned (an additional two from what we already
diff --git a/net/proxy/network_delegate_error_observer_unittest.cc b/net/proxy/network_delegate_error_observer_unittest.cc
index a0fc414..8b2b51ce 100644
--- a/net/proxy/network_delegate_error_observer_unittest.cc
+++ b/net/proxy/network_delegate_error_observer_unittest.cc
@@ -107,7 +107,7 @@
base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError,
base::Unretained(&observer), 42, string16()));
thread.Stop();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_TRUE(network_delegate.got_pac_error());
}
@@ -122,7 +122,7 @@
base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError,
base::Unretained(&observer), 42, string16()));
thread.Stop();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Shouldn't have crashed until here...
}
diff --git a/net/proxy/proxy_config_service_android_unittest.cc b/net/proxy/proxy_config_service_android_unittest.cc
index 84449f0..4d31bad 100644
--- a/net/proxy/proxy_config_service_android_unittest.cc
+++ b/net/proxy/proxy_config_service_android_unittest.cc
@@ -64,7 +64,7 @@
// testing::Test:
virtual void SetUp() OVERRIDE {
- message_loop_->RunAllPending();
+ message_loop_->RunUntilIdle();
service_.AddObserver(&observer_);
}
@@ -89,7 +89,7 @@
void ProxySettingsChanged() {
service_.ProxySettingsChanged();
- message_loop_->RunAllPending();
+ message_loop_->RunUntilIdle();
}
void TestMapping(const std::string& url, const std::string& expected) {
diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc
index a0534c8..7862141 100644
--- a/net/proxy/proxy_config_service_linux_unittest.cc
+++ b/net/proxy/proxy_config_service_linux_unittest.cc
@@ -322,7 +322,7 @@
// [Runs on |io_thread_|] Signals |event_| on cleanup completion.
void CleanUp() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
event_.Signal();
}
diff --git a/net/proxy/proxy_script_decider_unittest.cc b/net/proxy/proxy_script_decider_unittest.cc
index 7cdefa4b..62075c4 100644
--- a/net/proxy/proxy_script_decider_unittest.cc
+++ b/net/proxy/proxy_script_decider_unittest.cc
@@ -590,7 +590,7 @@
// back. Before the fix linked to above, this would try to invoke on
// the callback object provided by ProxyScriptDecider after it was
// no longer valid.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
} // namespace
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index ebe304322..341550e 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -2064,7 +2064,7 @@
// going to return the same PAC URL as before, but this URL needs to be
// refetched on the new network.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending(); // Notification happens async.
+ MessageLoop::current()->RunUntilIdle(); // Notification happens async.
// Start a second request.
ProxyInfo info2;
@@ -2186,7 +2186,7 @@
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
fetcher->NotifyFetchCompletion(OK, kValidPacScript1);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Now that the PAC script is downloaded, it should be used to initialize the
// ProxyResolver. Simulate a successful parse.
@@ -2298,7 +2298,7 @@
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
fetcher->NotifyFetchCompletion(OK, kValidPacScript2);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Now that the PAC script is downloaded, it should be used to initialize the
// ProxyResolver. Simulate a successful parse.
@@ -2408,7 +2408,7 @@
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
fetcher->NotifyFetchCompletion(OK, kValidPacScript1);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_FALSE(resolver->has_pending_set_pac_script_request());
@@ -2514,7 +2514,7 @@
EXPECT_EQ(GURL("http://foopy/proxy.pac"), fetcher->pending_request_url());
fetcher->NotifyFetchCompletion(ERR_FAILED, "");
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// At this point the ProxyService should have re-configured itself to use
// DIRECT connections rather than the given proxy resolver.
@@ -2683,7 +2683,7 @@
// Drain the message loop, so ProxyService is notified of the change
// and has a chance to re-configure itself.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Start a third request -- this time we expect to get a direct connection
// since the PAC script poller experienced a failure.
diff --git a/net/proxy/sync_host_resolver_bridge_unittest.cc b/net/proxy/sync_host_resolver_bridge_unittest.cc
index 905d9a0..81ec33e 100644
--- a/net/proxy/sync_host_resolver_bridge_unittest.cc
+++ b/net/proxy/sync_host_resolver_bridge_unittest.cc
@@ -200,7 +200,7 @@
// (There may have been a completion posted back to origin thread, avoid
// leaking it by running).
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// During the teardown sequence of the single threaded proxy resolver,
// the outstanding host resolve should have been cancelled.
diff --git a/net/socket/buffered_write_stream_socket_unittest.cc b/net/socket/buffered_write_stream_socket_unittest.cc
index 664422e..8a1942a 100644
--- a/net/socket/buffered_write_stream_socket_unittest.cc
+++ b/net/socket/buffered_write_stream_socket_unittest.cc
@@ -19,7 +19,7 @@
class BufferedWriteStreamSocketTest : public testing::Test {
public:
void Finish() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(data_->at_read_eof());
EXPECT_TRUE(data_->at_write_eof());
}
@@ -86,7 +86,7 @@
};
Initialize(writes, arraysize(writes));
TestWrite("abc");
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
TestWrite("def");
data_->RunFor(1);
TestWrite("ghi");
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index 363010ab..dbbeb5d4 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -1040,7 +1040,7 @@
// to flush all tasks, we need to wait so that we know there are no
// soon-to-be-pending tasks waiting.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The next synchronous request should wait for its turn.
connect_job_factory_->set_job_type(TestConnectJob::kMockJob);
@@ -1275,7 +1275,7 @@
}
// Flush all the DoReleaseSocket tasks.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Stall a group. Set a pending job so it'll trigger a backup job if we don't
// reuse a socket.
@@ -1470,10 +1470,10 @@
handle_->Reset();
{
// TODO: Resolve conflicting intentions of stopping recursion with the
- // |!within_callback_| test (above) and the call to |RunAllPending()|
+ // |!within_callback_| test (above) and the call to |RunUntilIdle()|
// below. http://crbug.com/114130.
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
within_callback_ = true;
TestCompletionCallback next_job_callback;
@@ -1670,7 +1670,7 @@
EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a"));
pool_->CloseIdleSockets();
- MessageLoop::current()->RunAllPending(); // Run the released socket wakeups
+ MessageLoop::current()->RunUntilIdle(); // Run the released socket wakeups
}
TEST_F(ClientSocketPoolBaseTest, BasicAsynchronous) {
@@ -1850,7 +1850,7 @@
// Both Requests 2 and 3 are pending. We release socket 1 which should
// service request 2. Request 3 should still be waiting.
req1.handle()->Reset();
- MessageLoop::current()->RunAllPending(); // Run the released socket wakeups
+ MessageLoop::current()->RunUntilIdle(); // Run the released socket wakeups
ASSERT_TRUE(req2.handle()->socket());
EXPECT_EQ(OK, req2.WaitForResult());
EXPECT_FALSE(req3.handle()->socket());
@@ -1932,7 +1932,7 @@
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(LOAD_STATE_IDLE, handle.GetLoadState());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ClientSocketHandle handle2;
TestCompletionCallback callback2;
@@ -2123,7 +2123,7 @@
// to flush all tasks, we need to wait so that we know there are no
// soon-to-be-pending tasks waiting.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Both sockets should now be idle.
ASSERT_EQ(2, pool_->IdleSocketCount());
@@ -2201,7 +2201,7 @@
// to flush all tasks, we need to wait so that we know there are no
// soon-to-be-pending tasks waiting.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_EQ(2, pool_->IdleSocketCount());
@@ -2353,7 +2353,7 @@
handle_a[0].Reset();
// Used to get stuck here.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
handle_b[1].socket()->Disconnect();
handle_b[1].Reset();
@@ -2510,7 +2510,7 @@
pool_->Flush();
handle.Reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(ERR_IO_PENDING, handle.Init("a",
params_,
@@ -2621,7 +2621,7 @@
BoundNetLog()));
}
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Cancel the pending request.
handle.Reset();
@@ -2630,7 +2630,7 @@
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(
ClientSocketPool::kMaxConnectRetryIntervalMs / 2 * 3));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kDefaultMaxSockets, client_socket_factory_.allocation_count());
}
@@ -2659,7 +2659,7 @@
// Wait for the backup timer to fire (add some slop to ensure it fires)
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(
ClientSocketPool::kMaxConnectRetryIntervalMs / 2 * 3));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_TRUE(pool_->HasGroup("bar"));
EXPECT_EQ(1, pool_->NumConnectJobsInGroup("bar"));
}
@@ -2698,7 +2698,7 @@
// Wait for the backup timer to fire (add some slop to ensure it fires)
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(
ClientSocketPool::kMaxConnectRetryIntervalMs / 2 * 3));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Test delayed socket binding for the case where we have two connects,
@@ -2742,7 +2742,7 @@
// binding.
handle1.Reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Still no idle sockets, still one pending connect job.
EXPECT_EQ(0, pool_->IdleSocketCount());
@@ -2758,7 +2758,7 @@
client_socket_factory_.SignalJobs();
EXPECT_EQ(0, pool_->NumConnectJobsInGroup("a"));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Test delayed socket binding when a group is at capacity and one
@@ -2800,7 +2800,7 @@
// binding.
handle1.Reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Still no idle sockets, still one pending connect job.
EXPECT_EQ(0, pool_->IdleSocketCount());
@@ -2816,7 +2816,7 @@
client_socket_factory_.SignalJobs();
EXPECT_EQ(0, pool_->NumConnectJobsInGroup("a"));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Test out the case where we have one socket connected, one
@@ -2860,7 +2860,7 @@
// binding.
handle1.Reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Still no idle sockets, still one pending connect job.
EXPECT_EQ(0, pool_->IdleSocketCount());
@@ -2876,7 +2876,7 @@
client_socket_factory_.SignalJobs();
EXPECT_EQ(0, pool_->NumConnectJobsInGroup("a"));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Cover the case where on an available socket slot, we have one pending
@@ -3501,7 +3501,7 @@
EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a"));
EXPECT_EQ(1, pool_->NumUnassignedConnectJobsInGroup("a"));
EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a"));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Make the backup job be a pending job, so it completes normally.
connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob);
diff --git a/net/socket/deterministic_socket_data_unittest.cc b/net/socket/deterministic_socket_data_unittest.cc
index e1f42f44e3..055fbdc 100644
--- a/net/socket/deterministic_socket_data_unittest.cc
+++ b/net/socket/deterministic_socket_data_unittest.cc
@@ -80,7 +80,7 @@
void DeterministicSocketDataTest::TearDown() {
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
PlatformTest::TearDown();
}
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index 41ccd08..407c543b9 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -466,7 +466,7 @@
// since they can change in either.
while ((!at_write_eof() || !at_read_eof()) && !stopped()) {
if (counter % 2 == 0)
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
if (counter % 2 == 1) {
InvokeCallbacks();
}
@@ -477,7 +477,7 @@
while (socket_ && (socket_->write_pending() || socket_->read_pending()) &&
!stopped()) {
InvokeCallbacks();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
SetStopped(false);
}
@@ -1483,7 +1483,7 @@
if (keep_alive == NO_KEEP_ALIVE)
(*i)->handle()->socket()->Disconnect();
(*i)->handle()->Reset();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
return true;
}
}
diff --git a/net/socket/socks_client_socket_pool_unittest.cc b/net/socket/socks_client_socket_pool_unittest.cc
index 9912854..a8d0a9f 100644
--- a/net/socket/socks_client_socket_pool_unittest.cc
+++ b/net/socket/socks_client_socket_pool_unittest.cc
@@ -222,7 +222,7 @@
EXPECT_EQ(0, transport_socket_pool_.cancel_count());
// Now wait for the TCP sockets to connect.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(ClientSocketPoolTest::kRequestNotFound, GetOrderOfRequest(1));
EXPECT_EQ(ClientSocketPoolTest::kRequestNotFound, GetOrderOfRequest(2));
@@ -258,7 +258,7 @@
EXPECT_EQ(0, transport_socket_pool_.release_count());
// Now wait for the async data to reach the SOCKS connect jobs.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(ClientSocketPoolTest::kRequestNotFound, GetOrderOfRequest(1));
EXPECT_EQ(ClientSocketPoolTest::kRequestNotFound, GetOrderOfRequest(2));
diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc
index d7ff4e6..12a9a7d 100644
--- a/net/socket/transport_client_socket_pool_unittest.cc
+++ b/net/socket/transport_client_socket_pool_unittest.cc
@@ -813,7 +813,7 @@
handle_->Reset();
{
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
within_callback_ = true;
scoped_refptr<TransportSocketParams> dest(new TransportSocketParams(
@@ -915,14 +915,14 @@
handle.Reset();
// Need to run all pending to release the socket back to the pool.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Now we should have 1 idle socket.
EXPECT_EQ(1, pool_.IdleSocketCount());
// After an IP address change, we should have 0 idle sockets.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- MessageLoop::current()->RunAllPending(); // Notification happens async.
+ MessageLoop::current()->RunUntilIdle(); // Notification happens async.
EXPECT_EQ(0, pool_.IdleSocketCount());
}
@@ -965,14 +965,14 @@
EXPECT_FALSE(handle.socket());
// Create the first socket, set the timer.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Wait for the backup socket timer to fire.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(
ClientSocketPool::kMaxConnectRetryIntervalMs + 50));
// Let the appropriate socket connect.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(OK, callback.WaitForResult());
EXPECT_TRUE(handle.is_initialized());
@@ -1007,7 +1007,7 @@
EXPECT_FALSE(handle.socket());
// Create the first socket, set the timer.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
if (index == CANCEL_AFTER_WAIT) {
// Wait for the backup socket timer to fire.
@@ -1016,7 +1016,7 @@
}
// Let the appropriate socket connect.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
handle.Reset();
@@ -1053,7 +1053,7 @@
EXPECT_FALSE(handle.socket());
// Create the first socket, set the timer.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Wait for the backup socket timer to fire.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(
@@ -1064,7 +1064,7 @@
host_resolver_->set_synchronous_mode(true);
// Let the appropriate socket connect.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(ERR_CONNECTION_FAILED, callback.WaitForResult());
EXPECT_FALSE(handle.is_initialized());
@@ -1101,7 +1101,7 @@
EXPECT_FALSE(handle.socket());
// Create the first socket, set the timer.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Wait for the backup socket timer to fire.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(
@@ -1112,7 +1112,7 @@
host_resolver_->set_synchronous_mode(true);
// Let the appropriate socket connect.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(ERR_CONNECTION_FAILED, callback.WaitForResult());
EXPECT_FALSE(handle.is_initialized());
diff --git a/net/spdy/spdy_http_stream_spdy2_unittest.cc b/net/spdy/spdy_http_stream_spdy2_unittest.cc
index 96cd3522..f11faf0 100644
--- a/net/spdy/spdy_http_stream_spdy2_unittest.cc
+++ b/net/spdy/spdy_http_stream_spdy2_unittest.cc
@@ -35,7 +35,7 @@
virtual void TearDown() {
crypto::ECSignatureCreator::SetFactoryForTesting(NULL);
UploadDataStream::ResetMergeChunks();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void set_merge_chunks(bool merge) {
@@ -179,7 +179,7 @@
// This triggers read 3. The empty read causes the session to shut down.
data()->CompleteRead();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Because we abandoned the stream, we don't expect to find a session in the
// pool anymore.
diff --git a/net/spdy/spdy_http_stream_spdy3_unittest.cc b/net/spdy/spdy_http_stream_spdy3_unittest.cc
index 0be266e..6dcf8120 100644
--- a/net/spdy/spdy_http_stream_spdy3_unittest.cc
+++ b/net/spdy/spdy_http_stream_spdy3_unittest.cc
@@ -39,7 +39,7 @@
virtual void TearDown() {
crypto::ECSignatureCreator::SetFactoryForTesting(NULL);
UploadDataStream::ResetMergeChunks();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void set_merge_chunks(bool merge) {
@@ -188,7 +188,7 @@
// This triggers read 3. The empty read causes the session to shut down.
data()->CompleteRead();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Because we abandoned the stream, we don't expect to find a session in the
// pool anymore.
diff --git a/net/spdy/spdy_network_transaction_spdy2_unittest.cc b/net/spdy/spdy_network_transaction_spdy2_unittest.cc
index 45a9b2f..b71e20f 100644
--- a/net/spdy/spdy_network_transaction_spdy2_unittest.cc
+++ b/net/spdy/spdy_network_transaction_spdy2_unittest.cc
@@ -55,7 +55,7 @@
virtual void TearDown() {
UploadDataStream::ResetMergeChunks();
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void set_merge_chunks(bool merge) {
@@ -462,7 +462,7 @@
// reads until we complete our callback.
while (!callback.have_result()) {
data->CompleteRead();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
rv = callback.WaitForResult();
} else if (rv <= 0) {
@@ -516,7 +516,7 @@
rv = trans2->Start(
&CreateGetPushRequest(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The data for the pushed path may be coming in more than 1 packet. Compile
// the results into a single string.
@@ -2019,7 +2019,7 @@
MockRead reads[] = {
CreateMockRead(*resp),
// This following read isn't used by the test, except during the
- // RunAllPending() call at the end since the SpdySession survives the
+ // RunUntilIdle() call at the end since the SpdySession survives the
// HttpNetworkTransaction and still tries to continue Read()'ing. Any
// MockRead will do here.
MockRead(ASYNC, 0, 0) // EOF
@@ -2042,7 +2042,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
helper.VerifyDataNotConsumed();
}
@@ -2193,7 +2193,7 @@
data.CompleteRead();
// Finish running rest of tasks.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
helper.VerifyDataConsumed();
}
@@ -3729,7 +3729,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -3825,7 +3825,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -3916,7 +3916,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -4010,7 +4010,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -4080,7 +4080,7 @@
// Flush the MessageLoop; this will cause the buffered IO task
// to run for the final time.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -4694,7 +4694,7 @@
if (variant == VARIANT_RST_DURING_READ_COMPLETION) {
// Writes to the socket complete asynchronously on SPDY by running
// through the message loop. Complete the write here.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Now schedule the ERR_CONNECTION_RESET.
@@ -5032,7 +5032,7 @@
&CreateGetPushRequest(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
data.RunFor(3);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Read the server push body.
std::string result2;
@@ -5183,7 +5183,7 @@
&CreateGetPushRequest(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
data.RunFor(3);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Read the server push body.
std::string result2;
@@ -5321,7 +5321,7 @@
&CreateGetPushRequest(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
data.RunFor(2);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Read the server push body.
std::string result2;
@@ -5740,7 +5740,7 @@
// Run the message loop, but do not allow the write to complete.
// This leaves the SpdySession with a write pending, which prevents
// SpdySession from attempting subsequent writes until this write completes.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Now, start both new transactions
HttpRequestInfo info2 = CreateGetRequest();
@@ -5750,7 +5750,7 @@
new HttpNetworkTransaction(helper.session()));
rv = trans2->Start(&info2, callback2.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
HttpRequestInfo info3 = CreateGetRequest();
info3.priority = HIGHEST;
@@ -5759,7 +5759,7 @@
new HttpNetworkTransaction(helper.session()));
rv = trans3->Start(&info3, callback3.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now have two SYN_STREAM frames queued up which will be
// dequeued only once the first write completes, which we
diff --git a/net/spdy/spdy_network_transaction_spdy3_unittest.cc b/net/spdy/spdy_network_transaction_spdy3_unittest.cc
index c3425b60..fe218c5 100644
--- a/net/spdy/spdy_network_transaction_spdy3_unittest.cc
+++ b/net/spdy/spdy_network_transaction_spdy3_unittest.cc
@@ -55,7 +55,7 @@
virtual void TearDown() {
UploadDataStream::ResetMergeChunks();
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void set_merge_chunks(bool merge) {
@@ -463,7 +463,7 @@
// reads until we complete our callback.
while (!callback.have_result()) {
data->CompleteRead();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
rv = callback.WaitForResult();
} else if (rv <= 0) {
@@ -517,7 +517,7 @@
rv = trans2->Start(
&CreateGetPushRequest(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The data for the pushed path may be coming in more than 1 packet. Compile
// the results into a single string.
@@ -2119,7 +2119,7 @@
// Force write of WINDOW_UPDATE which was scheduled during the above
// read.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Read EOF.
data.CompleteRead();
@@ -2199,7 +2199,7 @@
// writes go through before a read could happen. However, the last frame
// ("hello!") is not supposed to go through since by the time its turn
// arrives, window size is 0. At this point MessageLoop::Run() called via
-// callback would block. Therefore we call MessageLoop::RunAllPending()
+// callback would block. Therefore we call MessageLoop::RunUntilIdle()
// which returns after performing all possible writes. We use DCHECKS to
// ensure that last data frame is still there and stream has stalled.
// After that, next read is artifically enforced, which causes a
@@ -2281,7 +2281,7 @@
int rv = trans->Start(&helper.request(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- MessageLoop::current()->RunAllPending(); // Write as much as we can.
+ MessageLoop::current()->RunUntilIdle(); // Write as much as we can.
SpdyHttpStream* stream = static_cast<SpdyHttpStream*>(trans->stream_.get());
ASSERT_TRUE(stream != NULL);
@@ -2379,7 +2379,7 @@
int rv = trans->Start(&helper.request(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- MessageLoop::current()->RunAllPending(); // Write as much as we can.
+ MessageLoop::current()->RunUntilIdle(); // Write as much as we can.
SpdyHttpStream* stream = static_cast<SpdyHttpStream*>(trans->stream_.get());
ASSERT_TRUE(stream != NULL);
@@ -2486,7 +2486,7 @@
int rv = trans->Start(&helper.request(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- MessageLoop::current()->RunAllPending(); // Write as much as we can.
+ MessageLoop::current()->RunUntilIdle(); // Write as much as we can.
SpdyHttpStream* stream = static_cast<SpdyHttpStream*>(trans->stream_.get());
ASSERT_TRUE(stream != NULL);
@@ -2586,7 +2586,7 @@
MockRead reads[] = {
CreateMockRead(*resp),
// This following read isn't used by the test, except during the
- // RunAllPending() call at the end since the SpdySession survives the
+ // RunUntilIdle() call at the end since the SpdySession survives the
// HttpNetworkTransaction and still tries to continue Read()'ing. Any
// MockRead will do here.
MockRead(ASYNC, 0, 0) // EOF
@@ -2609,7 +2609,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
helper.VerifyDataNotConsumed();
}
@@ -2760,7 +2760,7 @@
data.CompleteRead();
// Finish running rest of tasks.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
helper.VerifyDataConsumed();
}
@@ -4300,7 +4300,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -4396,7 +4396,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -4487,7 +4487,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -4581,7 +4581,7 @@
// Flush the MessageLoop while the SpdySessionDependencies (in particular, the
// MockClientSocketFactory) are still alive.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -4651,7 +4651,7 @@
// Flush the MessageLoop; this will cause the buffered IO task
// to run for the final time.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Verify that we consumed all test data.
helper.VerifyDataConsumed();
@@ -5267,7 +5267,7 @@
if (variant == VARIANT_RST_DURING_READ_COMPLETION) {
// Writes to the socket complete asynchronously on SPDY by running
// through the message loop. Complete the write here.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
// Now schedule the ERR_CONNECTION_RESET.
@@ -5607,7 +5607,7 @@
&CreateGetPushRequest(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
data.RunFor(3);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Read the server push body.
std::string result2;
@@ -5759,7 +5759,7 @@
&CreateGetPushRequest(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
data.RunFor(3);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Read the server push body.
std::string result2;
@@ -5901,7 +5901,7 @@
&CreateGetPushRequest(), callback.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
data.RunFor(2);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Read the server push body.
std::string result2;
@@ -6320,7 +6320,7 @@
// Run the message loop, but do not allow the write to complete.
// This leaves the SpdySession with a write pending, which prevents
// SpdySession from attempting subsequent writes until this write completes.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// Now, start both new transactions
HttpRequestInfo info2 = CreateGetRequest();
@@ -6330,7 +6330,7 @@
new HttpNetworkTransaction(helper.session()));
rv = trans2->Start(&info2, callback2.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
HttpRequestInfo info3 = CreateGetRequest();
info3.priority = HIGHEST;
@@ -6339,7 +6339,7 @@
new HttpNetworkTransaction(helper.session()));
rv = trans3->Start(&info3, callback3.callback(), BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// We now have two SYN_STREAM frames queued up which will be
// dequeued only once the first write completes, which we
diff --git a/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc b/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc
index bfe4c6b..424514c9 100644
--- a/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc
+++ b/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc
@@ -165,7 +165,7 @@
session_->spdy_session_pool()->CloseAllSessions();
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
PlatformTest::TearDown();
}
diff --git a/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc b/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc
index 7e99ea0..19ae6a7 100644
--- a/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc
+++ b/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc
@@ -165,7 +165,7 @@
session_->spdy_session_pool()->CloseAllSessions();
// Empty the current queue.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
PlatformTest::TearDown();
}
diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc
index b4e8b00..636defe 100644
--- a/net/spdy/spdy_session_spdy2_unittest.cc
+++ b/net/spdy/spdy_session_spdy2_unittest.cc
@@ -190,7 +190,7 @@
EXPECT_EQ(2, session->GetProtocolVersion());
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -358,7 +358,7 @@
spdy_stream1->SetDelegate(delegate.get());
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -838,7 +838,7 @@
callback.reset();
// Should not crash when running the pending callback.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(SpdySessionSpdy2Test, SendInitialSettingsOnNewSession) {
@@ -899,7 +899,7 @@
HttpNetworkSession::NORMAL_SOCKET_POOL),
BoundNetLog()));
EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(data.at_write_eof());
}
@@ -967,7 +967,7 @@
HttpNetworkSession::NORMAL_SOCKET_POOL),
BoundNetLog()));
EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(data.at_write_eof());
}
@@ -1050,7 +1050,7 @@
pool_peer.AddAlias(test_hosts[0].addresses.front(), test_hosts[0].pair);
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The third host has no overlap with the first, so it can't pool IPs.
EXPECT_FALSE(spdy_session_pool->HasSession(test_hosts[2].pair));
@@ -1203,7 +1203,7 @@
EXPECT_FALSE(session->NeedsCredentials());
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
spdy_session_pool->Remove(session);
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -1258,7 +1258,7 @@
EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -1373,7 +1373,7 @@
spdy_stream1->SendRequest(false);
spdy_stream2->SendRequest(false);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(3u, spdy_stream1->stream_id());
EXPECT_EQ(1u, spdy_stream2->stream_id());
diff --git a/net/spdy/spdy_session_spdy3_unittest.cc b/net/spdy/spdy_session_spdy3_unittest.cc
index 5b35a41..e03156d 100644
--- a/net/spdy/spdy_session_spdy3_unittest.cc
+++ b/net/spdy/spdy_session_spdy3_unittest.cc
@@ -191,7 +191,7 @@
EXPECT_EQ(3, session->GetProtocolVersion());
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -359,7 +359,7 @@
spdy_stream1->SetDelegate(delegate.get());
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -843,7 +843,7 @@
callback.reset();
// Should not crash when running the pending callback.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(SpdySessionSpdy3Test, SendInitialSettingsOnNewSession) {
@@ -909,7 +909,7 @@
HttpNetworkSession::NORMAL_SOCKET_POOL),
BoundNetLog()));
EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(data.at_write_eof());
}
@@ -977,7 +977,7 @@
HttpNetworkSession::NORMAL_SOCKET_POOL),
BoundNetLog()));
EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(data.at_write_eof());
}
@@ -1060,7 +1060,7 @@
pool_peer.AddAlias(test_hosts[0].addresses.front(), test_hosts[0].pair);
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
// The third host has no overlap with the first, so it can't pool IPs.
EXPECT_FALSE(spdy_session_pool->HasSession(test_hosts[2].pair));
@@ -1212,7 +1212,7 @@
EXPECT_TRUE(session->NeedsCredentials());
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
spdy_session_pool->Remove(session);
}
@@ -1282,7 +1282,7 @@
EXPECT_TRUE(session->NeedsCredentials());
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
spdy_session_pool->Remove(session);
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -1337,7 +1337,7 @@
EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
// Flush the SpdySession::OnReadComplete() task.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
@@ -1429,7 +1429,7 @@
EXPECT_NE(spdy_stream1->send_window_size(), window_size);
data->RunFor(1); // Process the SETTINGS frame, but not the EOF
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(session->initial_send_window_size(), window_size);
EXPECT_EQ(spdy_stream1->send_window_size(), window_size);
@@ -1544,7 +1544,7 @@
spdy_stream1->SendRequest(false);
spdy_stream2->SendRequest(false);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(3u, spdy_stream1->stream_id());
EXPECT_EQ(1u, spdy_stream2->stream_id());
diff --git a/net/spdy/spdy_stream_spdy2_unittest.cc b/net/spdy/spdy_stream_spdy2_unittest.cc
index 20af1f1e..10c24a85 100644
--- a/net/spdy/spdy_stream_spdy2_unittest.cc
+++ b/net/spdy/spdy_stream_spdy2_unittest.cc
@@ -49,7 +49,7 @@
}
virtual void TearDown() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
scoped_refptr<HttpNetworkSession> session_;
diff --git a/net/spdy/spdy_stream_spdy3_unittest.cc b/net/spdy/spdy_stream_spdy3_unittest.cc
index 9cc395b..53a8f9a 100644
--- a/net/spdy/spdy_stream_spdy3_unittest.cc
+++ b/net/spdy/spdy_stream_spdy3_unittest.cc
@@ -49,7 +49,7 @@
}
virtual void TearDown() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
scoped_refptr<HttpNetworkSession> session_;
diff --git a/net/spdy/spdy_websocket_stream_spdy2_unittest.cc b/net/spdy/spdy_websocket_stream_spdy2_unittest.cc
index ed99b3f1..1835d42 100644
--- a/net/spdy/spdy_websocket_stream_spdy2_unittest.cc
+++ b/net/spdy/spdy_websocket_stream_spdy2_unittest.cc
@@ -202,7 +202,7 @@
}
virtual void TearDown() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void Prepare(SpdyStreamId stream_id) {
diff --git a/net/spdy/spdy_websocket_stream_spdy3_unittest.cc b/net/spdy/spdy_websocket_stream_spdy3_unittest.cc
index 35e35e20..e774b68 100644
--- a/net/spdy/spdy_websocket_stream_spdy3_unittest.cc
+++ b/net/spdy/spdy_websocket_stream_spdy3_unittest.cc
@@ -202,7 +202,7 @@
}
virtual void TearDown() {
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
void Prepare(SpdyStreamId stream_id) {
diff --git a/net/url_request/url_fetcher_impl_unittest.cc b/net/url_request/url_fetcher_impl_unittest.cc
index 6435baf..9a231bb 100644
--- a/net/url_request/url_fetcher_impl_unittest.cc
+++ b/net/url_request/url_fetcher_impl_unittest.cc
@@ -1136,7 +1136,7 @@
MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit().
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_FALSE(file_util::PathExists(file_path_))
<< file_path_.value() << " not removed.";
}
@@ -1193,7 +1193,7 @@
MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit().
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
}
TEST_F(URLFetcherFileTest, SmallGetToTempFile) {
@@ -1244,7 +1244,7 @@
MessageLoop::current()->Run(); // OnURLFetchComplete() will Quit().
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
ASSERT_FALSE(file_util::PathExists(file_path_))
<< file_path_.value() << " not removed.";
}
diff --git a/net/url_request/url_request_ftp_job_unittest.cc b/net/url_request/url_request_ftp_job_unittest.cc
index 743daf1f..e13a80d 100644
--- a/net/url_request/url_request_ftp_job_unittest.cc
+++ b/net/url_request/url_request_ftp_job_unittest.cc
@@ -68,7 +68,7 @@
ftp_job->Start();
EXPECT_CALL(delegate, OnResponseStarted(_))
.WillOnce(HandleOnResponseStarted(URLRequestStatus::FAILED));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(url_request.is_pending());
}
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 40c4a8d..5486a90 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -3211,7 +3211,7 @@
r.Start();
EXPECT_TRUE(r.is_pending());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
AddChunksToUpload(&r);
MessageLoop::current()->Run();
diff --git a/net/websockets/websocket_job_spdy2_unittest.cc b/net/websockets/websocket_job_spdy2_unittest.cc
index f1ed00d..7c60195 100644
--- a/net/websockets/websocket_job_spdy2_unittest.cc
+++ b/net/websockets/websocket_job_spdy2_unittest.cc
@@ -580,7 +580,7 @@
SkipToConnecting();
DoSendRequest();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithoutCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_.get(),
@@ -590,7 +590,7 @@
websocket_->OnReceivedData(socket_.get(),
kHandshakeResponseWithoutCookie,
kHandshakeResponseWithoutCookieLength);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
CloseWebSocketJob();
@@ -605,7 +605,7 @@
DoSendRequest();
// We assume request is sent in one data chunk (from WebKit)
// We don't support streaming request.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithoutCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_.get(),
@@ -620,12 +620,12 @@
websocket_->OnReceivedData(socket_,
line.c_str(),
line.size());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(delegate.received_data().empty());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
}
websocket_->OnReceivedData(socket_.get(), "\r\n", 2);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(delegate.received_data().empty());
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
@@ -654,7 +654,7 @@
bool sent = websocket_->SendData(kHandshakeRequestWithCookie,
kHandshakeRequestWithCookieLength);
EXPECT_TRUE(sent);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithFilteredCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_,
@@ -665,7 +665,7 @@
websocket_->OnReceivedData(socket_.get(),
kHandshakeResponseWithCookie,
kHandshakeResponseWithCookieLength);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
@@ -689,7 +689,7 @@
bool sent = websocket_->SendData(kHandshakeRequestWithCookie,
kHandshakeRequestWithCookieLength);
EXPECT_TRUE(sent);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithFilteredCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_,
@@ -700,7 +700,7 @@
websocket_->OnReceivedData(socket_.get(),
kHandshakeResponseWithCookie,
kHandshakeResponseWithCookieLength);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
@@ -733,7 +733,7 @@
bool sent = websocket_->SendData(kHandshakeRequestWithCookie,
kHandshakeRequestWithCookieLength);
EXPECT_TRUE(sent);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithoutCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_, kHandshakeRequestWithoutCookieLength);
@@ -743,7 +743,7 @@
websocket_->OnReceivedData(socket_.get(),
kHandshakeResponseWithCookie,
kHandshakeResponseWithCookieLength);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
@@ -783,7 +783,7 @@
DoSendRequest();
// We assume request is sent in one data chunk (from WebKit)
// We don't support streaming request.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithoutCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_.get(),
diff --git a/net/websockets/websocket_job_spdy3_unittest.cc b/net/websockets/websocket_job_spdy3_unittest.cc
index b7582520..be36fc7 100644
--- a/net/websockets/websocket_job_spdy3_unittest.cc
+++ b/net/websockets/websocket_job_spdy3_unittest.cc
@@ -579,7 +579,7 @@
SkipToConnecting();
DoSendRequest();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithoutCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_.get(),
@@ -589,7 +589,7 @@
websocket_->OnReceivedData(socket_.get(),
kHandshakeResponseWithoutCookie,
kHandshakeResponseWithoutCookieLength);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
CloseWebSocketJob();
@@ -604,7 +604,7 @@
DoSendRequest();
// We assume request is sent in one data chunk (from WebKit)
// We don't support streaming request.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithoutCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_.get(),
@@ -619,12 +619,12 @@
websocket_->OnReceivedData(socket_,
line.c_str(),
line.size());
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_TRUE(delegate.received_data().empty());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
}
websocket_->OnReceivedData(socket_.get(), "\r\n", 2);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_FALSE(delegate.received_data().empty());
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
@@ -653,7 +653,7 @@
bool sent = websocket_->SendData(kHandshakeRequestWithCookie,
kHandshakeRequestWithCookieLength);
EXPECT_TRUE(sent);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithFilteredCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_,
@@ -664,7 +664,7 @@
websocket_->OnReceivedData(socket_.get(),
kHandshakeResponseWithCookie,
kHandshakeResponseWithCookieLength);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
@@ -688,7 +688,7 @@
bool sent = websocket_->SendData(kHandshakeRequestWithCookie,
kHandshakeRequestWithCookieLength);
EXPECT_TRUE(sent);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithFilteredCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_,
@@ -699,7 +699,7 @@
websocket_->OnReceivedData(socket_.get(),
kHandshakeResponseWithCookie,
kHandshakeResponseWithCookieLength);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
@@ -732,7 +732,7 @@
bool sent = websocket_->SendData(kHandshakeRequestWithCookie,
kHandshakeRequestWithCookieLength);
EXPECT_TRUE(sent);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithoutCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_, kHandshakeRequestWithoutCookieLength);
@@ -742,7 +742,7 @@
websocket_->OnReceivedData(socket_.get(),
kHandshakeResponseWithCookie,
kHandshakeResponseWithCookieLength);
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeResponseWithoutCookie, delegate.received_data());
EXPECT_EQ(WebSocketJob::OPEN, GetWebSocketJobState());
@@ -782,7 +782,7 @@
DoSendRequest();
// We assume request is sent in one data chunk (from WebKit)
// We don't support streaming request.
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(kHandshakeRequestWithoutCookie, sent_data());
EXPECT_EQ(WebSocketJob::CONNECTING, GetWebSocketJobState());
websocket_->OnSentData(socket_.get(),
diff --git a/net/websockets/websocket_throttle_unittest.cc b/net/websockets/websocket_throttle_unittest.cc
index af3e022..ef05c4ce 100644
--- a/net/websockets/websocket_throttle_unittest.cc
+++ b/net/websockets/websocket_throttle_unittest.cc
@@ -210,7 +210,7 @@
"\r\n"
"8jKS'y:G*Co,Wxa-";
w1->OnReceivedData(s1.get(), kHeader2, sizeof(kHeader2) - 1);
- MessageLoopForIO::current()->RunAllPending();
+ MessageLoopForIO::current()->RunUntilIdle();
// Now, w1 is open.
EXPECT_EQ(WebSocketJob::OPEN, w1->state());
// So, w2 and w3 can start connecting. w4 needs to wait w2 (1.2.3.4)
@@ -225,7 +225,7 @@
// Closing s1 doesn't change waiting queue.
DVLOG(1) << "socket1 close";
w1->OnClose(s1.get());
- MessageLoopForIO::current()->RunAllPending();
+ MessageLoopForIO::current()->RunUntilIdle();
EXPECT_FALSE(callback_s4.have_result());
s1->DetachDelegate();
// Address | head -> tail
@@ -238,7 +238,7 @@
// w5 close() closes SocketStream that change state to STATE_CLOSE, calls
// DoLoop(), so OnClose() callback will be called.
w5->OnClose(s5.get());
- MessageLoopForIO::current()->RunAllPending();
+ MessageLoopForIO::current()->RunUntilIdle();
EXPECT_FALSE(callback_s4.have_result());
// Address | head -> tail
// 1.2.3.4 | w2 w4
@@ -249,7 +249,7 @@
// w6 close abnormally (e.g. renderer finishes) while waiting in queue.
DVLOG(1) << "socket6 close abnormally";
w6->DetachDelegate();
- MessageLoopForIO::current()->RunAllPending();
+ MessageLoopForIO::current()->RunUntilIdle();
EXPECT_FALSE(callback_s4.have_result());
// Address | head -> tail
// 1.2.3.4 | w2 w4
@@ -259,7 +259,7 @@
// Closing s2 kicks w4 to start connecting.
DVLOG(1) << "socket2 close";
w2->OnClose(s2.get());
- MessageLoopForIO::current()->RunAllPending();
+ MessageLoopForIO::current()->RunUntilIdle();
EXPECT_TRUE(callback_s4.have_result());
// Address | head -> tail
// 1.2.3.4 | w4
@@ -269,12 +269,12 @@
DVLOG(1) << "socket3 close";
w3->OnClose(s3.get());
- MessageLoopForIO::current()->RunAllPending();
+ MessageLoopForIO::current()->RunUntilIdle();
s3->DetachDelegate();
w4->OnClose(s4.get());
s4->DetachDelegate();
DVLOG(1) << "Done";
- MessageLoopForIO::current()->RunAllPending();
+ MessageLoopForIO::current()->RunUntilIdle();
}
TEST_F(WebSocketThrottleTest, NoThrottleForDuplicateAddress) {
@@ -302,7 +302,7 @@
w1->OnClose(s1.get());
s1->DetachDelegate();
DVLOG(1) << "Done";
- MessageLoopForIO::current()->RunAllPending();
+ MessageLoopForIO::current()->RunUntilIdle();
}
}