Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / sync / test / engine / mock_update_handler.h
blob6993ab2ce1bacf0797babff67bbb0a97a28e50cd
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SYNC_TEST_ENGINE_MOCK_UPDATE_HANDLER_H_
6 #define SYNC_TEST_ENGINE_MOCK_UPDATE_HANDLER_H_
8 #include "base/compiler_specific.h"
9 #include "sync/engine/update_handler.h"
10 #include "sync/internal_api/public/base/model_type.h"
11 #include "sync/protocol/sync.pb.h"
13 namespace syncer {
15 class MockUpdateHandler : public UpdateHandler {
16 public:
17 explicit MockUpdateHandler(ModelType type);
18 ~MockUpdateHandler() override;
20 // UpdateHandler implementation.
21 void GetDownloadProgress(
22 sync_pb::DataTypeProgressMarker* progress_marker) const override;
23 void GetDataTypeContext(sync_pb::DataTypeContext* context) const override;
24 SyncerError ProcessGetUpdatesResponse(
25 const sync_pb::DataTypeProgressMarker& progress_marker,
26 const sync_pb::DataTypeContext& mutated_context,
27 const SyncEntityList& applicable_updates,
28 sessions::StatusController* status) override;
29 void ApplyUpdates(sessions::StatusController* status) override;
30 void PassiveApplyUpdates(sessions::StatusController* status) override;
32 // Returns the number of times ApplyUpdates() was invoked.
33 int GetApplyUpdatesCount();
35 // Returns the number of times PassiveApplyUpdates() was invoked.
36 int GetPassiveApplyUpdatesCount();
38 private:
39 sync_pb::DataTypeProgressMarker progress_marker_;
41 int apply_updates_count_;
42 int passive_apply_updates_count_;
45 } // namespace syncer
47 #endif // SYNC_TEST_ENGINE_MOCK_UPDATE_HANDLER_H_