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

Unified Diff: components/sync_driver/fake_sync_service.h

Issue 1158223003: [iOS] Add FakeSyncService and factory for testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 6 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
« no previous file with comments | « components/sync_driver/DEPS ('k') | components/sync_driver/fake_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_driver/fake_sync_service.h
diff --git a/components/sync_driver/fake_sync_service.h b/components/sync_driver/fake_sync_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..951d539b144ff3e610352e8ab4a1fdb96e0918c8
--- /dev/null
+++ b/components/sync_driver/fake_sync_service.h
@@ -0,0 +1,60 @@
+// Copyright 2015 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 COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_
+#define COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_
+
+#include "components/sync_driver/sync_service.h"
+#include "google_apis/gaia/google_service_auth_error.h"
+
+namespace sync_driver {
+
+// Fake implementation of sync_driver::SyncService, used for testing.
+class FakeSyncService : public sync_driver::SyncService {
+ public:
+ FakeSyncService();
+ ~FakeSyncService() override;
+
+ private:
+ // sync_driver::SyncService:
+ bool HasSyncSetupCompleted() const override;
+ bool IsSyncActive() const override;
+ syncer::ModelTypeSet GetActiveDataTypes() const override;
+ void AddObserver(sync_driver::SyncServiceObserver* observer) override;
+ void RemoveObserver(sync_driver::SyncServiceObserver* observer) override;
+ bool HasObserver(
+ const sync_driver::SyncServiceObserver* observer) const override;
+ bool IsSyncEnabledAndLoggedIn() override;
+ void DisableForUser() override;
+ void RequestStop() override;
+ void RequestStart() override;
+ syncer::ModelTypeSet GetPreferredDataTypes() const override;
+ void OnUserChoseDatatypes(bool sync_everything,
+ syncer::ModelTypeSet chosen_types) override;
+ void SetSyncSetupCompleted() override;
+ bool FirstSetupInProgress() const override;
+ void SetSetupInProgress(bool setup_in_progress) override;
+ bool setup_in_progress() const override;
+ bool ConfigurationDone() const override;
+ const GoogleServiceAuthError& GetAuthError() const override;
+ bool HasUnrecoverableError() const override;
+ bool backend_initialized() const override;
+ bool IsPassphraseRequiredForDecryption() const override;
+ base::Time GetExplicitPassphraseTime() const override;
+ bool IsUsingSecondaryPassphrase() const override;
+ void EnableEncryptEverything() override;
+ void SetEncryptionPassphrase(const std::string& passphrase,
+ PassphraseType type) override;
+ bool SetDecryptionPassphrase(const std::string& passphrase) override;
+
+ // sync_driver::DataTypeEncryptionHandler:
+ bool IsPassphraseRequired() const override;
+ syncer::ModelTypeSet GetEncryptedDataTypes() const override;
+
+ GoogleServiceAuthError error_;
+};
+
+} // namespace sync_driver
+
+#endif // COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_
« no previous file with comments | « components/sync_driver/DEPS ('k') | components/sync_driver/fake_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698