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

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

Issue 2338133010: Add a TimeUntilNextTry to reading list (Closed)
Patch Set: Fix 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_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 215c3fdd32df3c9a0d0ff76facae81c995ee8fd4..4deef7786ecea0d5d624fee58f881727ed781bf6 100644
--- a/ios/chrome/browser/reading_list/reading_list_entry_unittest.cc
+++ b/ios/chrome/browser/reading_list/reading_list_entry_unittest.cc
@@ -50,3 +50,23 @@ TEST(ReadingListEntry, DistilledState) {
e.SetDistilledURL(distilled_url);
EXPECT_EQ(ReadingListEntry::PROCESSED, e.DistilledState());
}
+
+// Tests the auto incrementation of the failed distillation counter.
+TEST(ReadingListEntry, FailedDistillationCounter) {
+ ReadingListEntry e(GURL("http://example.com"), "bar");
+
+ ASSERT_EQ(0, e.FailedDistillationCounter());
+
+ e.SetDistilledState(ReadingListEntry::ERROR);
+ EXPECT_EQ(1, e.FailedDistillationCounter());
+
+ e.SetDistilledState(ReadingListEntry::WILL_RETRY);
noyau (Ping after 24h) 2016/09/16 14:25:13 Is there any case where a transition from ERROR to
gambard 2016/09/19 09:08:09 Potentially, if you launch two download before the
+ EXPECT_EQ(1, e.FailedDistillationCounter());
+
+ e.SetDistilledState(ReadingListEntry::PROCESSING);
+ e.SetDistilledState(ReadingListEntry::WILL_RETRY);
+ EXPECT_EQ(2, e.FailedDistillationCounter());
+
+ e.SetDistilledState(ReadingListEntry::ERROR);
+ EXPECT_EQ(2, e.FailedDistillationCounter());
+}

Powered by Google App Engine
This is Rietveld 408576698