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

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

Issue 337037: Make some improvements to sync model associator:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/model_associator.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_unittest.cc
===================================================================
--- chrome/browser/sync/profile_sync_service_unittest.cc (revision 30114)
+++ chrome/browser/sync/profile_sync_service_unittest.cc (working copy)
@@ -1237,6 +1237,26 @@
ExpectModelMatch();
}
+// Tests that when persisted model assocations are used, things work fine.
+TEST_F(ProfileSyncServiceTestWithData, ModelAssociationInvalidPersistence) {
+ LoadBookmarkModel(DELETE_EXISTING_STORAGE, DONT_SAVE_TO_STORAGE);
+ WriteTestDataToBookmarkModel();
+ StartSyncService();
+ ExpectModelMatch();
+ // Force the sync service to shut down and write itself to disk.
+ StopSyncService(SAVE_TO_STORAGE);
+ // Change the bookmark model before restarting sync service to simulate
+ // the situation where bookmark model is different from sync model and
+ // make sure model associator correctly rebuilds associations.
+ const BookmarkNode* bookmark_bar_node = model_->GetBookmarkBarNode();
+ model_->AddURL(bookmark_bar_node, 0, L"xtra", GURL("http://www.xtra.com"));
+ // Now restart the sync service. This time it will try to use the persistent
+ // associations and realize that they are invalid and hence will rebuild
+ // associations.
+ StartSyncService();
+ ExpectModelMatch();
+}
+
TEST_F(ProfileSyncServiceTestWithData, SortChildren) {
LoadBookmarkModel(DELETE_EXISTING_STORAGE, DONT_SAVE_TO_STORAGE);
StartSyncService();
« no previous file with comments | « chrome/browser/sync/glue/model_associator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698