Chromium Code Reviews| Index: sync/internal_api/test/test_internal_components_factory.cc |
| diff --git a/sync/internal_api/test/test_internal_components_factory.cc b/sync/internal_api/test/test_internal_components_factory.cc |
| index c7d94e9b513d34a27786dd5c67ea7481bf087f9a..c1fc931b24fdd29647d0a50f69db679388f8aa8d 100644 |
| --- a/sync/internal_api/test/test_internal_components_factory.cc |
| +++ b/sync/internal_api/test/test_internal_components_factory.cc |
| @@ -5,6 +5,7 @@ |
| #include "sync/internal_api/public/test/test_internal_components_factory.h" |
| #include "sync/sessions/sync_session_context.h" |
| +#include "sync/syncable/deferred_on_disk_directory_backing_store.h" |
| #include "sync/syncable/in_memory_directory_backing_store.h" |
| #include "sync/syncable/on_disk_directory_backing_store.h" |
| #include "sync/syncable/invalid_directory_backing_store.h" |
| @@ -14,9 +15,11 @@ namespace syncer { |
| TestInternalComponentsFactory::TestInternalComponentsFactory( |
| const Switches& switches, |
| - StorageOption option) |
| + StorageOption option, |
| + StorageOption expected_storage) |
| : switches_(switches), |
| - storage_option_(option) { |
| + storage_override_(option), |
| + expected_storage_(expected_storage) { |
| } |
| TestInternalComponentsFactory::~TestInternalComponentsFactory() { } |
| @@ -54,8 +57,11 @@ TestInternalComponentsFactory::BuildContext( |
| scoped_ptr<syncable::DirectoryBackingStore> |
| TestInternalComponentsFactory::BuildDirectoryBackingStore( |
| - const std::string& dir_name, const base::FilePath& backing_filepath) { |
| - switch (storage_option_) { |
| + StorageOption storage, const std::string& dir_name, |
| + const base::FilePath& backing_filepath) { |
| + CHECK_EQ(expected_storage_, storage); |
|
Nicolas Zea
2014/08/13 20:32:05
I prefer keeping the verification of expectations
haitaol1
2014/08/14 01:30:34
Done.
|
| + |
| + switch (storage_override_) { |
| case STORAGE_IN_MEMORY: |
| return scoped_ptr<syncable::DirectoryBackingStore>( |
| new syncable::InMemoryDirectoryBackingStore(dir_name)); |
| @@ -63,6 +69,10 @@ TestInternalComponentsFactory::BuildDirectoryBackingStore( |
| return scoped_ptr<syncable::DirectoryBackingStore>( |
| new syncable::OnDiskDirectoryBackingStore(dir_name, |
| backing_filepath)); |
| + case STORAGE_ON_DISK_DEFERRED: |
| + return scoped_ptr<syncable::DirectoryBackingStore>( |
| + new syncable::DeferredOnDiskDirectoryBackingStore(dir_name, |
| + backing_filepath)); |
| case STORAGE_INVALID: |
| return scoped_ptr<syncable::DirectoryBackingStore>( |
| new syncable::InvalidDirectoryBackingStore()); |