#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"
TestInternalComponentsFactory::TestInternalComponentsFactory(
const Switches& switches,
- StorageOption option)
+ StorageOption option,
+ StorageOption* storage_used)
: switches_(switches),
- storage_option_(option) {
+ storage_override_(option),
+ storage_used_(storage_used) {
}
TestInternalComponentsFactory::~TestInternalComponentsFactory() { }
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) {
+ if (storage_used_)
+ *storage_used_ = storage;
+
+ switch (storage_override_) {
case STORAGE_IN_MEMORY:
return scoped_ptr<syncable::DirectoryBackingStore>(
new syncable::InMemoryDirectoryBackingStore(dir_name));
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());