Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1166)

Unified Diff: sync/internal_api/test/test_internal_components_factory.cc

Issue 10830100: Fix SyncManager initialization failure crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add virtual destructor Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/internal_api/syncapi_unittest.cc ('k') | sync/sync.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ac3f8a833f1e9d932da68c6132dcb109ce7add6d..034f4a65f4efdf6fe2e17329efd3c5e5b0dc3696 100644
--- a/sync/internal_api/test/test_internal_components_factory.cc
+++ b/sync/internal_api/test/test_internal_components_factory.cc
@@ -7,6 +7,7 @@
#include "sync/sessions/sync_session_context.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"
#include "sync/test/engine/fake_sync_scheduler.h"
namespace syncer {
@@ -46,14 +47,20 @@ TestInternalComponentsFactory::BuildContext(
scoped_ptr<syncable::DirectoryBackingStore>
TestInternalComponentsFactory::BuildDirectoryBackingStore(
const std::string& dir_name, const FilePath& backing_filepath) {
- if (storage_option_ == IN_MEMORY) {
- return scoped_ptr<syncable::DirectoryBackingStore>(
- new syncable::InMemoryDirectoryBackingStore(dir_name));
- } else {
- return scoped_ptr<syncable::DirectoryBackingStore>(
- new syncable::OnDiskDirectoryBackingStore(dir_name,
- backing_filepath));
+ switch (storage_option_) {
+ case STORAGE_IN_MEMORY:
+ return scoped_ptr<syncable::DirectoryBackingStore>(
+ new syncable::InMemoryDirectoryBackingStore(dir_name));
+ case STORAGE_ON_DISK:
+ return scoped_ptr<syncable::DirectoryBackingStore>(
+ new syncable::OnDiskDirectoryBackingStore(dir_name,
+ backing_filepath));
+ case STORAGE_INVALID:
+ return scoped_ptr<syncable::DirectoryBackingStore>(
+ new syncable::InvalidDirectoryBackingStore());
}
+ NOTREACHED();
+ return scoped_ptr<syncable::DirectoryBackingStore>();
}
} // namespace syncer
« no previous file with comments | « sync/internal_api/syncapi_unittest.cc ('k') | sync/sync.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698