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