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

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

Issue 2339933004: [BlobStorage] BlobMemoryController & tests (Closed)
Patch Set: Fixed windows bug! Created 4 years, 2 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_data_builder_unittest.cc
diff --git a/content/browser/blob_storage/blob_data_builder_unittest.cc b/content/browser/blob_storage/blob_data_builder_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f1fc6a9a6a6b1be00c2a5445f9219ae53b5d0e57
--- /dev/null
+++ b/content/browser/blob_storage/blob_data_builder_unittest.cc
@@ -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

Powered by Google App Engine
This is Rietveld 408576698