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

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

Issue 13731002: Cache Backend Proxy to intercept all cache events from the IO thread. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: trivial net.gyp merge 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
« no previous file with comments | « net/disk_cache/cache_creator.cc ('k') | net/disk_cache/simple/simple_disk_format.h » ('j') | 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 if (first_cleanup_) 77 // TODO(pasko): enable Entry Count for the Simple Cache.
78 if (first_cleanup_ && !simple_cache_mode_)
78 ASSERT_EQ(0, cache_->GetEntryCount()); 79 ASSERT_EQ(0, cache_->GetEntryCount());
79 } 80 }
80 81
81 // We are expected to leak memory when simulating crashes. 82 // We are expected to leak memory when simulating crashes.
82 void DiskCacheTestWithCache::SimulateCrash() { 83 void DiskCacheTestWithCache::SimulateCrash() {
83 ASSERT_TRUE(!memory_only_); 84 ASSERT_TRUE(!memory_only_);
84 net::TestCompletionCallback cb; 85 net::TestCompletionCallback cb;
85 int rv = cache_impl_->FlushQueueForTest(cb.callback()); 86 int rv = cache_impl_->FlushQueueForTest(cb.callback());
86 ASSERT_EQ(net::OK, cb.GetResult(rv)); 87 ASSERT_EQ(net::OK, cb.GetResult(rv));
87 cache_impl_->ClearRefCountForTest(); 88 cache_impl_->ClearRefCountForTest();
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 EXPECT_TRUE(cache_impl_->SetMaxSize(size_)); 288 EXPECT_TRUE(cache_impl_->SetMaxSize(size_));
288 if (new_eviction_) 289 if (new_eviction_)
289 cache_impl_->SetNewEviction(); 290 cache_impl_->SetNewEviction();
290 cache_impl_->SetType(type_); 291 cache_impl_->SetType(type_);
291 cache_impl_->SetFlags(flags); 292 cache_impl_->SetFlags(flags);
292 net::TestCompletionCallback cb; 293 net::TestCompletionCallback cb;
293 int rv = cache_impl_->Init(cb.callback()); 294 int rv = cache_impl_->Init(cb.callback());
294 ASSERT_EQ(net::OK, cb.GetResult(rv)); 295 ASSERT_EQ(net::OK, cb.GetResult(rv));
295 cache_ = cache_impl_; 296 cache_ = cache_impl_;
296 } 297 }
OLDNEW
« no previous file with comments | « net/disk_cache/cache_creator.cc ('k') | net/disk_cache/simple/simple_disk_format.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698