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

Unified Diff: components/reading_list/ios/reading_list_entry_unittest.cc

Issue 2557443003: Add Unseen state to Reading List Entry (Closed)
Patch Set: feedback Created 4 years 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: components/reading_list/ios/reading_list_entry_unittest.cc
diff --git a/components/reading_list/ios/reading_list_entry_unittest.cc b/components/reading_list/ios/reading_list_entry_unittest.cc
index 1833097227cd9ce069b5db933365b91b93aa7fd5..61f486ca83af0d6dfdbc8c29eb58ec0160935675 100644
--- a/components/reading_list/ios/reading_list_entry_unittest.cc
+++ b/components/reading_list/ios/reading_list_entry_unittest.cc
@@ -44,6 +44,18 @@ TEST(ReadingListEntry, MovesAreEquals) {
EXPECT_EQ(e3.Title(), e2.Title());
}
+TEST(ReadingListEntry, ReadState) {
+ ReadingListEntry e(GURL("http://example.com"), "bar");
+ EXPECT_FALSE(e.HasBeenSeen());
+ EXPECT_FALSE(e.IsRead());
+ e.SetRead(false);
+ EXPECT_TRUE(e.HasBeenSeen());
+ EXPECT_FALSE(e.IsRead());
+ e.SetRead(true);
+ EXPECT_TRUE(e.HasBeenSeen());
+ EXPECT_TRUE(e.IsRead());
+}
+
TEST(ReadingListEntry, DistilledPathAndURL) {
ReadingListEntry e(GURL("http://example.com"), "bar");
@@ -198,7 +210,7 @@ TEST(ReadingListEntry, AsReadingListSpecifics) {
EXPECT_EQ(pb_entry->title(), "bar");
EXPECT_EQ(pb_entry->creation_time_us(), creation_time_us);
EXPECT_EQ(pb_entry->update_time_us(), entry.UpdateTime());
- EXPECT_EQ(pb_entry->status(), sync_pb::ReadingListSpecifics::UNREAD);
+ EXPECT_EQ(pb_entry->status(), sync_pb::ReadingListSpecifics::UNSEEN);
entry.SetRead(true);
EXPECT_NE(entry.UpdateTime(), creation_time_us);
@@ -242,7 +254,7 @@ TEST(ReadingListEntry, AsReadingListLocal) {
EXPECT_EQ(pb_entry->title(), "bar");
EXPECT_EQ(pb_entry->creation_time_us(), creation_time_us);
EXPECT_EQ(pb_entry->update_time_us(), entry.UpdateTime());
- EXPECT_EQ(pb_entry->status(), reading_list::ReadingListLocal::UNREAD);
+ EXPECT_EQ(pb_entry->status(), reading_list::ReadingListLocal::UNSEEN);
EXPECT_EQ(pb_entry->distillation_state(),
reading_list::ReadingListLocal::WAITING);
EXPECT_EQ(pb_entry->distilled_path(), "");
« no previous file with comments | « components/reading_list/ios/reading_list_entry.cc ('k') | components/reading_list/ios/reading_list_store_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698