Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Side by Side Diff: content/browser/blob_storage/blob_storage_context_unittest.cc

Issue 2552153002: [BlobStorage] Enabling disk paging and direct storage. (Closed)
Patch Set: fixed windows build Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698