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

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

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 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 | « net/disk_cache/disk_cache_test_base.cc ('k') | net/disk_cache/in_flight_io.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_util.h" 5 #include "net/disk_cache/disk_cache_test_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 path = path.AppendASCII(name); 87 path = path.AppendASCII(name);
88 88
89 FilePath dest = GetCacheFilePath(); 89 FilePath dest = GetCacheFilePath();
90 if (!DeleteCache(dest)) 90 if (!DeleteCache(dest))
91 return false; 91 return false;
92 return file_util::CopyDirectory(path, dest, false); 92 return file_util::CopyDirectory(path, dest, false);
93 } 93 }
94 94
95 bool CheckCacheIntegrity(const FilePath& path, bool new_eviction) { 95 bool CheckCacheIntegrity(const FilePath& path, bool new_eviction) {
96 scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl( 96 scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl(
97 path, base::MessageLoopProxy::CreateForCurrentThread(), NULL)); 97 path, base::MessageLoopProxy::current(), NULL));
98 if (!cache.get()) 98 if (!cache.get())
99 return false; 99 return false;
100 if (new_eviction) 100 if (new_eviction)
101 cache->SetNewEviction(); 101 cache->SetNewEviction();
102 cache->SetFlags(disk_cache::kNoRandom); 102 cache->SetFlags(disk_cache::kNoRandom);
103 if (cache->SyncInit() != net::OK) 103 if (cache->SyncInit() != net::OK)
104 return false; 104 return false;
105 return cache->SelfCheck() >= 0; 105 return cache->SelfCheck() >= 0;
106 } 106 }
107 107
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 void CallbackTest::RunWithParams(const Tuple1<int>& params) { 181 void CallbackTest::RunWithParams(const Tuple1<int>& params) {
182 if (reuse_) { 182 if (reuse_) {
183 DCHECK_EQ(1, reuse_); 183 DCHECK_EQ(1, reuse_);
184 if (2 == reuse_) 184 if (2 == reuse_)
185 helper_->set_callback_reused_error(true); 185 helper_->set_callback_reused_error(true);
186 reuse_++; 186 reuse_++;
187 } 187 }
188 188
189 helper_->CallbackWasCalled(); 189 helper_->CallbackWasCalled();
190 } 190 }
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_base.cc ('k') | net/disk_cache/in_flight_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698