OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ |
6 #define CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <vector> |
| 10 |
| 11 #include "base/ref_counted.h" |
9 #include "chrome/browser/sync/engine/model_safe_worker.h" | 12 #include "chrome/browser/sync/engine/model_safe_worker.h" |
| 13 #include "chrome/browser/sync/syncable/model_type.h" |
10 | 14 |
11 namespace browser_sync { | 15 namespace browser_sync { |
12 | 16 |
13 class MockUIModelWorker : public ModelSafeWorker { | 17 class MockUIModelWorker : public ModelSafeWorker { |
14 public: | 18 public: |
15 virtual ModelSafeGroup GetModelSafeGroup() { return GROUP_UI; } | 19 virtual ModelSafeGroup GetModelSafeGroup(); |
16 virtual bool CurrentThreadIsWorkThread() { return true; } | 20 virtual bool CurrentThreadIsWorkThread(); |
17 }; | 21 }; |
18 | 22 |
19 class MockDBModelWorker : public ModelSafeWorker { | 23 class MockDBModelWorker : public ModelSafeWorker { |
20 public: | 24 public: |
21 virtual ModelSafeGroup GetModelSafeGroup() { return GROUP_DB; } | 25 virtual ModelSafeGroup GetModelSafeGroup(); |
22 virtual bool CurrentThreadIsWorkThread() { return true; } | 26 virtual bool CurrentThreadIsWorkThread(); |
| 27 }; |
| 28 |
| 29 class MockModelSafeWorkerRegistrar : public ModelSafeWorkerRegistrar { |
| 30 public: |
| 31 virtual ~MockModelSafeWorkerRegistrar(); |
| 32 static MockModelSafeWorkerRegistrar* PassiveBookmarks(); |
| 33 virtual void GetWorkers(std::vector<ModelSafeWorker*>* out); |
| 34 virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out); |
| 35 |
| 36 private: |
| 37 explicit MockModelSafeWorkerRegistrar(const ModelSafeRoutingInfo& routes); |
| 38 |
| 39 scoped_refptr<ModelSafeWorker> passive_worker_; |
| 40 ModelSafeRoutingInfo routes_; |
23 }; | 41 }; |
24 | 42 |
25 } // namespace browser_sync | 43 } // namespace browser_sync |
26 | 44 |
27 #endif // CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ | 45 #endif // CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ |
28 | 46 |
OLD | NEW |