summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/profile_sync_test_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync/profile_sync_test_util.h')
-rw-r--r--chrome/browser/sync/profile_sync_test_util.h32
1 files changed, 2 insertions, 30 deletions
diff --git a/chrome/browser/sync/profile_sync_test_util.h b/chrome/browser/sync/profile_sync_test_util.h
index 6e9b77a..aa8584e 100644
--- a/chrome/browser/sync/profile_sync_test_util.h
+++ b/chrome/browser/sync/profile_sync_test_util.h
@@ -19,13 +19,11 @@
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/webdata/web_database.h"
-#include "chrome/browser/sync/abstract_profile_sync_service_test.h"
#include "chrome/browser/sync/glue/bookmark_change_processor.h"
#include "chrome/browser/sync/glue/bookmark_data_type_controller.h"
#include "chrome/browser/sync/glue/bookmark_model_associator.h"
#include "chrome/browser/sync/glue/change_processor.h"
#include "chrome/browser/sync/glue/data_type_manager_impl.h"
-#include "chrome/browser/sync/glue/sync_backend_host.h"
#include "chrome/browser/sync/profile_sync_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/unrecoverable_error_handler.h"
@@ -54,8 +52,6 @@ ACTION_P(InvokeTask, task) {
class TestModelAssociatorHelper {
public:
- TestModelAssociatorHelper(browser_sync::TestIdFactory* id_factory)
- : id_factory_(id_factory) {}
template <class ModelAssociatorImpl>
bool GetSyncIdForTaggedNode(ModelAssociatorImpl* associator,
const std::string& tag, int64* sync_id) {
@@ -65,32 +61,10 @@ class TestModelAssociatorHelper {
return false;
}
- browser_sync::SyncBackendHost::UserShareHandle share(
+ sync_api::WriteTransaction trans(
associator->sync_service()->backend()->GetUserShareHandle());
- bool root_exists = false;
- ModelType type = ModelAssociatorImpl::model_type();
- {
- sync_api::WriteTransaction trans(share);
- sync_api::ReadNode uber_root(&trans);
- uber_root.InitByRootLookup();
-
- // Look up the top level data type node.
- sync_api::ReadNode root_lookup(&trans);
- root_exists = root_lookup.InitByTagLookup(
- ProfileSyncServiceTestHelper::GetTagForType(type));
- }
-
- if (!root_exists) {
- bool created = ProfileSyncServiceTestHelper::CreateRoot(type,
- associator->sync_service(), id_factory_);
- if (!created)
- return false;
- }
-
- sync_api::WriteTransaction trans(share);
sync_api::ReadNode root(&trans);
- EXPECT_TRUE(root.InitByTagLookup(
- ProfileSyncServiceTestHelper::GetTagForType(type)));
+ root.InitByRootLookup();
// First, try to find a node with the title among the root's children.
// This will be the case if we are testing model persistence, and
@@ -124,8 +98,6 @@ class TestModelAssociatorHelper {
}
~TestModelAssociatorHelper() {}
- private:
- browser_sync::TestIdFactory* id_factory_;
};
class ProfileSyncServiceObserverMock : public ProfileSyncServiceObserver {