1 // Copyright (c) 2012 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_FAKE_MODEL_WORKER_H_
6 #define SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/threading/non_thread_safe.h"
13 #include "sync/internal_api/public/engine/model_safe_worker.h"
14 #include "sync/internal_api/public/util/syncer_error.h"
18 // Fake implementation of ModelSafeWorker that does work on the
19 // current thread regardless of the group.
20 class FakeModelWorker
: public ModelSafeWorker
, public base::NonThreadSafe
{
22 explicit FakeModelWorker(ModelSafeGroup group
);
24 // ModelSafeWorker implementation.
25 void RegisterForLoopDestruction() override
;
26 ModelSafeGroup
GetModelSafeGroup() override
;
29 SyncerError
DoWorkAndWaitUntilDoneImpl(const WorkCallback
& work
) override
;
32 ~FakeModelWorker() override
;
34 const ModelSafeGroup group_
;
36 DISALLOW_COPY_AND_ASSIGN(FakeModelWorker
);
41 #endif // SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_