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

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: rebase 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
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..224dc1cfc1e5420c6fbb687be545a1535e15e8a9
--- /dev/null
+++ b/components/sync_driver/fake_sync_service.h
@@ -0,0 +1,61 @@
+// 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/fake_sync_service.h"
Nicolas Zea 2015/06/09 21:27:20 Remove?
droger 2015/06/10 09:31:56 Done.
+#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_

Powered by Google App Engine
This is Rietveld 408576698