OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sync/api/attachments/attachment.h" | 5 #include "components/sync/api/attachments/attachment.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
13 #include "sync/internal_api/public/attachments/attachment_util.h" | 13 #include "components/sync/core/attachments/attachment_util.h" |
14 #include "sync/protocol/sync.pb.h" | 14 #include "components/sync/protocol/sync.pb.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace syncer { | 17 namespace syncer { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 const char kAttachmentData[] = "some data"; | 21 const char kAttachmentData[] = "some data"; |
22 | 22 |
23 } // namespace | 23 } // namespace |
24 | 24 |
(...skipping 18 matching lines...) Expand all Loading... |
43 scoped_refptr<base::RefCountedString> some_data(new base::RefCountedString); | 43 scoped_refptr<base::RefCountedString> some_data(new base::RefCountedString); |
44 some_data->data() = kAttachmentData; | 44 some_data->data() = kAttachmentData; |
45 uint32_t crc32c = ComputeCrc32c(some_data); | 45 uint32_t crc32c = ComputeCrc32c(some_data); |
46 AttachmentId id = AttachmentId::Create(some_data->size(), crc32c); | 46 AttachmentId id = AttachmentId::Create(some_data->size(), crc32c); |
47 Attachment a = Attachment::CreateFromParts(id, some_data); | 47 Attachment a = Attachment::CreateFromParts(id, some_data); |
48 EXPECT_EQ(id, a.GetId()); | 48 EXPECT_EQ(id, a.GetId()); |
49 EXPECT_EQ(some_data, a.GetData()); | 49 EXPECT_EQ(some_data, a.GetData()); |
50 } | 50 } |
51 | 51 |
52 } // namespace syncer | 52 } // namespace syncer |
OLD | NEW |