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

Unified Diff: sync/test/engine/fake_sync_scheduler.h

Issue 10701046: sync: Remove SyncManager::TestingMode in favour of InternalComponentsFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now with more scope 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: sync/test/engine/fake_sync_scheduler.h
diff --git a/sync/test/engine/fake_sync_scheduler.h b/sync/test/engine/fake_sync_scheduler.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c2fbba0ce6e24c6380737a37452a3fccec49dcd
--- /dev/null
+++ b/sync/test/engine/fake_sync_scheduler.h
@@ -0,0 +1,61 @@
+// 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.
+//
+// A fake implementation of the SyncScheduler. If needed, we should add default
+// logic needed for tests (invoking callbacks, etc) here rather than in higher
+// level test classes.
+
+#ifndef SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_
+#define SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_
+
+#include "base/message_loop.h"
+#include "sync/engine/sync_scheduler.h"
+
+namespace syncer {
+
+class FakeSyncScheduler : public SyncScheduler {
+ public:
+ FakeSyncScheduler();
+ virtual ~FakeSyncScheduler();
+
+ virtual void Start(Mode mode) OVERRIDE;
+ virtual void RequestStop(const base::Closure& callback) OVERRIDE;
+ virtual void ScheduleNudgeAsync(
+ const base::TimeDelta& delay,
+ NudgeSource source,
+ ModelTypeSet types,
+ const tracked_objects::Location& nudge_location) OVERRIDE;
+ virtual void ScheduleNudgeWithPayloadsAsync(
+ const base::TimeDelta& delay, NudgeSource source,
+ const ModelTypePayloadMap& types_with_payloads,
+ const tracked_objects::Location& nudge_location) OVERRIDE;
+ virtual bool ScheduleConfiguration(
+ const ConfigurationParams& params) OVERRIDE;
+ virtual void SetNotificationsEnabled(bool notifications_enabled) OVERRIDE;
+
+ virtual base::TimeDelta GetSessionsCommitDelay() const OVERRIDE;
+ virtual void OnCredentialsUpdated() OVERRIDE;
+ virtual void OnConnectionStatusChange() OVERRIDE;
+
+ // SyncSession::Delegate implementation.
+ virtual void OnSilencedUntil(
+ const base::TimeTicks& silenced_until) OVERRIDE;
+ virtual bool IsSyncingCurrentlySilenced() OVERRIDE;
+ virtual void OnReceivedShortPollIntervalUpdate(
+ const base::TimeDelta& new_interval) OVERRIDE;
+ virtual void OnReceivedLongPollIntervalUpdate(
+ const base::TimeDelta& new_interval) OVERRIDE;
+ virtual void OnReceivedSessionsCommitDelay(
+ const base::TimeDelta& new_delay) OVERRIDE;
+ virtual void OnShouldStopSyncingPermanently() OVERRIDE;
+ virtual void OnSyncProtocolError(
+ const sessions::SyncSessionSnapshot& snapshot) OVERRIDE;
+
+ private:
+ MessageLoop* const created_on_loop_;
+};
+
+} // namespace syncer
+
+#endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_

Powered by Google App Engine
This is Rietveld 408576698