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

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: test 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..9095fcdc8c68de7cfba73f4e4565fb2e695b1e37
--- /dev/null
+++ b/sync/test/engine/fake_sync_scheduler.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.
+//
+// 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);
+ virtual void SetNotificationsEnabled(bool notifications_enabled) 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;
Nicolas Zea 2012/07/18 21:10:12 nit: newline after
tim (not reviewing) 2012/07/18 21:57:47 Done.
+ private:
+ MessageLoop* const created_on_loop_;
+};
+
+} // namespace csync
Nicolas Zea 2012/07/18 21:10:12 csync -> syncer
tim (not reviewing) 2012/07/18 21:57:47 Done.
+
+#endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_

Powered by Google App Engine
This is Rietveld 408576698