| 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 61ea62fd0bdac36373e5cb1f3b6348941ab0745a..2abdb680089ab99ad5d917a8cd326d252773bcff 100644
|
| --- a/components/offline_pages/background/request_coordinator_unittest.cc
|
| +++ b/components/offline_pages/background/request_coordinator_unittest.cc
|
| @@ -190,6 +190,10 @@ class RequestCoordinatorTest
|
| return coordinator_->is_busy();
|
| }
|
|
|
| + bool is_starting() {
|
| + return coordinator_->is_starting();
|
| + }
|
| +
|
| // Empty callback function.
|
| void EmptyCallbackFunction(bool result) {
|
| }
|
| @@ -597,12 +601,15 @@ TEST_F(RequestCoordinatorTest, RequestNotPickedNonUserRequestedItemsRemain) {
|
| base::Callback<void(bool)> callback = base::Bind(
|
| &RequestCoordinatorTest::EmptyCallbackFunction, base::Unretained(this));
|
| coordinator()->StartProcessing(device_conditions, callback);
|
| + EXPECT_TRUE(is_starting());
|
|
|
| // Call RequestNotPicked, and make sure we pick schedule a task for non user
|
| // requested conditions.
|
| CallRequestNotPicked(true);
|
| PumpLoop();
|
|
|
| + EXPECT_FALSE(is_starting());
|
| +
|
| // The scheduler should have been called to schedule the non-user requested
|
| // task.
|
| SchedulerStub* scheduler_stub =
|
| @@ -671,9 +678,11 @@ TEST_F(RequestCoordinatorTest, StartProcessingThenStopProcessingImmediately) {
|
| &RequestCoordinatorTest::EmptyCallbackFunction,
|
| base::Unretained(this));
|
| EXPECT_TRUE(coordinator()->StartProcessing(device_conditions, callback));
|
| + EXPECT_TRUE(is_starting());
|
|
|
| // Now, quick, before it can do much (we haven't called PumpLoop), cancel it.
|
| coordinator()->StopProcessing();
|
| + EXPECT_FALSE(is_starting());
|
|
|
| // Let the async callbacks in the request coordinator run.
|
| PumpLoop();
|
| @@ -708,12 +717,14 @@ TEST_F(RequestCoordinatorTest, StartProcessingThenStopProcessingLater) {
|
| &RequestCoordinatorTest::EmptyCallbackFunction,
|
| base::Unretained(this));
|
| EXPECT_TRUE(coordinator()->StartProcessing(device_conditions, callback));
|
| + EXPECT_TRUE(is_starting());
|
|
|
| // Let all the async parts of the start processing pipeline run to completion.
|
| PumpLoop();
|
|
|
| // Coordinator should now be busy.
|
| EXPECT_TRUE(is_busy());
|
| + EXPECT_FALSE(is_starting());
|
|
|
| // Now we cancel it while the prerenderer is busy.
|
| coordinator()->StopProcessing();
|
|
|