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

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: added comments to WebContentsImplTest Created 3 years, 11 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « content/browser/blob_storage/blob_storage_browsertest.cc ('k') | content/browser/blob_storage/blob_transport_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698