Commit 04393ae1 authored by dougarnett's avatar dougarnett Committed by Commit bot

[OfflinePages] Clear busy flag in StopPrerendering() in Request Coordinator.

BUG=641000

Review-Url: https://codereview.chromium.org/2280713002
Cr-Commit-Position: refs/heads/master@{#414492}
parent 775f244f
......@@ -129,6 +129,7 @@ void RequestCoordinator::StopPrerendering() {
if (active_request_) {
RecordOfflinerResultUMA(active_request_->client_id(),
last_offlining_status_);
is_busy_ = false;
active_request_.reset();
}
......
......@@ -607,12 +607,17 @@ TEST_F(RequestCoordinatorTest, StartProcessingThenStopProcessingLater) {
// Let all the async parts of the start processing pipeline run to completion.
PumpLoop();
// Coordinator should now be busy.
EXPECT_TRUE(is_busy());
// Now we cancel it while the prerenderer is busy.
coordinator()->StopProcessing();
// Let the async callbacks in the cancel run.
PumpLoop();
EXPECT_FALSE(is_busy());
// OfflinerDoneCallback will not end up getting called with status SAVED,
// since we cancelled the event before the LoadAndSave completed.
EXPECT_EQ(Offliner::RequestStatus::REQUEST_COORDINATOR_CANCELED,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment