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 { |