| 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> |
| 8 |
| 7 #include <string> | 9 #include <string> |
| 8 | 10 |
| 9 #include "base/memory/ref_counted_memory.h" | 11 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 11 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
| 12 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 13 #include "sync/api/attachments/attachment_id.h" | 15 #include "sync/api/attachments/attachment_id.h" |
| 14 #include "sync/internal_api/public/attachments/attachment_service.h" | 16 #include "sync/internal_api/public/attachments/attachment_service.h" |
| 15 #include "sync/internal_api/public/attachments/attachment_service_impl.h" | 17 #include "sync/internal_api/public/attachments/attachment_service_impl.h" |
| 16 #include "sync/internal_api/public/attachments/attachment_service_proxy.h" | 18 #include "sync/internal_api/public/attachments/attachment_service_proxy.h" |
| 17 #include "sync/protocol/sync.pb.h" | 19 #include "sync/protocol/sync.pb.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 21 |
| 20 using std::string; | 22 using std::string; |
| 21 | 23 |
| 22 namespace syncer { | 24 namespace syncer { |
| 23 | 25 |
| 24 namespace { | 26 namespace { |
| 25 | 27 |
| 26 const char kSyncTag[] = "3984729834"; | 28 const char kSyncTag[] = "3984729834"; |
| 27 const ModelType kDatatype = syncer::PREFERENCES; | 29 const ModelType kDatatype = syncer::PREFERENCES; |
| 28 const char kNonUniqueTitle[] = "my preference"; | 30 const char kNonUniqueTitle[] = "my preference"; |
| 29 const int64 kId = 439829; | 31 const int64_t kId = 439829; |
| 30 const base::Time kLastModifiedTime = base::Time(); | 32 const base::Time kLastModifiedTime = base::Time(); |
| 31 | 33 |
| 32 class SyncDataTest : public testing::Test { | 34 class SyncDataTest : public testing::Test { |
| 33 protected: | 35 protected: |
| 34 SyncDataTest() | 36 SyncDataTest() |
| 35 : attachment_service(AttachmentServiceImpl::CreateForTest()), | 37 : attachment_service(AttachmentServiceImpl::CreateForTest()), |
| 36 attachment_service_weak_ptr_factory(attachment_service.get()), | 38 attachment_service_weak_ptr_factory(attachment_service.get()), |
| 37 attachment_service_proxy( | 39 attachment_service_proxy( |
| 38 base::ThreadTaskRunnerHandle::Get(), | 40 base::ThreadTaskRunnerHandle::Get(), |
| 39 attachment_service_weak_ptr_factory.GetWeakPtr()) {} | 41 attachment_service_weak_ptr_factory.GetWeakPtr()) {} |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 EXPECT_TRUE(data.GetSpecifics().has_preference()); | 118 EXPECT_TRUE(data.GetSpecifics().has_preference()); |
| 117 EXPECT_TRUE(data.GetAttachmentIds().empty()); | 119 EXPECT_TRUE(data.GetAttachmentIds().empty()); |
| 118 } | 120 } |
| 119 | 121 |
| 120 // TODO(maniscalco): Add test cases that verify GetLocalAttachmentsForUpload | 122 // TODO(maniscalco): Add test cases that verify GetLocalAttachmentsForUpload |
| 121 // calls are passed through to the underlying AttachmentService. | 123 // calls are passed through to the underlying AttachmentService. |
| 122 | 124 |
| 123 } // namespace | 125 } // namespace |
| 124 | 126 |
| 125 } // namespace syncer | 127 } // namespace syncer |
| OLD | NEW |