• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_
6 #define CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_
7 #pragma once
8 
9 #include <vector>
10 
11 #include "base/memory/ref_counted.h"
12 #include "chrome/browser/sync/engine/model_safe_worker.h"
13 #include "chrome/browser/sync/syncable/model_type.h"
14 
15 namespace browser_sync {
16 
17 class MockUIModelWorker : public ModelSafeWorker {
18  public:
19   virtual ModelSafeGroup GetModelSafeGroup();
20   virtual bool CurrentThreadIsWorkThread();
21 };
22 
23 class MockDBModelWorker : public ModelSafeWorker {
24  public:
25   virtual ModelSafeGroup GetModelSafeGroup();
26   virtual bool CurrentThreadIsWorkThread();
27 };
28 
29 class MockModelSafeWorkerRegistrar : public ModelSafeWorkerRegistrar {
30  public:
31   virtual ~MockModelSafeWorkerRegistrar();
32   static MockModelSafeWorkerRegistrar* PassiveBookmarks();
33   static MockModelSafeWorkerRegistrar* PassiveForTypes(
34       const syncable::ModelTypeBitSet& set);
35   virtual void GetWorkers(std::vector<ModelSafeWorker*>* out);
36   virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out);
37 
38  private:
39   explicit MockModelSafeWorkerRegistrar(const ModelSafeRoutingInfo& routes);
40 
41   scoped_refptr<ModelSafeWorker> passive_worker_;
42   ModelSafeRoutingInfo routes_;
43 };
44 
45 }  // namespace browser_sync
46 
47 #endif  // CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_
48 
49