| Index: sync/internal_api/test/test_user_share.cc
|
| diff --git a/sync/internal_api/test/test_user_share.cc b/sync/internal_api/test/test_user_share.cc
|
| index 2057eacff8fa1bfab94e08567793fd84b712f99b..b29c39c65bdfe9d6072b8517399fec5082a9477c 100644
|
| --- a/sync/internal_api/test/test_user_share.cc
|
| +++ b/sync/internal_api/test/test_user_share.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/compiler_specific.h"
|
| #include "sync/syncable/directory.h"
|
| #include "sync/syncable/mutable_entry.h"
|
| +#include "sync/syncable/syncable_read_transaction.h"
|
| #include "sync/syncable/syncable_write_transaction.h"
|
| #include "sync/test/engine/test_directory_setter_upper.h"
|
| #include "sync/test/engine/test_id_factory.h"
|
| @@ -24,7 +25,7 @@ TestUserShare::~TestUserShare() {
|
|
|
| void TestUserShare::SetUp() {
|
| user_share_.reset(new UserShare());
|
| - dir_maker_->SetUp();
|
| + dir_maker_->SetUp(NULL);
|
|
|
| // The pointer is owned by dir_maker_, we should not be storing it in a
|
| // scoped_ptr. We must be careful to ensure the scoped_ptr never deletes it.
|
| @@ -39,6 +40,18 @@ void TestUserShare::TearDown() {
|
| dir_maker_->TearDown();
|
| }
|
|
|
| +bool TestUserShare::Reload() {
|
| + if (!user_share_->directory->SaveChanges())
|
| + return false;
|
| +
|
| + syncer::syncable::DirectoryBackingStore* saved_store =
|
| + user_share_->directory->store_.release();
|
| + user_share_.reset(new UserShare());
|
| + dir_maker_->SetUp(saved_store);
|
| + user_share_->directory.reset(dir_maker_->directory());
|
| + return true;
|
| +}
|
| +
|
| UserShare* TestUserShare::user_share() {
|
| return user_share_.get();
|
| }
|
| @@ -59,4 +72,9 @@ bool TestUserShare::CreateRoot(ModelType model_type, UserShare* user_share) {
|
| return true;
|
| }
|
|
|
| +size_t TestUserShare::GetDeleteJournalSize() const {
|
| + syncable::ReadTransaction trans(FROM_HERE, user_share_->directory.get());
|
| + return user_share_->directory->delete_journal()->GetDeleteJournalSize(&trans);
|
| +}
|
| +
|
| } // namespace syncer
|
|
|