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

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

Issue 2176453002: Update the request count when a request fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/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 34f29f99bb5f57153ee7a4e718ccdd69e9b4e3b8..1bdc0fec2949202b371d59d996112af83fdc5a0b 100644
--- a/components/offline_pages/background/request_coordinator_unittest.cc
+++ b/components/offline_pages/background/request_coordinator_unittest.cc
@@ -357,6 +357,12 @@ TEST_F(RequestCoordinatorTest, OfflinerDoneRequestFailed) {
EnableOfflinerCallback(true);
SendOfflinerDoneCallback(request,
Offliner::RequestStatus::PRERENDERING_FAILED);
+ // There will be one request left in the queue after the prerender fails, stop
+ // processing now so that it will remain in the queue for us to check. This
+ // won't affect the offliner done callback other than preventing
+ // TryNextRequest from doing anything.
+ coordinator()->StopProcessing();
+
PumpLoop();
// Verify the request is not removed from the queue, and wait for callbacks.
@@ -367,7 +373,9 @@ TEST_F(RequestCoordinatorTest, OfflinerDoneRequestFailed) {
// Still one request in the queue.
EXPECT_EQ(1UL, last_requests().size());
- // TODO(dougarnett): Verify retry count gets incremented.
+ // Verify retry count was incremented.
+ const SavePageRequest& found_request = last_requests().front();
+ EXPECT_EQ(1L, found_request.attempt_count());
}
// This tests a StopProcessing call before we have actually started the

Powered by Google App Engine
This is Rietveld 408576698