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_data_builder.h" | |
6 | |
7 #include <string> | |
8 | |
9 #include "base/logging.h" | |
10 #include "storage/common/data_element.h" | |
11 #include "testing/gtest/include/gtest/gtest.h" | |
12 | |
13 namespace storage { | |
14 | |
15 TEST(BlobDataBuilderTest, TestFutureFiles) { | |
16 const std::string kId = "id"; | |
17 | |
18 DataElement element; | |
19 element.SetToFilePath(BlobDataBuilder::GetFutureFileItemPath(0)); | |
20 EXPECT_TRUE(BlobDataBuilder::IsFutureFileItem(element)); | |
21 EXPECT_EQ(0ull, BlobDataBuilder::GetFutureFileID(element)); | |
22 | |
23 BlobDataBuilder builder(kId); | |
24 builder.AppendFutureFile(0, 10, 0); | |
25 EXPECT_TRUE( | |
26 BlobDataBuilder::IsFutureFileItem(builder.items_[0]->data_element())); | |
27 EXPECT_EQ(0ull, BlobDataBuilder::GetFutureFileID( | |
28 builder.items_[0]->data_element())); | |
29 } | |
30 | |
31 } // namespace storage | |
OLD | NEW |