OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_ |
| 6 #define SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_ |
| 7 |
| 8 #include "sync/api/attachments/attachment_service.h" |
| 9 #include "sync/api/attachments/attachment_store.h" |
| 10 |
| 11 namespace syncer { |
| 12 |
| 13 // A fake implementation of AttachmentService. |
| 14 class SYNC_EXPORT FakeAttachmentService : public AttachmentService { |
| 15 public: |
| 16 explicit FakeAttachmentService(scoped_ptr<AttachmentStore> attachment_store); |
| 17 virtual ~FakeAttachmentService(); |
| 18 |
| 19 // Create a FakeAttachmentService suitable for use in tests. |
| 20 static scoped_ptr<syncer::AttachmentService> CreateForTest(); |
| 21 |
| 22 // AttachmentService implementation. |
| 23 virtual void GetAttachments(const AttachmentIdList& attachment_ids, |
| 24 const GetCallback& callback) OVERRIDE; |
| 25 virtual void DropAttachments(const AttachmentIdList& attachment_ids, |
| 26 const DropCallback& callback) OVERRIDE; |
| 27 virtual void OnSyncDataAdd(const SyncData& sync_data) OVERRIDE; |
| 28 virtual void OnSyncDataDelete(const SyncData& sync_data) OVERRIDE; |
| 29 virtual void OnSyncDataUpdate(const AttachmentIdList& old_attachment_ids, |
| 30 const SyncData& updated_sync_data) OVERRIDE; |
| 31 |
| 32 private: |
| 33 const scoped_ptr<AttachmentStore> attachment_store_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(FakeAttachmentService); |
| 36 }; |
| 37 |
| 38 } // namespace syncer |
| 39 |
| 40 #endif // SYNC_API_ATTACHMENTS_FAKE_ATTACHMENT_SERVICE_H_ |
OLD | NEW |