1a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
2a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// found in the LICENSE file.
4a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
5a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#ifndef SYNC_API_SYNC_CHANGE_PROCESSOR_WRAPPER_FOR_TEST_H_
6a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#define SYNC_API_SYNC_CHANGE_PROCESSOR_WRAPPER_FOR_TEST_H_
7a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
8a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "sync/api/sync_change_processor.h"
9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
10a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace syncer {
11a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
12a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// A wrapper class for use in tests.
13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class SyncChangeProcessorWrapperForTest : public SyncChangeProcessor {
14a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) public:
15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // Create a SyncChangeProcessorWrapperForTest.
16a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  //
17a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // All method calls are forwarded to |wrapped|. Caller maintains ownership
18a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // of |wrapped| and is responsible for ensuring it outlives this object.
19a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  explicit SyncChangeProcessorWrapperForTest(
20a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)      syncer::SyncChangeProcessor* wrapped);
21a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual ~SyncChangeProcessorWrapperForTest();
22a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
23a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // SyncChangeProcessor implementation.
24a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual syncer::SyncError ProcessSyncChanges(
25a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)      const tracked_objects::Location& from_here,
26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)      const syncer::SyncChangeList& change_list) OVERRIDE;
27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type)
28a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)      const OVERRIDE;
29a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
30a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) private:
31a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  syncer::SyncChangeProcessor* const wrapped_;
32a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
33a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(SyncChangeProcessorWrapperForTest);
34a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)};
35a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
36a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)}  // namespace syncer
37a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
38a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#endif  // SYNC_API_SYNC_CHANGE_PROCESSOR_WRAPPER_FOR_TEST_H_
39