Chromium Code Reviews| 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()); |