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 24f61dffe1830aa1c2e436f314a40cf7ab5eaa77..7f81ca2a27e28d6b9a83b2fd2d6df33707653eff 100644 |
--- a/chrome/browser/sync/abstract_profile_sync_service_test.h |
+++ b/chrome/browser/sync/abstract_profile_sync_service_test.h |
@@ -16,6 +16,7 @@ |
#include "chrome/browser/sync/glue/autofill_model_associator.h" |
#include "chrome/browser/sync/glue/password_model_associator.h" |
#include "chrome/browser/sync/glue/preference_model_associator.h" |
+#include "chrome/browser/sync/glue/session_model_associator.h" |
#include "chrome/browser/sync/glue/typed_url_model_associator.h" |
#include "chrome/browser/sync/profile_sync_factory_mock.h" |
#include "chrome/browser/sync/protocol/sync.pb.h" |
@@ -33,7 +34,6 @@ using sync_api::UserShare; |
using syncable::BASE_VERSION; |
using syncable::CREATE; |
using syncable::DirectoryManager; |
-using syncable::ID; |
using syncable::IS_DEL; |
using syncable::IS_DIR; |
using syncable::IS_UNAPPLIED_UPDATE; |
@@ -48,13 +48,11 @@ using syncable::UNIQUE_SERVER_TAG; |
using syncable::UNITTEST; |
using syncable::WriteTransaction; |
-class AbstractProfileSyncServiceTest : public testing::Test { |
+class ProfileSyncServiceTestHelper { |
public: |
- AbstractProfileSyncServiceTest() |
- : ui_thread_(ChromeThread::UI, &message_loop_) {} |
- |
- bool CreateRoot(ModelType model_type) { |
- UserShare* user_share = service_->backend()->GetUserShareHandle(); |
+ 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->authenticated_name); |
@@ -78,6 +76,9 @@ class AbstractProfileSyncServiceTest : public testing::Test { |
case syncable::TYPED_URLS: |
tag_name = browser_sync::kTypedUrlTag; |
break; |
+ case syncable::SESSIONS: |
+ tag_name = browser_sync::kSessionsTag; |
+ break; |
default: |
return false; |
} |
@@ -95,13 +96,24 @@ class AbstractProfileSyncServiceTest : public testing::Test { |
node.Put(SERVER_VERSION, 20); |
node.Put(BASE_VERSION, 20); |
node.Put(IS_DEL, false); |
- node.Put(ID, ids_.MakeServer(tag_name)); |
+ node.Put(syncable::ID, ids->MakeServer(tag_name)); |
sync_pb::EntitySpecifics specifics; |
syncable::AddDefaultExtensionValue(model_type, &specifics); |
node.Put(SPECIFICS, specifics); |
return true; |
} |
+}; |
+ |
+class AbstractProfileSyncServiceTest : public testing::Test { |
+ public: |
+ AbstractProfileSyncServiceTest() |
+ : ui_thread_(ChromeThread::UI, &message_loop_) {} |
+ |
+ bool CreateRoot(ModelType model_type) { |
+ return ProfileSyncServiceTestHelper::CreateRoot(model_type, |
+ service_.get(), &ids_); |
+ } |
protected: |