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

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: be (more|less) superstitious as appropriate 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..100d89b3c43ff29f1483ed87d33f2936659bbc89 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,16 @@ void DiskCachePerfTest::CacheBackendPerformance() {
InitCache();
EXPECT_TRUE(TimeWrite());
+ 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)"));
+
+ disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting();
base::MessageLoop::current()->RunUntilIdle();
ResetAndEvictSystemDiskCache();
@@ -247,6 +253,8 @@ 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)"));
+
+ disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting();
base::MessageLoop::current()->RunUntilIdle();
}
« 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