OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "storage/browser/blob/blob_async_builder_host.h" |
| 6 |
| 7 #include <stdint.h> |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/logging.h" |
| 12 #include "storage/browser/blob/blob_data_builder.h" |
| 13 #include "storage/common/data_element.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 |
| 16 namespace storage { |
| 17 |
| 18 TEST(BlobDataBuilderTest, TestFutureFiles) { |
| 19 const std::string kId = "id"; |
| 20 |
| 21 DataElement element; |
| 22 element.SetToFilePath(BlobDataBuilder::GetFutureFileItemPath(0)); |
| 23 EXPECT_TRUE(BlobDataBuilder::IsFutureFileItem(element)); |
| 24 EXPECT_EQ(0ull, BlobDataBuilder::GetFutureFileID(element)); |
| 25 |
| 26 BlobDataBuilder builder(kId); |
| 27 builder.AppendFutureFile(0, 10, 0); |
| 28 EXPECT_TRUE( |
| 29 BlobDataBuilder::IsFutureFileItem(builder.items_[0]->data_element())); |
| 30 EXPECT_EQ(0ull, BlobDataBuilder::GetFutureFileID( |
| 31 builder.items_[0]->data_element())); |
| 32 } |
| 33 |
| 34 } // namespace storage |
OLD | NEW |