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 "components/reading_list/reading_list_entry.h" | 5 #include "components/reading_list/ios/reading_list_entry.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
9 #include "components/reading_list/proto/reading_list.pb.h" | 9 #include "components/reading_list/ios/proto/reading_list.pb.h" |
10 #include "components/sync/protocol/reading_list_specifics.pb.h" | 10 #include "components/sync/protocol/reading_list_specifics.pb.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 const int kFirstBackoff = 10; | 14 const int kFirstBackoff = 10; |
15 const int kSecondBackoff = 10; | 15 const int kSecondBackoff = 10; |
16 const int kThirdBackoff = 60; | 16 const int kThirdBackoff = 60; |
17 const int kFourthBackoff = 120; | 17 const int kFourthBackoff = 120; |
18 const int kFifthBackoff = 120; | 18 const int kFifthBackoff = 120; |
19 } // namespace | 19 } // namespace |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 EXPECT_EQ(sync_entry.URL().spec(), "http://example2.com/"); | 318 EXPECT_EQ(sync_entry.URL().spec(), "http://example2.com/"); |
319 EXPECT_EQ(sync_entry.Title(), "title2"); | 319 EXPECT_EQ(sync_entry.Title(), "title2"); |
320 EXPECT_EQ(sync_entry.UpdateTime(), sync_update_time_us); | 320 EXPECT_EQ(sync_entry.UpdateTime(), sync_update_time_us); |
321 EXPECT_EQ(sync_entry.FailedDownloadCounter(), 0); | 321 EXPECT_EQ(sync_entry.FailedDownloadCounter(), 0); |
322 EXPECT_EQ(sync_entry.DistilledState(), ReadingListEntry::PROCESSED); | 322 EXPECT_EQ(sync_entry.DistilledState(), ReadingListEntry::PROCESSED); |
323 EXPECT_EQ(sync_entry.DistilledPath().value(), "distilled/page.html"); | 323 EXPECT_EQ(sync_entry.DistilledPath().value(), "distilled/page.html"); |
324 base::Time sync_next_call = base::Time::Now() + sync_entry.TimeUntilNextTry(); | 324 base::Time sync_next_call = base::Time::Now() + sync_entry.TimeUntilNextTry(); |
325 base::TimeDelta delta = next_call - sync_next_call; | 325 base::TimeDelta delta = next_call - sync_next_call; |
326 EXPECT_NEAR(delta.InMillisecondsRoundedUp(), 0, 10); | 326 EXPECT_NEAR(delta.InMillisecondsRoundedUp(), 0, 10); |
327 } | 327 } |
OLD | NEW |