| OLD | NEW |
| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool CheckCacheIntegrity(const FilePath& path, bool new_eviction, uint32 mask) { | 63 bool CheckCacheIntegrity(const FilePath& path, bool new_eviction, uint32 mask) { |
| 64 scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl( | 64 scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl( |
| 65 path, mask, base::MessageLoopProxy::current(), NULL)); | 65 path, mask, base::MessageLoopProxy::current(), NULL)); |
| 66 if (!cache.get()) | 66 if (!cache.get()) |
| 67 return false; | 67 return false; |
| 68 if (new_eviction) | 68 if (new_eviction) |
| 69 cache->SetNewEviction(); | 69 cache->SetNewEviction(); |
| 70 cache->SetFlags(disk_cache::kNoRandom); | 70 cache->SetFlags(disk_cache::kNoRandom); |
| 71 if (cache->SyncInit() != net::OK) | 71 if (cache->SyncInit(NULL) != net::OK) |
| 72 return false; | 72 return false; |
| 73 return cache->SelfCheck() >= 0; | 73 return cache->SelfCheck() >= 0; |
| 74 } | 74 } |
| 75 | 75 |
| 76 // ----------------------------------------------------------------------- | 76 // ----------------------------------------------------------------------- |
| 77 | 77 |
| 78 MessageLoopHelper::MessageLoopHelper() | 78 MessageLoopHelper::MessageLoopHelper() |
| 79 : num_callbacks_(0), | 79 : num_callbacks_(0), |
| 80 num_iterations_(0), | 80 num_iterations_(0), |
| 81 last_(0), | 81 last_(0), |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 void CallbackTest::Run(int params) { | 134 void CallbackTest::Run(int params) { |
| 135 if (reuse_) { | 135 if (reuse_) { |
| 136 DCHECK_EQ(1, reuse_); | 136 DCHECK_EQ(1, reuse_); |
| 137 if (2 == reuse_) | 137 if (2 == reuse_) |
| 138 helper_->set_callback_reused_error(true); | 138 helper_->set_callback_reused_error(true); |
| 139 reuse_++; | 139 reuse_++; |
| 140 } | 140 } |
| 141 | 141 |
| 142 helper_->CallbackWasCalled(); | 142 helper_->CallbackWasCalled(); |
| 143 } | 143 } |
| OLD | NEW |