| 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 |
| 12 class TestInternalComponentsFactory : public InternalComponentsFactory { | 22 class TestInternalComponentsFactory : public InternalComponentsFactory { |
| 13 public: | 23 public: |
| 14 enum StorageOption { | |
| 15 // BuildDirectoryBackingStore should not use persistent on-disk storage. | |
| 16 IN_MEMORY, | |
| 17 // Use this if you want BuildDirectoryBackingStore to create a real | |
| 18 // on disk store. | |
| 19 ON_DISK | |
| 20 }; | |
| 21 | |
| 22 explicit TestInternalComponentsFactory(StorageOption option); | 24 explicit TestInternalComponentsFactory(StorageOption option); |
| 23 virtual ~TestInternalComponentsFactory(); | 25 virtual ~TestInternalComponentsFactory(); |
| 24 | 26 |
| 25 virtual scoped_ptr<SyncScheduler> BuildScheduler( | 27 virtual scoped_ptr<SyncScheduler> BuildScheduler( |
| 26 const std::string& name, | 28 const std::string& name, |
| 27 sessions::SyncSessionContext* context) OVERRIDE; | 29 sessions::SyncSessionContext* context) OVERRIDE; |
| 28 | 30 |
| 29 virtual scoped_ptr<sessions::SyncSessionContext> BuildContext( | 31 virtual scoped_ptr<sessions::SyncSessionContext> BuildContext( |
| 30 ServerConnectionManager* connection_manager, | 32 ServerConnectionManager* connection_manager, |
| 31 syncable::Directory* directory, | 33 syncable::Directory* directory, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 const StorageOption storage_option_; | 47 const StorageOption storage_option_; |
| 46 | 48 |
| 47 DISALLOW_COPY_AND_ASSIGN(TestInternalComponentsFactory); | 49 DISALLOW_COPY_AND_ASSIGN(TestInternalComponentsFactory); |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 } // namespace syncer | 52 } // namespace syncer |
| 51 | 53 |
| 52 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ | 54 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_ |
| OLD | NEW |