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 "chrome/browser/sync/engine/model_safe_worker.h" | 9 #include "chrome/browser/sync/engine/model_safe_worker.h" |
10 | 10 |
11 namespace browser_sync { | 11 namespace browser_sync { |
12 | 12 |
13 class MockUIModelWorker : public ModelSafeWorker { | 13 class MockUIModelWorker : public ModelSafeWorker { |
14 public: | 14 public: |
15 virtual ModelSafeGroup GetModelSafeGroup() { return GROUP_UI; } | 15 virtual ModelSafeGroup GetModelSafeGroup(); |
16 virtual bool CurrentThreadIsWorkThread() { return true; } | 16 virtual bool CurrentThreadIsWorkThread(); |
17 }; | 17 }; |
18 | 18 |
19 class MockDBModelWorker : public ModelSafeWorker { | 19 class MockDBModelWorker : public ModelSafeWorker { |
20 public: | 20 public: |
21 virtual ModelSafeGroup GetModelSafeGroup() { return GROUP_DB; } | 21 virtual ModelSafeGroup GetModelSafeGroup(); |
22 virtual bool CurrentThreadIsWorkThread() { return true; } | 22 virtual bool CurrentThreadIsWorkThread(); |
23 }; | |
24 | |
25 class MockModelSafeWorkerRegistrar : public ModelSafeWorkerRegistrar { | |
26 public: | |
27 virtual ~MockModelSafeWorkerRegistrar(); | |
28 static MockModelSafeWorkerRegistrar* PassiveBookmarks(); | |
29 virtual void GetWorkers(std::vector<ModelSafeWorker*>* out); | |
30 virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out); | |
31 | |
32 private: | |
33 explicit MockModelSafeWorkerRegistrar(const ModelSafeRoutingInfo& routes); | |
34 | |
35 scoped_refptr<ModelSafeWorker> passive_worker_; | |
akalin
2011/01/26 10:49:19
include ref_counted.h for this
| |
36 ModelSafeRoutingInfo routes_; | |
akalin
2011/01/26 10:49:19
do you need an include for this?
| |
23 }; | 37 }; |
24 | 38 |
25 } // namespace browser_sync | 39 } // namespace browser_sync |
26 | 40 |
27 #endif // CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ | 41 #endif // CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ |
28 | 42 |
OLD | NEW |