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

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

Issue 2525663002: Refactor Reading List Model to use URL as key. (Closed)
Patch Set: format Created 4 years, 1 month 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_entry_unittest.cc
diff --git a/ios/chrome/browser/reading_list/reading_list_entry_unittest.cc b/ios/chrome/browser/reading_list/reading_list_entry_unittest.cc
index ff756d3a1adaf559c4378a83cd2abac3de152414..f44573dad3f03a380093ca21d9207effebdf36cf 100644
--- a/ios/chrome/browser/reading_list/reading_list_entry_unittest.cc
+++ b/ios/chrome/browser/reading_list/reading_list_entry_unittest.cc
@@ -193,7 +193,7 @@ TEST(ReadingListEntry, AsReadingListSpecifics) {
int64_t creation_time_us = entry.UpdateTime();
std::unique_ptr<sync_pb::ReadingListSpecifics> pb_entry(
- entry.AsReadingListSpecifics(false));
+ entry.AsReadingListSpecifics());
EXPECT_EQ(pb_entry->entry_id(), "http://example.com/");
EXPECT_EQ(pb_entry->url(), "http://example.com/");
EXPECT_EQ(pb_entry->title(), "bar");
@@ -201,10 +201,10 @@ TEST(ReadingListEntry, AsReadingListSpecifics) {
EXPECT_EQ(pb_entry->update_time_us(), entry.UpdateTime());
EXPECT_EQ(pb_entry->status(), sync_pb::ReadingListSpecifics::UNREAD);
- entry.MarkEntryUpdated();
+ entry.SetRead(true);
EXPECT_NE(entry.UpdateTime(), creation_time_us);
std::unique_ptr<sync_pb::ReadingListSpecifics> updated_pb_entry(
- entry.AsReadingListSpecifics(true));
+ entry.AsReadingListSpecifics());
EXPECT_EQ(updated_pb_entry->creation_time_us(), creation_time_us);
EXPECT_EQ(updated_pb_entry->update_time_us(), entry.UpdateTime());
EXPECT_EQ(updated_pb_entry->status(), sync_pb::ReadingListSpecifics::READ);
@@ -237,7 +237,7 @@ TEST(ReadingListEntry, AsReadingListLocal) {
int64_t creation_time_us = entry.UpdateTime();
std::unique_ptr<reading_list::ReadingListLocal> pb_entry(
- entry.AsReadingListLocal(false));
+ entry.AsReadingListLocal());
EXPECT_EQ(pb_entry->entry_id(), "http://example.com/");
EXPECT_EQ(pb_entry->url(), "http://example.com/");
EXPECT_EQ(pb_entry->title(), "bar");
@@ -252,16 +252,17 @@ TEST(ReadingListEntry, AsReadingListLocal) {
entry.SetDistilledState(ReadingListEntry::WILL_RETRY);
std::unique_ptr<reading_list::ReadingListLocal> will_retry_pb_entry(
- entry.AsReadingListLocal(true));
+ entry.AsReadingListLocal());
EXPECT_EQ(will_retry_pb_entry->distillation_state(),
reading_list::ReadingListLocal::WILL_RETRY);
EXPECT_EQ(will_retry_pb_entry->failed_download_counter(), 1);
entry.SetDistilledPath(base::FilePath("distilled/page.html"));
+ entry.SetRead(true);
entry.MarkEntryUpdated();
EXPECT_NE(entry.UpdateTime(), creation_time_us);
std::unique_ptr<reading_list::ReadingListLocal> distilled_pb_entry(
- entry.AsReadingListLocal(true));
+ entry.AsReadingListLocal());
EXPECT_EQ(distilled_pb_entry->creation_time_us(), creation_time_us);
EXPECT_EQ(distilled_pb_entry->update_time_us(), entry.UpdateTime());
EXPECT_NE(distilled_pb_entry->backoff(), "");
@@ -279,7 +280,7 @@ TEST(ReadingListEntry, FromReadingListLocal) {
base::Time next_call = base::Time::Now() + entry.TimeUntilNextTry();
std::unique_ptr<reading_list::ReadingListLocal> pb_entry(
- entry.AsReadingListLocal(false));
+ entry.AsReadingListLocal());
pb_entry->set_entry_id("http://example.com/");
pb_entry->set_url("http://example.com/");

Powered by Google App Engine
This is Rietveld 408576698