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

Unified Diff: content/browser/blob_storage/blob_reader_unittest.cc

Issue 2055053003: [BlobAsync] Disk support for blob storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added back transport controller test, small cleanups Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/blob_storage/blob_reader_unittest.cc
diff --git a/content/browser/blob_storage/blob_reader_unittest.cc b/content/browser/blob_storage/blob_reader_unittest.cc
index 07de8e208aef627c923606a27ff1ce3dc72377a0..37c0feb627118048bfe5fe4381356ba350b5359a 100644
--- a/content/browser/blob_storage/blob_reader_unittest.cc
+++ b/content/browser/blob_storage/blob_reader_unittest.cc
@@ -1174,9 +1174,12 @@ TEST_F(BlobReaderTest, RangeError) {
TEST_F(BlobReaderTest, HandleBeforeAsyncCancel) {
const std::string kUuid("uuid1");
+ const std::string kData("Hello!!!");
+ const size_t kDataSize = 8ul;
- context_.CreatePendingBlob(kUuid, "", "");
- blob_handle_ = context_.GetBlobDataFromUUID(kUuid);
+ BlobDataBuilder b(kUuid);
+ b.AppendFutureData(kDataSize);
+ blob_handle_ = context_.BuildBlob(b, true);
provider_ = new MockFileStreamReaderProvider();
reader_.reset(new BlobReader(blob_handle_.get(), base::WrapUnique(provider_),
message_loop_.task_runner().get()));
@@ -1184,7 +1187,7 @@ TEST_F(BlobReaderTest, HandleBeforeAsyncCancel) {
EXPECT_EQ(BlobReader::Status::IO_PENDING,
reader_->CalculateSize(base::Bind(&SetValue<int>, &size_result)));
EXPECT_FALSE(reader_->IsInMemory());
- context_.CancelPendingBlob(kUuid, IPCBlobCreationCancelCode::UNKNOWN);
+ context_.BreakAndFinishBlob(kUuid, IPCBlobCreationCancelCode::UNKNOWN);
message_loop_.RunUntilIdle();
EXPECT_EQ(net::ERR_FAILED, size_result);
}
@@ -1195,9 +1198,8 @@ TEST_F(BlobReaderTest, ReadFromIncompleteBlob) {
const size_t kDataSize = 8ul;
BlobDataBuilder b(kUuid);
- b.AppendData(kData);
- context_.CreatePendingBlob(kUuid, "", "");
- blob_handle_ = context_.GetBlobDataFromUUID(kUuid);
+ b.AppendFutureData(kDataSize);
+ blob_handle_ = context_.BuildBlob(b, true);
provider_ = new MockFileStreamReaderProvider();
reader_.reset(new BlobReader(blob_handle_.get(), base::WrapUnique(provider_),
message_loop_.task_runner().get()));
@@ -1205,7 +1207,8 @@ TEST_F(BlobReaderTest, ReadFromIncompleteBlob) {
EXPECT_EQ(BlobReader::Status::IO_PENDING,
reader_->CalculateSize(base::Bind(&SetValue<int>, &size_result)));
EXPECT_FALSE(reader_->IsInMemory());
- context_.CompletePendingBlob(b);
+ b.PopulateFutureData(0, kData.data(), 0, kDataSize);
+ context_.FinishedPopulatingBlob(kUuid);
message_loop_.RunUntilIdle();
CheckSizeCalculatedAsynchronously(kDataSize, size_result);
scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(kDataSize));

Powered by Google App Engine
This is Rietveld 408576698