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

Unified Diff: net/disk_cache/disk_cache_perftest.cc

Issue 2018583002: Simple Cache: sync disk cache perftests carefully. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add sync back Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698