OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 BlobEntry* entry = registry()->GetEntry(uuid); | 111 BlobEntry* entry = registry()->GetEntry(uuid); |
112 EXPECT_TRUE(entry); | 112 EXPECT_TRUE(entry); |
113 return *entry->items()[index]; | 113 return *entry->items()[index]; |
114 } | 114 } |
115 | 115 |
116 void SetTestMemoryLimits() { | 116 void SetTestMemoryLimits() { |
117 BlobStorageLimits limits; | 117 BlobStorageLimits limits; |
118 limits.max_ipc_memory_size = kTestBlobStorageIPCThresholdBytes; | 118 limits.max_ipc_memory_size = kTestBlobStorageIPCThresholdBytes; |
119 limits.max_shared_memory_size = kTestBlobStorageMaxSharedMemoryBytes; | 119 limits.max_shared_memory_size = kTestBlobStorageMaxSharedMemoryBytes; |
120 limits.max_blob_in_memory_space = kTestBlobStorageMaxBlobMemorySize; | 120 limits.max_blob_in_memory_space = kTestBlobStorageMaxBlobMemorySize; |
121 limits.max_blob_disk_space = kTestBlobStorageMaxDiskSpace; | 121 limits.desired_max_disk_space = kTestBlobStorageMaxDiskSpace; |
| 122 limits.effective_max_disk_space = kTestBlobStorageMaxDiskSpace; |
122 limits.min_page_file_size = kTestBlobStorageMinFileSizeBytes; | 123 limits.min_page_file_size = kTestBlobStorageMinFileSizeBytes; |
123 limits.max_file_size = kTestBlobStorageMaxFileSizeBytes; | 124 limits.max_file_size = kTestBlobStorageMaxFileSizeBytes; |
124 context_->mutable_memory_controller()->set_limits_for_testing(limits); | 125 context_->mutable_memory_controller()->set_limits_for_testing(limits); |
125 } | 126 } |
126 | 127 |
127 base::FilePath fake_file_path_; | 128 base::FilePath fake_file_path_; |
128 base::ScopedTempDir temp_dir_; | 129 base::ScopedTempDir temp_dir_; |
129 scoped_refptr<TestSimpleTaskRunner> file_runner_ = new TestSimpleTaskRunner(); | 130 scoped_refptr<TestSimpleTaskRunner> file_runner_ = new TestSimpleTaskRunner(); |
130 | 131 |
131 base::MessageLoop fake_io_message_loop; | 132 base::MessageLoop fake_io_message_loop; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 274 |
274 // Clean up temp files. | 275 // Clean up temp files. |
275 EXPECT_TRUE(file_runner_->HasPendingTask()); | 276 EXPECT_TRUE(file_runner_->HasPendingTask()); |
276 file_runner_->RunPendingTasks(); | 277 file_runner_->RunPendingTasks(); |
277 base::RunLoop().RunUntilIdle(); | 278 base::RunLoop().RunUntilIdle(); |
278 EXPECT_EQ(BlobStatus::PENDING_TRANSPORT, file_status); | 279 EXPECT_EQ(BlobStatus::PENDING_TRANSPORT, file_status); |
279 EXPECT_FALSE(file_handles.empty()); | 280 EXPECT_FALSE(file_handles.empty()); |
280 } | 281 } |
281 | 282 |
282 } // namespace storage | 283 } // namespace storage |
OLD | NEW |