Chromium Code Reviews| 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()); |
| +} |