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

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

Issue 2493683002: [OfflinePages] Fixes RequestCoordinator bug not clearing state on timeout (Closed)
Patch Set: Merge Created 4 years, 1 month 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/background/request_coordinator.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/background/request_coordinator_unittest.cc
diff --git a/components/offline_pages/background/request_coordinator_unittest.cc b/components/offline_pages/background/request_coordinator_unittest.cc
index 46c6debbbe5fede2c1faa5223d17062e569ec837..531c4d17280cadb76b2ea5b55a150e45c0549d1f 100644
--- a/components/offline_pages/background/request_coordinator_unittest.cc
+++ b/components/offline_pages/background/request_coordinator_unittest.cc
@@ -1078,6 +1078,9 @@ TEST_F(RequestCoordinatorTest, WatchdogTimeoutForScheduledProcessing) {
// Build a request to use with the pre-renderer, and put it on the queue.
offline_pages::SavePageRequest request(
kRequestId1, kUrl1, kClientId1, base::Time::Now(), kUserRequested);
+ // Set request to allow one more completed attempt.
+ int max_tries = coordinator()->policy()->GetMaxCompletedTries();
+ request.set_completed_attempt_count(max_tries - 1);
coordinator()->queue()->AddRequest(
request,
base::Bind(&RequestCoordinatorTest::AddRequestDone,
@@ -1114,6 +1117,7 @@ TEST_F(RequestCoordinatorTest, WatchdogTimeoutForScheduledProcessing) {
PumpLoop();
EXPECT_FALSE(is_starting());
+ EXPECT_FALSE(coordinator()->is_busy());
EXPECT_TRUE(OfflinerWasCanceled());
}
« no previous file with comments | « components/offline_pages/background/request_coordinator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698