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

Unified Diff: net/disk_cache/backend_unittest.cc

Issue 2053133002: Remove MessageLoop::current()->RunUntilIdle() in net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cookies/cookie_monster_unittest.cc ('k') | net/disk_cache/disk_cache_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_unittest.cc
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index dd15fae2bdcc86971e648b28670676787ff1ea1c..d9e6c2dc5dcd3efcb7edfb671fa6786ebfebb134 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -481,7 +481,7 @@ TEST_F(DiskCacheTest, CreateBackend) {
cache.reset();
}
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
// Tests that |BackendImpl| fails to initialize with a missing file.
@@ -550,7 +550,7 @@ void DiskCacheBackendTest::BackendShutdownWithPendingFileIO(bool fast) {
EXPECT_TRUE(cb.have_result());
}
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
#if !defined(OS_IOS)
// Wait for the actual operation to complete, or we'll keep a file handle that
@@ -614,7 +614,7 @@ TEST_F(DiskCacheBackendTest, MultipleInstancesWithPendingFileIO) {
if (rv == net::ERR_IO_PENDING)
EXPECT_FALSE(cb.have_result());
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Wait for the actual operation to complete, or we'll keep a file handle that
// may cause issues later.
@@ -648,7 +648,7 @@ void DiskCacheBackendTest::BackendShutdownWithPendingIO(bool fast) {
cache_.reset();
}
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_FALSE(cb.have_result());
}
@@ -688,7 +688,7 @@ void DiskCacheBackendTest::BackendShutdownWithPendingCreate(bool fast) {
EXPECT_FALSE(cb.have_result());
}
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_FALSE(cb.have_result());
}
@@ -730,7 +730,7 @@ void DiskCacheBackendTest::BackendShutdownWithPendingDoom() {
EXPECT_FALSE(cb.have_result());
}
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_FALSE(cb.have_result());
}
@@ -1203,7 +1203,7 @@ void DiskCacheBackendTest::BackendTrimInvalidEntry() {
// 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.
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().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_.
@@ -1268,7 +1268,7 @@ void DiskCacheBackendTest::BackendTrimInvalidEntry2() {
FlushQueueForTest();
// We may abort the eviction before cleaning up everything.
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().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.
@@ -3068,7 +3068,7 @@ void DiskCacheBackendTest::BackendDoomAll() {
ASSERT_EQ(0, cache_->GetEntryCount());
// We should stop posting tasks at some point (if we post any).
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
disk_cache::Entry *entry3, *entry4;
EXPECT_NE(net::OK, OpenEntry("third", &entry3));
« no previous file with comments | « net/cookies/cookie_monster_unittest.cc ('k') | net/disk_cache/disk_cache_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698