| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 void SetUp() override { | 77 void SetUp() override { |
| 78 status_code_ = BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS; | 78 status_code_ = BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS; |
| 79 request_called_ = false; | 79 request_called_ = false; |
| 80 requests_.clear(); | 80 requests_.clear(); |
| 81 memory_handles_.clear(); | 81 memory_handles_.clear(); |
| 82 storage::BlobStorageLimits limits; | 82 storage::BlobStorageLimits limits; |
| 83 limits.max_ipc_memory_size = kTestBlobStorageIPCThresholdBytes; | 83 limits.max_ipc_memory_size = kTestBlobStorageIPCThresholdBytes; |
| 84 limits.max_shared_memory_size = kTestBlobStorageMaxSharedMemoryBytes; | 84 limits.max_shared_memory_size = kTestBlobStorageMaxSharedMemoryBytes; |
| 85 limits.max_blob_in_memory_space = kTestBlobStorageMaxBlobMemorySize; | 85 limits.max_blob_in_memory_space = kTestBlobStorageMaxBlobMemorySize; |
| 86 limits.max_blob_disk_space = kTestBlobStorageMaxDiskSpace; | 86 limits.desired_max_disk_space = kTestBlobStorageMaxDiskSpace; |
| 87 limits.effective_max_disk_space = kTestBlobStorageMaxDiskSpace; |
| 87 limits.min_page_file_size = kTestBlobStorageMinFileSizeBytes; | 88 limits.min_page_file_size = kTestBlobStorageMinFileSizeBytes; |
| 88 limits.max_file_size = kTestBlobStorageMaxFileSizeBytes; | 89 limits.max_file_size = kTestBlobStorageMaxFileSizeBytes; |
| 89 context_.mutable_memory_controller()->set_limits_for_testing(limits); | 90 context_.mutable_memory_controller()->set_limits_for_testing(limits); |
| 90 BlobDataBuilder builder(kCompletedBlobUUID); | 91 BlobDataBuilder builder(kCompletedBlobUUID); |
| 91 builder.AppendData(kCompletedBlobData); | 92 builder.AppendData(kCompletedBlobData); |
| 92 completed_blob_handle_ = context_.AddFinishedBlob(builder); | 93 completed_blob_handle_ = context_.AddFinishedBlob(builder); |
| 93 EXPECT_EQ(BlobStatus::DONE, completed_blob_handle_->GetBlobStatus()); | 94 EXPECT_EQ(BlobStatus::DONE, completed_blob_handle_->GetBlobStatus()); |
| 94 } | 95 } |
| 95 | 96 |
| 96 void StatusCallback(BlobStatus status) { | 97 void StatusCallback(BlobStatus status) { |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 | 504 |
| 504 // Run the message loop so we propogate the construction complete callbacks. | 505 // Run the message loop so we propogate the construction complete callbacks. |
| 505 base::RunLoop().RunUntilIdle(); | 506 base::RunLoop().RunUntilIdle(); |
| 506 // Finally, we should be finished with third blob. | 507 // Finally, we should be finished with third blob. |
| 507 EXPECT_FALSE(host_.IsBeingBuilt(kBlob3)); | 508 EXPECT_FALSE(host_.IsBeingBuilt(kBlob3)); |
| 508 EXPECT_FALSE(IsBeingBuiltInContext(kBlob3)); | 509 EXPECT_FALSE(IsBeingBuiltInContext(kBlob3)); |
| 509 EXPECT_TRUE(context_.GetBlobDataFromUUID(kBlob3)); | 510 EXPECT_TRUE(context_.GetBlobDataFromUUID(kBlob3)); |
| 510 }; | 511 }; |
| 511 | 512 |
| 512 } // namespace storage | 513 } // namespace storage |
| OLD | NEW |