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

Unified Diff: chrome/browser/sync/test_profile_sync_service.cc

Issue 10701046: sync: Remove SyncManager::TestingMode in favour of InternalComponentsFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now with more scope 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
Index: chrome/browser/sync/test_profile_sync_service.cc
diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc
index 2738fbb2d65f1b0b877741f64151d64c8d858dee..51a915d9c16a24330044ee020741e99261b3d7a5 100644
--- a/chrome/browser/sync/test_profile_sync_service.cc
+++ b/chrome/browser/sync/test_profile_sync_service.cc
@@ -12,12 +12,14 @@
#include "chrome/browser/sync/test/test_http_bridge_factory.h"
#include "chrome/common/chrome_notification_types.h"
#include "sync/internal_api/public/sessions/sync_session_snapshot.h"
+#include "sync/internal_api/public/test/test_internal_components_factory.h"
#include "sync/internal_api/public/user_share.h"
#include "sync/js/js_reply_handler.h"
#include "sync/protocol/encryption.pb.h"
#include "sync/syncable/directory.h"
using syncer::ModelSafeRoutingInfo;
+using syncer::TestInternalComponentsFactory;
using syncer::sessions::ModelNeutralState;
using syncer::sessions::SyncSessionSnapshot;
using syncer::sessions::SyncSourceInfo;
@@ -59,9 +61,16 @@ void SyncBackendHostForProfileSyncTest::InitCore(
test_options.credentials.email = "testuser@gmail.com";
test_options.credentials.sync_token = "token";
test_options.restored_key_for_bootstrapping = "";
- test_options.testing_mode =
- use_real_database_ ? syncer::SyncManager::TEST_ON_DISK
- : syncer::SyncManager::TEST_IN_MEMORY;
+ TestInternalComponentsFactory::StorageOption storage =
+ use_real_database_ ? TestInternalComponentsFactory::ON_DISK
+ : TestInternalComponentsFactory::IN_MEMORY;
+
+ // It'd be nice if we avoided creating the InternalComponentsFactory in the
+ // first place, but SyncBackendHost will have created one by now so we must
+ // free it.
+ delete test_options.internal_components_factory;
+ test_options.internal_components_factory =
+ new TestInternalComponentsFactory(storage);
SyncBackendHost::InitCore(test_options);
// TODO(akalin): Figure out a better way to do this.
if (synchronous_init_) {

Powered by Google App Engine
This is Rietveld 408576698