| 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 <list> | 5 #include <list> |
| 6 #include <map> | 6 #include <map> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 void set_min_available_disk_space_to_start_eviction(int64 value) const { | 215 void set_min_available_disk_space_to_start_eviction(int64 value) const { |
| 216 temporary_storage_evictor_->set_min_available_disk_space_to_start_eviction( | 216 temporary_storage_evictor_->set_min_available_disk_space_to_start_eviction( |
| 217 value); | 217 value); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void reset_min_available_disk_space_to_start_eviction() const { | 220 void reset_min_available_disk_space_to_start_eviction() const { |
| 221 temporary_storage_evictor_-> | 221 temporary_storage_evictor_-> |
| 222 reset_min_available_disk_space_to_start_eviction(); | 222 reset_min_available_disk_space_to_start_eviction(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 scoped_ptr<QuotaEvictionHandler> quota_eviction_handler_; | 225 scoped_ptr<MockQuotaEvictionHandler> quota_eviction_handler_; |
| 226 scoped_ptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor_; | 226 scoped_ptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor_; |
| 227 | 227 |
| 228 int num_get_usage_and_quota_for_eviction_; | 228 int num_get_usage_and_quota_for_eviction_; |
| 229 | 229 |
| 230 base::WeakPtrFactory<QuotaTemporaryStorageEvictorTest> weak_factory_; | 230 base::WeakPtrFactory<QuotaTemporaryStorageEvictorTest> weak_factory_; |
| 231 | 231 |
| 232 DISALLOW_COPY_AND_ASSIGN(QuotaTemporaryStorageEvictorTest); | 232 DISALLOW_COPY_AND_ASSIGN(QuotaTemporaryStorageEvictorTest); |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 TEST_F(QuotaTemporaryStorageEvictorTest, SimpleEvictionTest) { | 235 TEST_F(QuotaTemporaryStorageEvictorTest, SimpleEvictionTest) { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 quota_eviction_handler()->set_available_space(1000000000); | 424 quota_eviction_handler()->set_available_space(1000000000); |
| 425 EXPECT_EQ(3000 + 200 + 500000, quota_eviction_handler()->GetUsage()); | 425 EXPECT_EQ(3000 + 200 + 500000, quota_eviction_handler()->GetUsage()); |
| 426 set_repeated_eviction(false); | 426 set_repeated_eviction(false); |
| 427 temporary_storage_evictor()->Start(); | 427 temporary_storage_evictor()->Start(); |
| 428 MessageLoop::current()->RunAllPending(); | 428 MessageLoop::current()->RunAllPending(); |
| 429 // Nothing should have been evicted. | 429 // Nothing should have been evicted. |
| 430 EXPECT_EQ(3000 + 200 + 500000, quota_eviction_handler()->GetUsage()); | 430 EXPECT_EQ(3000 + 200 + 500000, quota_eviction_handler()->GetUsage()); |
| 431 } | 431 } |
| 432 | 432 |
| 433 } // namespace quota | 433 } // namespace quota |
| OLD | NEW |