Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_GDATA_FAKE_GDATA_CONTACTS_SERVICE_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_FAKE_GDATA_CONTACTS_SERVICE_H_ | |
| 7 | |
| 8 #include "chrome/browser/chromeos/gdata/gdata_contacts_service.h" | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/callback.h" | |
| 12 #include "base/compiler_specific.h" | |
| 13 #include "base/time.h" | |
| 14 | |
| 15 namespace contacts { | |
| 16 typedef std::vector<const contacts::Contact*> ContactPointers; | |
| 17 } | |
| 18 | |
| 19 namespace gdata { | |
| 20 | |
| 21 class FakeGDataContactsService : public GDataContactsServiceInterface { | |
|
satorux1
2012/07/24 18:25:51
class comment is missing. is this only used for te
Daniel Erat
2012/07/24 20:37:21
I'm really not a Gmock fan. :-)
| |
| 22 public: | |
| 23 FakeGDataContactsService(); | |
| 24 virtual ~FakeGDataContactsService(); | |
| 25 | |
| 26 void set_download_should_succeed(bool succeed) { | |
| 27 download_should_succeed_ = succeed; | |
| 28 } | |
| 29 | |
| 30 void SetContacts(const contacts::ContactPointers& contacts, | |
|
satorux1
2012/07/24 18:25:51
function comment?
Daniel Erat
2012/07/24 20:37:21
Done.
| |
| 31 const base::Time& expected_min_update_time); | |
| 32 | |
| 33 // Overridden from GDataContactsServiceInterface: | |
| 34 virtual void Initialize() OVERRIDE; | |
| 35 virtual void DownloadContacts(SuccessCallback success_callback, | |
| 36 FailureCallback failure_callback, | |
| 37 const base::Time& min_update_time) OVERRIDE; | |
| 38 | |
| 39 private: | |
| 40 // Should calls to DownloadContacts() succeed? | |
| 41 bool download_should_succeed_; | |
| 42 | |
| 43 // Contacts to be returned by calls to DownloadContacts(). | |
| 44 ScopedVector<contacts::Contact> contacts_; | |
| 45 | |
| 46 // |min_update_time| value that we expect to be passed to DownloadContacts(). | |
| 47 // If a different value is passed, we'll log an error and report failure. | |
| 48 base::Time expected_min_update_time_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(FakeGDataContactsService); | |
| 51 }; | |
| 52 | |
| 53 } // namespace gdata | |
| 54 | |
| 55 #endif // CHROME_BROWSER_CHROMEOS_GDATA_FAKE_GDATA_CONTACTS_SERVICE_H_ | |
| OLD | NEW |