Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ |
| 7 | 7 |
| 8 #include "sync/internal_api/public/internal_components_factory.h" | 8 #include "sync/internal_api/public/internal_components_factory.h" |
| 9 | 9 |
| 10 namespace syncer { | 10 namespace syncer { |
| 11 | 11 |
| 12 enum StorageOption { | |
| 13 // BuildDirectoryBackingStore should not use persistent on-disk storage. | |
| 14 STORAGE_IN_MEMORY, | |
| 15 // Use this if you want BuildDirectoryBackingStore to create a real | |
| 16 // on disk store. | |
| 17 STORAGE_ON_DISK, | |
| 18 // Use this to test the case where a directory fails to load. | |
| 19 STORAGE_INVALID | |
| 20 }; | |
| 21 | |
| 22 class TestInternalComponentsFactory : public InternalComponentsFactory { | 12 class TestInternalComponentsFactory : public InternalComponentsFactory { |
| 23 public: | 13 public: |
| 24 explicit TestInternalComponentsFactory(const Switches& switches, | 14 explicit TestInternalComponentsFactory(const Switches& switches, |
| 25 StorageOption option); | 15 StorageOption option, |
| 16 StorageOption expected_storage); | |
|
Nicolas Zea
2014/08/11 18:12:25
Why are there two storage options here? What is ex
haitaol1
2014/08/11 18:49:09
|expected_storage| is the param that BuildDirector
| |
| 26 virtual ~TestInternalComponentsFactory(); | 17 virtual ~TestInternalComponentsFactory(); |
| 27 | 18 |
| 28 virtual scoped_ptr<SyncScheduler> BuildScheduler( | 19 virtual scoped_ptr<SyncScheduler> BuildScheduler( |
| 29 const std::string& name, | 20 const std::string& name, |
| 30 sessions::SyncSessionContext* context, | 21 sessions::SyncSessionContext* context, |
| 31 syncer::CancelationSignal* cancelation_signal) OVERRIDE; | 22 syncer::CancelationSignal* cancelation_signal) OVERRIDE; |
| 32 | 23 |
| 33 virtual scoped_ptr<sessions::SyncSessionContext> BuildContext( | 24 virtual scoped_ptr<sessions::SyncSessionContext> BuildContext( |
| 34 ServerConnectionManager* connection_manager, | 25 ServerConnectionManager* connection_manager, |
| 35 syncable::Directory* directory, | 26 syncable::Directory* directory, |
| 36 ExtensionsActivity* monitor, | 27 ExtensionsActivity* monitor, |
| 37 const std::vector<SyncEngineEventListener*>& listeners, | 28 const std::vector<SyncEngineEventListener*>& listeners, |
| 38 sessions::DebugInfoGetter* debug_info_getter, | 29 sessions::DebugInfoGetter* debug_info_getter, |
| 39 ModelTypeRegistry* model_type_registry, | 30 ModelTypeRegistry* model_type_registry, |
| 40 const std::string& invalidator_client_id) OVERRIDE; | 31 const std::string& invalidator_client_id) OVERRIDE; |
| 41 | 32 |
| 42 virtual scoped_ptr<syncable::DirectoryBackingStore> | 33 virtual scoped_ptr<syncable::DirectoryBackingStore> |
| 43 BuildDirectoryBackingStore( | 34 BuildDirectoryBackingStore( |
| 35 StorageOption storage, | |
| 44 const std::string& dir_name, | 36 const std::string& dir_name, |
| 45 const base::FilePath& backing_filepath) OVERRIDE; | 37 const base::FilePath& backing_filepath) OVERRIDE; |
| 46 | 38 |
| 47 virtual Switches GetSwitches() const OVERRIDE; | 39 virtual Switches GetSwitches() const OVERRIDE; |
| 48 | 40 |
| 49 private: | 41 private: |
| 50 const Switches switches_; | 42 const Switches switches_; |
| 51 const StorageOption storage_option_; | 43 const StorageOption storage_override_; |
| 44 const StorageOption expected_storage_; | |
| 52 | 45 |
| 53 DISALLOW_COPY_AND_ASSIGN(TestInternalComponentsFactory); | 46 DISALLOW_COPY_AND_ASSIGN(TestInternalComponentsFactory); |
| 54 }; | 47 }; |
| 55 | 48 |
| 56 } // namespace syncer | 49 } // namespace syncer |
| 57 | 50 |
| 58 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ | 51 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ |
| OLD | NEW |