| 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 #include "sync/internal_api/public/test/test_internal_components_factory.h" | 5 #include "sync/internal_api/public/test/test_internal_components_factory.h" | 
| 6 | 6 | 
| 7 #include "sync/sessions/sync_session_context.h" | 7 #include "sync/sessions/sync_session_context.h" | 
| 8 #include "sync/syncable/in_memory_directory_backing_store.h" | 8 #include "sync/syncable/in_memory_directory_backing_store.h" | 
| 9 #include "sync/syncable/on_disk_directory_backing_store.h" | 9 #include "sync/syncable/on_disk_directory_backing_store.h" | 
| 10 #include "sync/syncable/invalid_directory_backing_store.h" | 10 #include "sync/syncable/invalid_directory_backing_store.h" | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 38     const std::string& invalidator_client_id) { | 38     const std::string& invalidator_client_id) { | 
| 39 | 39 | 
| 40   // Tests don't wire up listeners. | 40   // Tests don't wire up listeners. | 
| 41   std::vector<SyncEngineEventListener*> empty_listeners; | 41   std::vector<SyncEngineEventListener*> empty_listeners; | 
| 42   return scoped_ptr<sessions::SyncSessionContext>( | 42   return scoped_ptr<sessions::SyncSessionContext>( | 
| 43       new sessions::SyncSessionContext( | 43       new sessions::SyncSessionContext( | 
| 44           connection_manager, directory, workers, monitor, | 44           connection_manager, directory, workers, monitor, | 
| 45           empty_listeners, debug_info_getter, | 45           empty_listeners, debug_info_getter, | 
| 46           traffic_recorder, | 46           traffic_recorder, | 
| 47           switches_.encryption_method == ENCRYPTION_KEYSTORE, | 47           switches_.encryption_method == ENCRYPTION_KEYSTORE, | 
|  | 48           switches_.pre_commit_updates_policy == | 
|  | 49               FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE, | 
| 48           invalidator_client_id)); | 50           invalidator_client_id)); | 
| 49 | 51 | 
| 50 } | 52 } | 
| 51 | 53 | 
| 52 scoped_ptr<syncable::DirectoryBackingStore> | 54 scoped_ptr<syncable::DirectoryBackingStore> | 
| 53 TestInternalComponentsFactory::BuildDirectoryBackingStore( | 55 TestInternalComponentsFactory::BuildDirectoryBackingStore( | 
| 54       const std::string& dir_name, const base::FilePath& backing_filepath) { | 56       const std::string& dir_name, const base::FilePath& backing_filepath) { | 
| 55   switch (storage_option_) { | 57   switch (storage_option_) { | 
| 56     case STORAGE_IN_MEMORY: | 58     case STORAGE_IN_MEMORY: | 
| 57       return scoped_ptr<syncable::DirectoryBackingStore>( | 59       return scoped_ptr<syncable::DirectoryBackingStore>( | 
| 58           new syncable::InMemoryDirectoryBackingStore(dir_name)); | 60           new syncable::InMemoryDirectoryBackingStore(dir_name)); | 
| 59     case STORAGE_ON_DISK: | 61     case STORAGE_ON_DISK: | 
| 60       return scoped_ptr<syncable::DirectoryBackingStore>( | 62       return scoped_ptr<syncable::DirectoryBackingStore>( | 
| 61           new syncable::OnDiskDirectoryBackingStore(dir_name, | 63           new syncable::OnDiskDirectoryBackingStore(dir_name, | 
| 62                                                     backing_filepath)); | 64                                                     backing_filepath)); | 
| 63     case STORAGE_INVALID: | 65     case STORAGE_INVALID: | 
| 64       return scoped_ptr<syncable::DirectoryBackingStore>( | 66       return scoped_ptr<syncable::DirectoryBackingStore>( | 
| 65           new syncable::InvalidDirectoryBackingStore()); | 67           new syncable::InvalidDirectoryBackingStore()); | 
| 66   } | 68   } | 
| 67   NOTREACHED(); | 69   NOTREACHED(); | 
| 68   return scoped_ptr<syncable::DirectoryBackingStore>(); | 70   return scoped_ptr<syncable::DirectoryBackingStore>(); | 
| 69 } | 71 } | 
| 70 | 72 | 
| 71 InternalComponentsFactory::Switches | 73 InternalComponentsFactory::Switches | 
| 72 TestInternalComponentsFactory::GetSwitches() const { | 74 TestInternalComponentsFactory::GetSwitches() const { | 
| 73   return switches_; | 75   return switches_; | 
| 74 } | 76 } | 
| 75 | 77 | 
| 76 }  // namespace syncer | 78 }  // namespace syncer | 
| OLD | NEW | 
|---|