forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BlobStorage] BlobMemoryController & tests
This is a split off of https://codereview.chromium.org/2055053003/. This adds the BlobMemoryController & tests, as well as any other small required changes. I avoided doing too much refactoring (like the move to BlobStatus everywhere, and removing BlobStorageRegistry::Entry for InternalBlobData) to just focus on the BlobMemoryController API. BUG=375297 R=michaeln@chromium.org,kinuko@chromium.org,mek@chromium.org Review-Url: https://chromiumcodereview.appspot.com/2339933004 Cr-Commit-Position: refs/heads/master@{#426901}
- Loading branch information
Showing
19 changed files
with
2,025 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
content/browser/blob_storage/blob_data_builder_unittest.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2016 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "storage/browser/blob/blob_data_builder.h" | ||
|
||
#include <string> | ||
|
||
#include "base/logging.h" | ||
#include "storage/common/data_element.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
namespace storage { | ||
|
||
TEST(BlobDataBuilderTest, TestFutureFiles) { | ||
const std::string kId = "id"; | ||
|
||
DataElement element; | ||
element.SetToFilePath(BlobDataBuilder::GetFutureFileItemPath(0)); | ||
EXPECT_TRUE(BlobDataBuilder::IsFutureFileItem(element)); | ||
EXPECT_EQ(0ull, BlobDataBuilder::GetFutureFileID(element)); | ||
|
||
BlobDataBuilder builder(kId); | ||
builder.AppendFutureFile(0, 10, 0); | ||
EXPECT_TRUE( | ||
BlobDataBuilder::IsFutureFileItem(builder.items_[0]->data_element())); | ||
EXPECT_EQ(0ull, BlobDataBuilder::GetFutureFileID( | ||
builder.items_[0]->data_element())); | ||
} | ||
|
||
} // namespace storage |
Oops, something went wrong.