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

Unified Diff: ios/chrome/browser/reading_list/reading_list_model_unittest.cc

Issue 2436743002: Add GetEntryFromURL method to the ReadingListModel. (Closed)
Patch Set: 2 Created 4 years, 2 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
Index: ios/chrome/browser/reading_list/reading_list_model_unittest.cc
diff --git a/ios/chrome/browser/reading_list/reading_list_model_unittest.cc b/ios/chrome/browser/reading_list/reading_list_model_unittest.cc
index 873b3304700e82d573d009913152ebbfb98144f2..81f582bcd2279fe002947c7b33c2a0bcaef02f8c 100644
--- a/ios/chrome/browser/reading_list/reading_list_model_unittest.cc
+++ b/ios/chrome/browser/reading_list/reading_list_model_unittest.cc
@@ -171,6 +171,20 @@ TEST_F(ReadingListModelTest, ReadEntry) {
EXPECT_EQ("sample", other_entry.Title());
}
+TEST_F(ReadingListModelTest, EntryFromURL) {
+ GURL url1("http://example.com");
+ GURL url2("http://example2.com");
+ std::string entry1_title = "foo bar qux";
+ model_->AddEntry(url1, entry1_title);
+
+ const ReadingListEntry* entry1 = model_->GetEntryFromURL(url1);
+ EXPECT_NE(nullptr, entry1)
Olivier 2016/10/25 13:11:26 ;
jif-google 2016/10/25 13:51:28 Done.
+ EXPECT_EQ(entry1_title, entry1->Title());
Olivier 2016/10/25 13:11:26 mark read, then retest?
jif-google 2016/10/25 13:51:28 Done.
+
+ const ReadingListEntry* entry2 = model_->GetEntryFromURL(url2);
+ EXPECT_EQ(nullptr, entry2);
+}
+
TEST_F(ReadingListModelTest, UnreadEntry) {
// Setup.
model_->AddEntry(GURL("http://example.com"), "sample");

Powered by Google App Engine
This is Rietveld 408576698