Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1110)

Unified Diff: chrome/browser/chromeos/gdata/fake_gdata_contacts_service.h

Issue 10818017: contacts: Add GDataContactsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor cleanup Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/gdata/fake_gdata_contacts_service.h
diff --git a/chrome/browser/chromeos/gdata/fake_gdata_contacts_service.h b/chrome/browser/chromeos/gdata/fake_gdata_contacts_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..15fa77289e1f32df1eebb727f47a205e8f5b6268
--- /dev/null
+++ b/chrome/browser/chromeos/gdata/fake_gdata_contacts_service.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_GDATA_FAKE_GDATA_CONTACTS_SERVICE_H_
+#define CHROME_BROWSER_CHROMEOS_GDATA_FAKE_GDATA_CONTACTS_SERVICE_H_
+
+#include "chrome/browser/chromeos/gdata/gdata_contacts_service.h"
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/compiler_specific.h"
+#include "base/time.h"
+
+namespace contacts {
+typedef std::vector<const contacts::Contact*> ContactPointers;
+}
+
+namespace gdata {
+
+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. :-)
+ public:
+ FakeGDataContactsService();
+ virtual ~FakeGDataContactsService();
+
+ void set_download_should_succeed(bool succeed) {
+ download_should_succeed_ = succeed;
+ }
+
+ void SetContacts(const contacts::ContactPointers& contacts,
satorux1 2012/07/24 18:25:51 function comment?
Daniel Erat 2012/07/24 20:37:21 Done.
+ const base::Time& expected_min_update_time);
+
+ // Overridden from GDataContactsServiceInterface:
+ virtual void Initialize() OVERRIDE;
+ virtual void DownloadContacts(SuccessCallback success_callback,
+ FailureCallback failure_callback,
+ const base::Time& min_update_time) OVERRIDE;
+
+ private:
+ // Should calls to DownloadContacts() succeed?
+ bool download_should_succeed_;
+
+ // Contacts to be returned by calls to DownloadContacts().
+ ScopedVector<contacts::Contact> contacts_;
+
+ // |min_update_time| value that we expect to be passed to DownloadContacts().
+ // If a different value is passed, we'll log an error and report failure.
+ base::Time expected_min_update_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeGDataContactsService);
+};
+
+} // namespace gdata
+
+#endif // CHROME_BROWSER_CHROMEOS_GDATA_FAKE_GDATA_CONTACTS_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698