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

Unified Diff: chrome/browser/history/history_backend_unittest.cc

Issue 1011943003: Don't treat back/forwards as typed transitions in history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorder conditions Created 5 years, 9 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 | « no previous file | components/history/core/browser/expire_history_backend.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend_unittest.cc
diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc
index 9442ae0a8ba61f80a3b5231236b10655deeb4af0..774716d3bc34031c53f6990d882006f42a612a76 100644
--- a/chrome/browser/history/history_backend_unittest.cc
+++ b/chrome/browser/history/history_backend_unittest.cc
@@ -1202,6 +1202,34 @@ TEST_F(HistoryBackendTest, StripUsernamePasswordTest) {
ASSERT_EQ(1U, visits.size());
}
+TEST_F(HistoryBackendTest, AddPageVisitBackForward) {
+ ASSERT_TRUE(backend_.get());
+
+ GURL url("http://www.google.com");
+
+ // Clear all history.
+ backend_->DeleteAllHistory();
+
+ // Visit the url after typing it.
+ backend_->AddPageVisit(url, base::Time::Now(), 0,
Peter Kasting 2015/03/24 22:09:59 I would explicitly check that typed and visit coun
Charlie Reis 2015/03/27 17:03:14 Done.
+ ui::PAGE_TRANSITION_TYPED,
+ history::SOURCE_BROWSED);
+
+ // Visit the url again via back/forward.
+ backend_->AddPageVisit(url, base::Time::Now(), 0,
+ ui::PageTransitionFromInt(
+ ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FORWARD_BACK),
+ history::SOURCE_BROWSED);
+
+ // Ensure the typed count is only 1 but the visit count is 2.
+ VisitVector visits;
+ URLRow row;
+ URLID id = backend_->db()->GetRowForURL(url, &row);
+ ASSERT_TRUE(backend_->db()->GetVisitsForURL(id, &visits));
+ EXPECT_EQ(1, row.typed_count());
+ EXPECT_EQ(2, row.visit_count());
+}
+
TEST_F(HistoryBackendTest, AddPageVisitSource) {
ASSERT_TRUE(backend_.get());
« no previous file with comments | « no previous file | components/history/core/browser/expire_history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698