OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_ | |
6 #define CHROME_BROWSER_SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_ | |
7 #pragma once | |
8 | |
9 #include <vector> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/compiler_specific.h" | |
13 #include "base/threading/non_thread_safe.h" | |
14 #include "chrome/browser/sync/engine/model_safe_worker.h" | |
15 #include "chrome/browser/sync/internal_api/includes/syncer_error.h" | |
16 | |
17 namespace browser_sync { | |
18 | |
19 // Fake implementation of ModelSafeWorker that does work on the | |
20 // current thread regardless of the group. | |
21 class FakeModelWorker : public ModelSafeWorker { | |
22 public: | |
23 explicit FakeModelWorker(ModelSafeGroup group); | |
24 | |
25 // ModelSafeWorker implementation. | |
26 virtual SyncerError DoWorkAndWaitUntilDone( | |
27 const WorkCallback& work) OVERRIDE; | |
28 virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; | |
29 | |
30 private: | |
31 virtual ~FakeModelWorker(); | |
32 | |
33 base::NonThreadSafe non_thread_safe_; | |
34 | |
35 const ModelSafeGroup group_; | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(FakeModelWorker); | |
38 }; | |
39 | |
40 } // namespace browser_sync | |
41 | |
42 #endif // CHROME_BROWSER_SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_ | |
43 | |
OLD | NEW |