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/sync_data.h" | 5 #include "sync/api/sync_data.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
Nicolas Zea
2016/04/07 21:48:57
include memory?
| |
10 | 10 |
11 #include "base/memory/ref_counted_memory.h" | 11 #include "base/memory/ref_counted_memory.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "sync/api/attachments/attachment_id.h" | 15 #include "sync/api/attachments/attachment_id.h" |
16 #include "sync/internal_api/public/attachments/attachment_service.h" | 16 #include "sync/internal_api/public/attachments/attachment_service.h" |
17 #include "sync/internal_api/public/attachments/attachment_service_impl.h" | 17 #include "sync/internal_api/public/attachments/attachment_service_impl.h" |
18 #include "sync/internal_api/public/attachments/attachment_service_proxy.h" | 18 #include "sync/internal_api/public/attachments/attachment_service_proxy.h" |
19 #include "sync/protocol/sync.pb.h" | 19 #include "sync/protocol/sync.pb.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
34 class SyncDataTest : public testing::Test { | 34 class SyncDataTest : public testing::Test { |
35 protected: | 35 protected: |
36 SyncDataTest() | 36 SyncDataTest() |
37 : attachment_service(AttachmentServiceImpl::CreateForTest()), | 37 : attachment_service(AttachmentServiceImpl::CreateForTest()), |
38 attachment_service_weak_ptr_factory(attachment_service.get()), | 38 attachment_service_weak_ptr_factory(attachment_service.get()), |
39 attachment_service_proxy( | 39 attachment_service_proxy( |
40 base::ThreadTaskRunnerHandle::Get(), | 40 base::ThreadTaskRunnerHandle::Get(), |
41 attachment_service_weak_ptr_factory.GetWeakPtr()) {} | 41 attachment_service_weak_ptr_factory.GetWeakPtr()) {} |
42 base::MessageLoop loop; | 42 base::MessageLoop loop; |
43 sync_pb::EntitySpecifics specifics; | 43 sync_pb::EntitySpecifics specifics; |
44 scoped_ptr<AttachmentService> attachment_service; | 44 std::unique_ptr<AttachmentService> attachment_service; |
45 base::WeakPtrFactory<AttachmentService> attachment_service_weak_ptr_factory; | 45 base::WeakPtrFactory<AttachmentService> attachment_service_weak_ptr_factory; |
46 AttachmentServiceProxy attachment_service_proxy; | 46 AttachmentServiceProxy attachment_service_proxy; |
47 }; | 47 }; |
48 | 48 |
49 TEST_F(SyncDataTest, NoArgCtor) { | 49 TEST_F(SyncDataTest, NoArgCtor) { |
50 SyncData data; | 50 SyncData data; |
51 EXPECT_FALSE(data.IsValid()); | 51 EXPECT_FALSE(data.IsValid()); |
52 } | 52 } |
53 | 53 |
54 TEST_F(SyncDataTest, CreateLocalDelete) { | 54 TEST_F(SyncDataTest, CreateLocalDelete) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 EXPECT_TRUE(data.GetSpecifics().has_preference()); | 118 EXPECT_TRUE(data.GetSpecifics().has_preference()); |
119 EXPECT_TRUE(data.GetAttachmentIds().empty()); | 119 EXPECT_TRUE(data.GetAttachmentIds().empty()); |
120 } | 120 } |
121 | 121 |
122 // TODO(maniscalco): Add test cases that verify GetLocalAttachmentsForUpload | 122 // TODO(maniscalco): Add test cases that verify GetLocalAttachmentsForUpload |
123 // calls are passed through to the underlying AttachmentService. | 123 // calls are passed through to the underlying AttachmentService. |
124 | 124 |
125 } // namespace | 125 } // namespace |
126 | 126 |
127 } // namespace syncer | 127 } // namespace syncer |
OLD | NEW |