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

Unified Diff: chrome/browser/sync/profile_sync_service_bookmark_unittest.cc

Issue 10696163: [Sync] Check if bookmark exists before attempting favicon update (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Created 8 years, 5 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/sync/glue/bookmark_change_processor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
index 97ab793062bbceb3d1e87c6254ece19ecc700c6f..9bc6a37dc4f0989776cafdfb1f7504a32be59989 100644
--- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
@@ -543,6 +543,10 @@ class ProfileSyncServiceBookmarkTest : public testing::Test {
model_->bookmark_bar_node()->id());
}
+ int64 GetSyncIdFromChromeNode(const BookmarkNode* node) {
+ return model_associator_->GetSyncIdFromChromeId(node->id());
+ }
+
private:
// Used by both |ui_thread_| and |file_thread_|.
MessageLoop message_loop_;
@@ -1495,6 +1499,27 @@ TEST_F(ProfileSyncServiceBookmarkTest, AssociationState) {
model_->RemoveObserver(&observer);
}
+TEST_F(ProfileSyncServiceBookmarkTest, FaviconUpdateToDeletedBookmark) {
+ LoadBookmarkModel(DELETE_EXISTING_STORAGE, DONT_SAVE_TO_STORAGE);
+ const BookmarkNode* bnode = model_->AddURL(
+ model_->bookmark_bar_node(),
+ 0,
+ ASCIIToUTF16("Internets #1 Pies Site"),
+ GURL("http://www.easypie.com/"));
+ StartSync();
+
+ {
+ syncer::WriteTransaction trans(FROM_HERE, test_user_share_.user_share());
+ FakeServerChange dels(&trans);
+ dels.Delete(GetSyncIdFromChromeNode(bnode));
+ dels.ApplyPendingChanges(change_processor_.get());
+ }
+
+ // Now update the favicon locally. This should have no effect, but should
+ // not result in an error either.
+ change_processor_->BookmarkNodeFaviconChanged(model_, bnode);
+}
+
} // namespace
} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/glue/bookmark_change_processor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698