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

Unified Diff: chrome/browser/sync/abstract_profile_sync_service_test.h

Issue 6249006: Turn password sync on by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « no previous file | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/abstract_profile_sync_service_test.h
===================================================================
--- chrome/browser/sync/abstract_profile_sync_service_test.h (revision 71392)
+++ chrome/browser/sync/abstract_profile_sync_service_test.h (working copy)
@@ -52,42 +52,41 @@
class ProfileSyncServiceTestHelper {
public:
- static bool CreateRoot(ModelType model_type, ProfileSyncService* service,
- TestIdFactory* ids) {
- UserShare* user_share = service->backend()->GetUserShareHandle();
- DirectoryManager* dir_manager = user_share->dir_manager.get();
-
- ScopedDirLookup dir(dir_manager, user_share->name);
- if (!dir.good())
- return false;
-
- std::string tag_name;
+ static const std::string GetTagForType(ModelType model_type) {
switch (model_type) {
case syncable::AUTOFILL:
- tag_name = browser_sync::kAutofillTag;
- break;
+ return browser_sync::kAutofillTag;
case syncable::AUTOFILL_PROFILE:
- tag_name = browser_sync::kAutofillProfileTag;
- break;
+ return browser_sync::kAutofillProfileTag;
case syncable::PREFERENCES:
- tag_name = browser_sync::kPreferencesTag;
- break;
+ return browser_sync::kPreferencesTag;
case syncable::PASSWORDS:
- tag_name = browser_sync::kPasswordTag;
- break;
+ return browser_sync::kPasswordTag;
case syncable::NIGORI:
- tag_name = browser_sync::kNigoriTag;
- break;
+ return browser_sync::kNigoriTag;
case syncable::TYPED_URLS:
- tag_name = browser_sync::kTypedUrlTag;
- break;
+ return browser_sync::kTypedUrlTag;
case syncable::SESSIONS:
- tag_name = browser_sync::kSessionsTag;
- break;
+ return browser_sync::kSessionsTag;
+ case syncable::BOOKMARKS:
+ return "google_chrome_bookmarks";
default:
- return false;
+ NOTREACHED();
}
+ return std::string();
+ }
+ static bool CreateRoot(ModelType model_type, ProfileSyncService* service,
+ TestIdFactory* ids) {
+ UserShare* user_share = service->backend()->GetUserShareHandle();
+ DirectoryManager* dir_manager = user_share->dir_manager.get();
+
+ ScopedDirLookup dir(dir_manager, user_share->name);
+ if (!dir.good())
+ return false;
+
+ std::string tag_name = GetTagForType(model_type);
+
WriteTransaction wtrans(dir, UNITTEST, __FILE__, __LINE__);
MutableEntry node(&wtrans,
CREATE,
@@ -117,7 +116,8 @@
bool CreateRoot(ModelType model_type) {
return ProfileSyncServiceTestHelper::CreateRoot(model_type,
- service_.get(), &ids_);
+ service_.get(),
+ service_->id_factory());
}
protected:
@@ -127,7 +127,6 @@
ProfileSyncFactoryMock factory_;
TokenService token_service_;
scoped_ptr<TestProfileSyncService> service_;
- TestIdFactory ids_;
};
class CreateRootTask : public Task {
« no previous file with comments | « no previous file | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698