OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "storage/browser/blob/blob_storage_context.h" | 5 #include "storage/browser/blob/blob_storage_context.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <memory> | 10 #include <memory> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 builder.AppendData("1", 1); | 135 builder.AppendData("1", 1); |
136 builder.set_content_type("text/plain"); | 136 builder.set_content_type("text/plain"); |
137 return context_->AddFinishedBlob(builder); | 137 return context_->AddFinishedBlob(builder); |
138 } | 138 } |
139 | 139 |
140 void SetTestMemoryLimits() { | 140 void SetTestMemoryLimits() { |
141 BlobStorageLimits limits; | 141 BlobStorageLimits limits; |
142 limits.max_ipc_memory_size = kTestBlobStorageIPCThresholdBytes; | 142 limits.max_ipc_memory_size = kTestBlobStorageIPCThresholdBytes; |
143 limits.max_shared_memory_size = kTestBlobStorageMaxSharedMemoryBytes; | 143 limits.max_shared_memory_size = kTestBlobStorageMaxSharedMemoryBytes; |
144 limits.max_blob_in_memory_space = kTestBlobStorageMaxBlobMemorySize; | 144 limits.max_blob_in_memory_space = kTestBlobStorageMaxBlobMemorySize; |
145 limits.max_blob_disk_space = kTestBlobStorageMaxDiskSpace; | 145 limits.desired_max_disk_space = kTestBlobStorageMaxDiskSpace; |
| 146 limits.effective_max_disk_space = kTestBlobStorageMaxDiskSpace; |
146 limits.min_page_file_size = kTestBlobStorageMinFileSizeBytes; | 147 limits.min_page_file_size = kTestBlobStorageMinFileSizeBytes; |
147 limits.max_file_size = kTestBlobStorageMaxFileSizeBytes; | 148 limits.max_file_size = kTestBlobStorageMaxFileSizeBytes; |
148 context_->mutable_memory_controller()->set_limits_for_testing(limits); | 149 context_->mutable_memory_controller()->set_limits_for_testing(limits); |
149 } | 150 } |
150 | 151 |
151 void IncrementRefCount(const std::string& uuid) { | 152 void IncrementRefCount(const std::string& uuid) { |
152 context_->IncrementBlobRefCount(uuid); | 153 context_->IncrementBlobRefCount(uuid); |
153 } | 154 } |
154 | 155 |
155 void DecrementRefCount(const std::string& uuid) { | 156 void DecrementRefCount(const std::string& uuid) { |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 EXPECT_TRUE(file_runner_->HasPendingTask()); | 889 EXPECT_TRUE(file_runner_->HasPendingTask()); |
889 file_runner_->RunPendingTasks(); | 890 file_runner_->RunPendingTasks(); |
890 base::RunLoop().RunUntilIdle(); | 891 base::RunLoop().RunUntilIdle(); |
891 EXPECT_EQ(0lu, context_->memory_controller().memory_usage()); | 892 EXPECT_EQ(0lu, context_->memory_controller().memory_usage()); |
892 EXPECT_EQ(0lu, context_->memory_controller().disk_usage()); | 893 EXPECT_EQ(0lu, context_->memory_controller().disk_usage()); |
893 } | 894 } |
894 | 895 |
895 // TODO(michaeln): tests for the deprecated url stuff | 896 // TODO(michaeln): tests for the deprecated url stuff |
896 | 897 |
897 } // namespace storage | 898 } // namespace storage |
OLD | NEW |