Chromium Code Reviews| 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_ATTACHMENT_SERVICE_PROXY_FOR_TEST_H_ | |
| 6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_FOR_TEST_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "base/memory/weak_ptr.h" | |
| 10 #include "sync/api/attachments/attachment_service_proxy.h" | |
| 11 #include "sync/base/sync_export.h" | |
| 12 | |
| 13 namespace syncer { | |
| 14 | |
| 15 // An self-contained AttachmentServiceProxy to reduce boilerplate code in tests. | |
| 16 // | |
| 17 // Constructs and owns an AttachmentService suitable for use in tests. Assumes | |
| 18 // the current thread has a MessageLoop. | |
| 19 class SYNC_EXPORT AttachmentServiceProxyForTest | |
| 20 : public AttachmentServiceProxy { | |
| 21 public: | |
| 22 static scoped_refptr<AttachmentServiceProxyForTest> Create(); | |
|
tim (not reviewing)
2014/04/07 20:23:10
I see. Sad face. In this case I still think the m
maniscalco
2014/04/08 17:51:57
I like this approach. Done. ASP is no longer RCT
| |
| 23 | |
| 24 private: | |
| 25 scoped_ptr<AttachmentService> wrapped_; | |
| 26 // WeakPtrFactory for wrapped_. See Create() for why this is a scoped_ptr. | |
| 27 scoped_ptr<base::WeakPtrFactory<AttachmentService> > weak_ptr_factory_; | |
| 28 | |
| 29 AttachmentServiceProxyForTest( | |
| 30 scoped_ptr<AttachmentService>, | |
| 31 scoped_ptr<base::WeakPtrFactory<AttachmentService> > weak_ptr_factory); | |
| 32 | |
| 33 virtual ~AttachmentServiceProxyForTest(); | |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(AttachmentServiceProxyForTest); | |
| 36 }; | |
| 37 | |
| 38 } // namespace syncer | |
| 39 | |
| 40 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_FOR_TEST_H_ | |
| OLD | NEW |