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

Side by Side Diff: net/disk_cache/disk_cache_test_base.cc

Issue 14134005: Simple Cache: Re-enable entry counting in tests on start (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/disk_cache/disk_cache_test_base.h" 5 #include "net/disk_cache/disk_cache_test_base.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 DiskCacheTestWithCache::~DiskCacheTestWithCache() {} 68 DiskCacheTestWithCache::~DiskCacheTestWithCache() {}
69 69
70 void DiskCacheTestWithCache::InitCache() { 70 void DiskCacheTestWithCache::InitCache() {
71 if (memory_only_) 71 if (memory_only_)
72 InitMemoryCache(); 72 InitMemoryCache();
73 else 73 else
74 InitDiskCache(); 74 InitDiskCache();
75 75
76 ASSERT_TRUE(NULL != cache_); 76 ASSERT_TRUE(NULL != cache_);
77 // TODO(pasko): enable Entry Count for the Simple Cache. 77 if (first_cleanup_)
78 if (first_cleanup_ && !simple_cache_mode_)
79 ASSERT_EQ(0, cache_->GetEntryCount()); 78 ASSERT_EQ(0, cache_->GetEntryCount());
80 } 79 }
81 80
82 // We are expected to leak memory when simulating crashes. 81 // We are expected to leak memory when simulating crashes.
83 void DiskCacheTestWithCache::SimulateCrash() { 82 void DiskCacheTestWithCache::SimulateCrash() {
84 ASSERT_TRUE(!memory_only_); 83 ASSERT_TRUE(!memory_only_);
85 net::TestCompletionCallback cb; 84 net::TestCompletionCallback cb;
86 int rv = cache_impl_->FlushQueueForTest(cb.callback()); 85 int rv = cache_impl_->FlushQueueForTest(cb.callback());
87 ASSERT_EQ(net::OK, cb.GetResult(rv)); 86 ASSERT_EQ(net::OK, cb.GetResult(rv));
88 cache_impl_->ClearRefCountForTest(); 87 cache_impl_->ClearRefCountForTest();
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); 287 EXPECT_TRUE(cache_impl_->SetMaxSize(size_));
289 if (new_eviction_) 288 if (new_eviction_)
290 cache_impl_->SetNewEviction(); 289 cache_impl_->SetNewEviction();
291 cache_impl_->SetType(type_); 290 cache_impl_->SetType(type_);
292 cache_impl_->SetFlags(flags); 291 cache_impl_->SetFlags(flags);
293 net::TestCompletionCallback cb; 292 net::TestCompletionCallback cb;
294 int rv = cache_impl_->Init(cb.callback()); 293 int rv = cache_impl_->Init(cb.callback());
295 ASSERT_EQ(net::OK, cb.GetResult(rv)); 294 ASSERT_EQ(net::OK, cb.GetResult(rv));
296 cache_ = cache_impl_; 295 cache_ = cache_impl_;
297 } 296 }
OLDNEW
« 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