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

Unified Diff: sync/internal_api/test/test_user_share.cc

Issue 11533008: Use delete journal to remove bookmarks that are already deleted in sync model (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « sync/internal_api/public/test/test_user_share.h ('k') | sync/sync.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..94346177045933855ab19ab9a6e150a6fc92f697 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"
@@ -39,6 +40,21 @@ 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();
+
+ // Ensure the scoped_ptr doesn't delete the memory we don't own.
+ ignore_result(user_share_->directory.release());
+ user_share_.reset(new UserShare());
+ dir_maker_->SetUpWith(saved_store);
+ user_share_->directory.reset(dir_maker_->directory());
+ return true;
+}
+
UserShare* TestUserShare::user_share() {
return user_share_.get();
}
@@ -59,4 +75,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
« no previous file with comments | « sync/internal_api/public/test/test_user_share.h ('k') | sync/sync.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698