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

Unified Diff: net/disk_cache/disk_cache_test_base.cc

Issue 13517004: Test cache creation retry via public interface only. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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
Index: net/disk_cache/disk_cache_test_base.cc
diff --git a/net/disk_cache/disk_cache_test_base.cc b/net/disk_cache/disk_cache_test_base.cc
index 6e04a9316ba9de660b3aa71402778b58e90bf7f5..38f7d8a088032d2997dde7890ac40ec334678a07 100644
--- a/net/disk_cache/disk_cache_test_base.cc
+++ b/net/disk_cache/disk_cache_test_base.cc
@@ -259,11 +259,7 @@ void DiskCacheTestWithCache::InitDiskCache() {
CreateBackend(disk_cache::kNoRandom, &cache_thread_);
}
-// Testing backend creation retry logic is hard because the CacheCreator and
-// cache backend(s) are tightly coupled. So we take the default backend often.
-// Tests themselves need to be adjusted for platforms where the BackendImpl is
-// not the default backend.
-void DiskCacheTestWithCache::InitDefaultCacheViaCreator() {
+void DiskCacheTestWithCache::CreateCacheViaPublicInterface() {
if (!cache_thread_.IsRunning()) {
ASSERT_TRUE(cache_thread_.StartWithOptions(
base::Thread::Options(MessageLoop::TYPE_IO, 0)));
@@ -271,10 +267,9 @@ void DiskCacheTestWithCache::InitDefaultCacheViaCreator() {
ASSERT_TRUE(cache_thread_.message_loop() != NULL);
net::TestCompletionCallback cb;
- disk_cache::CacheCreator* creator = new disk_cache::CacheCreator(
- cache_path_, true, 0, net::DISK_CACHE, disk_cache::kNoRandom,
- cache_thread_.message_loop_proxy(), NULL, &cache_, cb.callback());
- int rv = creator->Run();
+ int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, cache_path_, 0, true,
+ cache_thread_.message_loop_proxy(),
+ NULL, &cache_, cb.callback());
ASSERT_EQ(net::OK, cb.GetResult(rv));
}
« net/disk_cache/backend_unittest.cc ('K') | « net/disk_cache/disk_cache_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698