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

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

Issue 3913005: sync: enable password sync by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/debug
Patch Set: fix mac again Created 10 years, 2 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
diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.h b/chrome/browser/sync/abstract_profile_sync_service_test.h
index 57b3791809451a73c8e8722f40d4dad0b0200d9a..d13a3f8fc066a4ee3d9e69fc57a740d0e82be116 100644
--- a/chrome/browser/sync/abstract_profile_sync_service_test.h
+++ b/chrome/browser/sync/abstract_profile_sync_service_test.h
@@ -51,39 +51,38 @@ using syncable::WriteTransaction;
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;
- switch (model_type) {
+ static const std::string GetTagForType(ModelType type) {
+ switch (type) {
case syncable::AUTOFILL:
- tag_name = browser_sync::kAutofillTag;
- break;
+ return browser_sync::kAutofillTag;
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,
@@ -97,7 +96,7 @@ class ProfileSyncServiceTestHelper {
node.Put(SERVER_VERSION, 20);
node.Put(BASE_VERSION, 20);
node.Put(IS_DEL, false);
- node.Put(syncable::ID, ids->MakeServer(tag_name));
+ EXPECT_TRUE(node.Put(syncable::ID, ids->MakeServer(tag_name)));
sync_pb::EntitySpecifics specifics;
syncable::AddDefaultExtensionValue(model_type, &specifics);
node.Put(SPECIFICS, specifics);
@@ -113,7 +112,8 @@ class AbstractProfileSyncServiceTest : public testing::Test {
bool CreateRoot(ModelType model_type) {
return ProfileSyncServiceTestHelper::CreateRoot(model_type,
- service_.get(), &ids_);
+ service_.get(),
+ service_->id_factory());
}
protected:
@@ -123,7 +123,6 @@ class AbstractProfileSyncServiceTest : public testing::Test {
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