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

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

Issue 2362063004: Find reading list entry state in model from url (Closed)
Patch Set: Addressing comments + tests Created 4 years, 3 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 9423250538f4a221e1b36de506fbd18afe3fbb4d..edc4c99d919ee5379c2bef34f9d54afdec2a44ab 100644
--- a/ios/chrome/browser/reading_list/reading_list_model_unittest.cc
+++ b/ios/chrome/browser/reading_list/reading_list_model_unittest.cc
@@ -334,4 +334,21 @@ TEST_F(ReadingListModelTest, CallbackEntryURLNotPresent) {
EXPECT_FALSE(CallbackCalled());
}
+TEST_F(ReadingListModelTest, EntryStateByURL) {
+ // Setup.
+ const GURL not_present("http://not.present");
+ const GURL unread("http://foo.bar");
+ model_->AddEntry(unread, "sample");
+ const GURL read("http://example.com");
+ model_->AddEntry(read, "sample");
+ model_->MarkReadByURL(read);
+
+ // Action/Test.
+ EXPECT_EQ(ReadingListModel::EntryState::READ, model_->EntryStateByURL(read));
+ EXPECT_EQ(ReadingListModel::EntryState::UNREAD,
+ model_->EntryStateByURL(unread));
+ EXPECT_EQ(ReadingListModel::EntryState::NOT_PRESENT,
+ model_->EntryStateByURL(not_present));
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698