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

Unified Diff: components/offline_pages/core/background/request_coordinator_unittest.cc

Issue 2755753005: [Offline Pages] Add Android version check for timeout in offliner policy. (Closed)
Patch Set: fix test Created 3 years, 9 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
« no previous file with comments | « components/offline_pages/core/background/pick_request_task_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/core/background/request_coordinator_unittest.cc
diff --git a/components/offline_pages/core/background/request_coordinator_unittest.cc b/components/offline_pages/core/background/request_coordinator_unittest.cc
index bf36ebc9be534f4797cb5fca127402cce60d3cb1..5e1b1dca3cf3046a76d3378467824ff533015eee 100644
--- a/components/offline_pages/core/background/request_coordinator_unittest.cc
+++ b/components/offline_pages/core/background/request_coordinator_unittest.cc
@@ -46,7 +46,6 @@ const ClientId kClientId1(kClientNamespace, kId1);
const ClientId kClientId2(kClientNamespace, kId2);
const int kRequestId1(1);
const int kRequestId2(2);
-const long kTestTimeBudgetSeconds = 200;
const int kBatteryPercentageHigh = 75;
const int kMaxCompletedTries = 3;
const bool kPowerRequired = true;
@@ -1229,7 +1228,11 @@ TEST_F(RequestCoordinatorTest, TimeBudgetExceeded) {
// Advance the mock clock far enough to exceed our time budget.
// The first request will time out, and because we are over time budget,
// the second request will not be started.
- AdvanceClockBy(base::TimeDelta::FromSeconds(kTestTimeBudgetSeconds));
+ int over_time_budget_seconds =
+ OfflinerPolicy()
+ .GetProcessingTimeBudgetWhenBackgroundScheduledInSeconds() +
+ 10;
+ AdvanceClockBy(base::TimeDelta::FromSeconds(over_time_budget_seconds));
PumpLoop();
// TryNextRequest should decide that there is no more work to be done,
« no previous file with comments | « components/offline_pages/core/background/pick_request_task_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698