| OLD | NEW |
| 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 <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 MessageLoop message_loop_; |
| 225 scoped_ptr<MockQuotaEvictionHandler> quota_eviction_handler_; | 226 scoped_ptr<MockQuotaEvictionHandler> quota_eviction_handler_; |
| 226 scoped_ptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor_; | 227 scoped_ptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor_; |
| 227 | 228 |
| 228 int num_get_usage_and_quota_for_eviction_; | 229 int num_get_usage_and_quota_for_eviction_; |
| 229 | 230 |
| 230 base::WeakPtrFactory<QuotaTemporaryStorageEvictorTest> weak_factory_; | 231 base::WeakPtrFactory<QuotaTemporaryStorageEvictorTest> weak_factory_; |
| 231 | 232 |
| 232 DISALLOW_COPY_AND_ASSIGN(QuotaTemporaryStorageEvictorTest); | 233 DISALLOW_COPY_AND_ASSIGN(QuotaTemporaryStorageEvictorTest); |
| 233 }; | 234 }; |
| 234 | 235 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 quota_eviction_handler()->set_available_space(1000000000); | 425 quota_eviction_handler()->set_available_space(1000000000); |
| 425 EXPECT_EQ(3000 + 200 + 500000, quota_eviction_handler()->GetUsage()); | 426 EXPECT_EQ(3000 + 200 + 500000, quota_eviction_handler()->GetUsage()); |
| 426 set_repeated_eviction(false); | 427 set_repeated_eviction(false); |
| 427 temporary_storage_evictor()->Start(); | 428 temporary_storage_evictor()->Start(); |
| 428 MessageLoop::current()->RunAllPending(); | 429 MessageLoop::current()->RunAllPending(); |
| 429 // Nothing should have been evicted. | 430 // Nothing should have been evicted. |
| 430 EXPECT_EQ(3000 + 200 + 500000, quota_eviction_handler()->GetUsage()); | 431 EXPECT_EQ(3000 + 200 + 500000, quota_eviction_handler()->GetUsage()); |
| 431 } | 432 } |
| 432 | 433 |
| 433 } // namespace quota | 434 } // namespace quota |
| OLD | NEW |