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

Unified Diff: components/history/core/browser/top_sites_impl_unittest.cc

Issue 1133093002: [iOS] Reduce UpdateDelay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/history/core/browser/top_sites_impl_unittest.cc
diff --git a/components/history/core/browser/top_sites_impl_unittest.cc b/components/history/core/browser/top_sites_impl_unittest.cc
index f57d8144614f8d8f44754a8e6730fd895a624f9b..bef691cd48894b0ff9461c02b8902cf272346a11 100644
--- a/components/history/core/browser/top_sites_impl_unittest.cc
+++ b/components/history/core/browser/top_sites_impl_unittest.cc
@@ -963,8 +963,20 @@ TEST_F(TopSitesImplTest, DeleteNotifications) {
// Makes sure GetUpdateDelay is updated appropriately.
TEST_F(TopSitesImplTest, GetUpdateDelay) {
+#if defined(OS_IOS)
+ const int64 kExpectedUpdateDelayInSecondEmpty = 30;
+ const int64 kExpectedUpdateDelayInSecond0Changed = 5;
+ const int64 kExpectedUpdateDelayInSecond3Changed = 5;
+ const int64 kExpectedUpdateDelayInSecond20Changed = 1;
+#else
+ const int64 kExpectedUpdateDelayInSecondEmpty = 30;
+ const int64 kExpectedUpdateDelayInSecond0Changed = 60;
+ const int64 kExpectedUpdateDelayInSecond3Changed = 52;
+ const int64 kExpectedUpdateDelayInSecond20Changed = 1;
+#endif
+
SetLastNumUrlsChanged(0);
- EXPECT_EQ(30, GetUpdateDelay().InSeconds());
+ EXPECT_EQ(kExpectedUpdateDelayInSecondEmpty, GetUpdateDelay().InSeconds());
MostVisitedURLList url_list;
url_list.resize(20);
@@ -976,13 +988,14 @@ TEST_F(TopSitesImplTest, GetUpdateDelay) {
SetTopSites(url_list);
EXPECT_EQ(20u, last_num_urls_changed());
SetLastNumUrlsChanged(0);
- EXPECT_EQ(60, GetUpdateDelay().InMinutes());
+ EXPECT_EQ(kExpectedUpdateDelayInSecond0Changed, GetUpdateDelay().InMinutes());
SetLastNumUrlsChanged(3);
- EXPECT_EQ(52, GetUpdateDelay().InMinutes());
+ EXPECT_EQ(kExpectedUpdateDelayInSecond3Changed, GetUpdateDelay().InMinutes());
SetLastNumUrlsChanged(20);
- EXPECT_EQ(1, GetUpdateDelay().InMinutes());
+ EXPECT_EQ(kExpectedUpdateDelayInSecond20Changed,
+ GetUpdateDelay().InMinutes());
}
// Verifies that callbacks are notified correctly if requested before top sites

Powered by Google App Engine
This is Rietveld 408576698