Chromium Code Reviews| Index: net/disk_cache/disk_cache_perftest.cc |
| diff --git a/net/disk_cache/disk_cache_perftest.cc b/net/disk_cache/disk_cache_perftest.cc |
| index 759515a5f4ddbf7df7246634672629f639a93b64..29bebbce5db0a88c03f600b43be0582d02d8ac7b 100644 |
| --- a/net/disk_cache/disk_cache_perftest.cc |
| +++ b/net/disk_cache/disk_cache_perftest.cc |
| @@ -24,6 +24,7 @@ |
| #include "net/disk_cache/disk_cache.h" |
| #include "net/disk_cache/disk_cache_test_base.h" |
| #include "net/disk_cache/disk_cache_test_util.h" |
| +#include "net/disk_cache/simple/simple_backend_impl.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "testing/platform_test.h" |
| @@ -235,11 +236,18 @@ void DiskCachePerfTest::CacheBackendPerformance() { |
| InitCache(); |
| EXPECT_TRUE(TimeWrite()); |
| + base::MessageLoop::current()->RunUntilIdle(); |
|
Randy Smith (Not in Mondays)
2016/05/26 18:26:25
Why is this needed? I'd think that FlushWorkerPoo
gavinp
2016/05/26 19:03:29
You're right; I was just anxious because this has
|
| + disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting(); |
| + base::MessageLoop::current()->RunUntilIdle(); |
| + |
| ResetAndEvictSystemDiskCache(); |
| EXPECT_TRUE(TimeRead(WhatToRead::HEADERS_ONLY, |
| "Read disk cache headers only (cold)")); |
| EXPECT_TRUE(TimeRead(WhatToRead::HEADERS_ONLY, |
| "Read disk cache headers only (warm)")); |
| + |
| + base::MessageLoop::current()->RunUntilIdle(); |
|
Randy Smith (Not in Mondays)
2016/05/26 18:26:25
I'm a bit more worried about this one, as its plac
gavinp
2016/05/26 19:03:29
The Close() operations after each of the reads nee
|
| + disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting(); |
| base::MessageLoop::current()->RunUntilIdle(); |
| ResetAndEvictSystemDiskCache(); |
| @@ -247,7 +255,6 @@ void DiskCachePerfTest::CacheBackendPerformance() { |
| TimeRead(WhatToRead::HEADERS_AND_BODY, "Read disk cache entries (cold)")); |
| EXPECT_TRUE( |
| TimeRead(WhatToRead::HEADERS_AND_BODY, "Read disk cache entries (warm)")); |
|
Randy Smith (Not in Mondays)
2016/05/26 18:26:25
What's the larger context in which this test is ru
gavinp
2016/05/26 19:03:29
Ah, we don't tear down the worker pool after tests
|
| - base::MessageLoop::current()->RunUntilIdle(); |
| } |
| TEST_F(DiskCachePerfTest, CacheBackendPerformance) { |