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

Unified Diff: chrome/browser/sync/glue/typed_url_model_associator_unittest.cc

Issue 7747040: Now gracefully deals with TypedURLs with no typed visits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/glue/typed_url_model_associator_unittest.cc
diff --git a/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc b/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc
index 6e03a7e05a48672a7391c0b9af642fce9252d71e..9f27385aa503b21bd29b27078162153a264d183c 100644
--- a/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc
+++ b/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc
@@ -311,3 +311,19 @@ TEST_F(TypedUrlModelAssociatorTest, TooManyTypedVisits) {
typed_url.visit_transitions(i)));
}
}
+
+TEST_F(TypedUrlModelAssociatorTest, NoTypedVisits) {
+ history::VisitVector visits;
+ history::URLRow url(MakeTypedUrlRow("http://pie.com/", "pie",
+ 1, 1000, false, &visits));
+ sync_pb::TypedUrlSpecifics typed_url;
+ TypedUrlModelAssociator::WriteToTypedUrlSpecifics(url, visits, &typed_url);
+ // URLs with no typed URL visits should be translated to a URL with one
+ // reload visit.
+ EXPECT_EQ(1, typed_url.visits_size());
+ EXPECT_EQ(typed_url.visit_transitions_size(), typed_url.visits_size());
+ // First two typed visits should be skipped.
+ EXPECT_EQ(1000, typed_url.visits(0));
+ EXPECT_EQ(PageTransition::RELOAD, static_cast<PageTransition::Type>(
+ typed_url.visit_transitions(0)));
+}
« 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