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

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

Issue 323043004: Make NOTIFICATION_HISTORY_URLS_MODIFIED fired consistently for both typed and non-typed URLs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/history/history_backend.cc ('k') | no next file » | 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 e21efaae74821441c3189f4b80c8f4aab57e99c6..ec57670f6df704071290952d1a068f6bccce738f 100644
--- a/chrome/browser/history/history_backend_unittest.cc
+++ b/chrome/browser/history/history_backend_unittest.cc
@@ -944,20 +944,28 @@ TEST_F(HistoryBackendTest, AddPagesWithDetails) {
EXPECT_NE(0, backend_->db_->GetRowForURL(row3.url(), &stored_row3));
EXPECT_EQ(0, backend_->db_->GetRowForURL(row4.url(), &stored_row4));
- // Ensure that a notification was fired, and further verify that the IDs in
- // the notification are set to those that are in effect in the main database.
- // The InMemoryHistoryBackend relies on this for caching.
+ // Ensure that a notification was fired for both typed and non-typed URLs.
+ // Further verify that the IDs in the notification are set to those that are
+ // in effect in the main database. The InMemoryHistoryBackend relies on this
+ // for caching.
ASSERT_EQ(1u, broadcasted_notifications().size());
ASSERT_EQ(chrome::NOTIFICATION_HISTORY_URLS_MODIFIED,
broadcasted_notifications()[0].first);
const URLsModifiedDetails* details = static_cast<const URLsModifiedDetails*>(
broadcasted_notifications()[0].second);
- EXPECT_EQ(2u, details->changed_urls.size());
+ EXPECT_EQ(3u, details->changed_urls.size());
- URLRows::const_iterator it_row2 = std::find_if(
+ URLRows::const_iterator it_row1 = std::find_if(
details->changed_urls.begin(),
details->changed_urls.end(),
- history::URLRow::URLRowHasURL(row2.url()));
+ history::URLRow::URLRowHasURL(row1.url()));
+ ASSERT_NE(details->changed_urls.end(), it_row1);
+ EXPECT_EQ(stored_row1.id(), it_row1->id());
+
+ URLRows::const_iterator it_row2 = std::find_if(
+ details->changed_urls.begin(),
+ details->changed_urls.end(),
+ history::URLRow::URLRowHasURL(row2.url()));
ASSERT_NE(details->changed_urls.end(), it_row2);
EXPECT_EQ(stored_row2.id(), it_row2->id());
« no previous file with comments | « chrome/browser/history/history_backend.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698