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

Unified Diff: components/reading_list/ios/reading_list_model_unittest.mm

Issue 2707043002: [Reading List iOS] Store distillation date and size. (Closed)
Patch Set: done Created 3 years, 10 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: components/reading_list/ios/reading_list_model_unittest.mm
diff --git a/components/reading_list/ios/reading_list_model_unittest.mm b/components/reading_list/ios/reading_list_model_unittest.mm
index bbdb4c91deed32143e2873dc42307cb21292b3b2..b8bc5c11970eabd1d583f505b8e1ec2c908fc045 100644
--- a/components/reading_list/ios/reading_list_model_unittest.mm
+++ b/components/reading_list/ios/reading_list_model_unittest.mm
@@ -383,8 +383,10 @@ TEST_F(ReadingListModelTest, SyncMergeEntry) {
reading_list::ADDED_VIA_CURRENT_APP);
const base::FilePath distilled_path("distilled/page.html");
const GURL distilled_url("http://example.com/distilled");
+ int64_t size = 50;
+ int64_t time = 100;
model_->SetEntryDistilledInfo(GURL("http://example.com"), distilled_path,
- distilled_url);
+ distilled_url, size, time);
const ReadingListEntry* local_entry =
model_->GetEntryByURL(GURL("http://example.com"));
int64_t local_update_time = local_entry->UpdateTime();
@@ -408,6 +410,8 @@ TEST_F(ReadingListModelTest, SyncMergeEntry) {
EXPECT_EQ(merged_entry->DistilledPath(),
base::FilePath("distilled/page.html"));
EXPECT_EQ(merged_entry->UpdateTime(), sync_update_time);
+ EXPECT_EQ(size, merged_entry->DistillationSize());
+ EXPECT_EQ(time, merged_entry->DistillationTime());
}
// Tests deleting entry.
@@ -624,12 +628,16 @@ TEST_F(ReadingListModelTest, UpdateDistilledInfo) {
const base::FilePath distilled_path("distilled/page.html");
const GURL distilled_url("http://example.com/distilled");
+ int64_t size = 50;
+ int64_t time = 100;
model_->SetEntryDistilledInfo(GURL("http://example.com"), distilled_path,
- distilled_url);
+ distilled_url, size, time);
AssertObserverCount(0, 0, 0, 0, 0, 0, 0, 1, 1);
EXPECT_EQ(ReadingListEntry::PROCESSED, entry.DistilledState());
EXPECT_EQ(distilled_path, entry.DistilledPath());
EXPECT_EQ(distilled_url, entry.DistilledURL());
+ EXPECT_EQ(size, entry.DistillationSize());
+ EXPECT_EQ(time, entry.DistillationTime());
}
// Tests setting title on read entry.
@@ -668,12 +676,16 @@ TEST_F(ReadingListModelTest, UpdateReadDistilledInfo) {
const base::FilePath distilled_path("distilled/page.html");
const GURL distilled_url("http://example.com/distilled");
+ int64_t size = 50;
+ int64_t time = 100;
model_->SetEntryDistilledInfo(GURL("http://example.com"), distilled_path,
- distilled_url);
+ distilled_url, size, time);
AssertObserverCount(0, 0, 0, 0, 0, 0, 0, 1, 1);
EXPECT_EQ(ReadingListEntry::PROCESSED, entry->DistilledState());
EXPECT_EQ(distilled_path, entry->DistilledPath());
EXPECT_EQ(distilled_url, entry->DistilledURL());
+ EXPECT_EQ(size, entry->DistillationSize());
+ EXPECT_EQ(time, entry->DistillationTime());
}
// Tests that ReadingListModel calls CallbackModelBeingDeleted when destroyed.

Powered by Google App Engine
This is Rietveld 408576698