Index: chrome/browser/sync/profile_sync_service_typed_url_unittest.cc |
diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc |
index b94dbc9c66bb32eabdfbffde89b4f41c9ec00850..5d47622a981136ec1da21eddcd3cabe51a095a9e 100644 |
--- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc |
+++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc |
@@ -1091,3 +1091,31 @@ TEST_F(ProfileSyncServiceTypedUrlTest, IgnoreLocalhostURL) { |
ASSERT_EQ(1U, new_sync_entries.size()); |
EXPECT_TRUE(URLsEqual(updated_url_entry, new_sync_entries[0])); |
} |
+ |
+TEST_F(ProfileSyncServiceTypedUrlTest, IgnoreModificationWithoutValidVisit) { |
+ EXPECT_CALL((*history_backend_.get()), GetAllTypedURLs(_)). |
+ WillRepeatedly(Return(true)); |
+ EXPECT_CALL((*history_backend_.get()), GetMostRecentVisitsForURL(_, _, _)). |
+ WillRepeatedly(Return(true)); |
+ |
+ CreateRootHelper create_root(this, syncer::TYPED_URLS); |
+ StartSyncService(create_root.callback()); |
+ |
+ history::VisitVector updated_visits; |
+ history::URLRow updated_url_entry(MakeTypedUrlEntry("http://yey.com", |
+ "yey", 20, 0, false, |
+ &updated_visits)); |
+ history::URLsModifiedDetails details; |
+ details.changed_urls.push_back(updated_url_entry); |
+ scoped_refptr<ThreadNotifier> notifier( |
+ new ThreadNotifier(history_thread_.get())); |
+ notifier->Notify(chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, |
+ content::Source<Profile>(profile_), |
+ content::Details<history::URLsModifiedDetails>(&details)); |
+ |
+ history::URLRows new_sync_entries; |
+ GetTypedUrlsFromSyncDB(&new_sync_entries); |
+ |
+ // The change should be ignored. |
+ ASSERT_EQ(0U, new_sync_entries.size()); |
+} |