Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/chrome/browser/reading_list/reading_list_entry.h" | 5 #include "ios/chrome/browser/reading_list/reading_list_entry.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 TEST(ReadingListEntry, CompareIgnoreTitle) { | 9 TEST(ReadingListEntry, CompareIgnoreTitle) { |
| 10 const ReadingListEntry e1(GURL("http://example.com"), "bar"); | 10 const ReadingListEntry e1(GURL("http://example.com"), "bar"); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 | 43 |
| 44 EXPECT_EQ(ReadingListEntry::WAITING, e.DistilledState()); | 44 EXPECT_EQ(ReadingListEntry::WAITING, e.DistilledState()); |
| 45 | 45 |
| 46 e.SetDistilledState(ReadingListEntry::ERROR); | 46 e.SetDistilledState(ReadingListEntry::ERROR); |
| 47 EXPECT_EQ(ReadingListEntry::ERROR, e.DistilledState()); | 47 EXPECT_EQ(ReadingListEntry::ERROR, e.DistilledState()); |
| 48 | 48 |
| 49 const GURL distilled_url("http://distilled.example.com"); | 49 const GURL distilled_url("http://distilled.example.com"); |
| 50 e.SetDistilledURL(distilled_url); | 50 e.SetDistilledURL(distilled_url); |
| 51 EXPECT_EQ(ReadingListEntry::PROCESSED, e.DistilledState()); | 51 EXPECT_EQ(ReadingListEntry::PROCESSED, e.DistilledState()); |
| 52 } | 52 } |
| 53 | |
| 54 // Tests the auto incrementation of the failed distillation counter. | |
| 55 TEST(ReadingListEntry, FailedDistillationCounter) { | |
| 56 ReadingListEntry e(GURL("http://example.com"), "bar"); | |
| 57 | |
| 58 ASSERT_EQ(0, e.FailedDistillationCounter()); | |
| 59 | |
| 60 e.SetDistilledState(ReadingListEntry::ERROR); | |
| 61 EXPECT_EQ(1, e.FailedDistillationCounter()); | |
| 62 | |
| 63 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
| |
| 64 EXPECT_EQ(1, e.FailedDistillationCounter()); | |
| 65 | |
| 66 e.SetDistilledState(ReadingListEntry::PROCESSING); | |
| 67 e.SetDistilledState(ReadingListEntry::WILL_RETRY); | |
| 68 EXPECT_EQ(2, e.FailedDistillationCounter()); | |
| 69 | |
| 70 e.SetDistilledState(ReadingListEntry::ERROR); | |
| 71 EXPECT_EQ(2, e.FailedDistillationCounter()); | |
| 72 } | |
| OLD | NEW |