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

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

Issue 300843004: Don't sync typed URL modification that doesn't have valid visits, which could (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tst Created 6 years, 7 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/typed_url_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_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());
+}
« no previous file with comments | « chrome/browser/sync/glue/typed_url_model_associator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698