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

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

Issue 3133022: sync: take two for: "Added classes to enable session sync... (Closed)
Patch Set: Created 10 years, 4 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 | « chrome/browser/sessions/tab_restore_service.h ('k') | chrome/browser/sync/engine/syncapi.h » ('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 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:
« no previous file with comments | « chrome/browser/sessions/tab_restore_service.h ('k') | chrome/browser/sync/engine/syncapi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698