| 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 df195f785f2a3398eef76d59ef4cea19a746fbf8..11c672f76f88b8a5a6de10c8dcdcbdd64fabc3af 100644
|
| --- a/components/offline_pages/background/request_coordinator_unittest.cc
|
| +++ b/components/offline_pages/background/request_coordinator_unittest.cc
|
| @@ -247,6 +247,10 @@ class RequestCoordinatorTest
|
| waiter_.Signal();
|
| }
|
|
|
| + net::NetworkChangeNotifier::ConnectionType GetConnectionType() {
|
| + return coordinator()->GetConnectionType();
|
| + }
|
| +
|
| // Callback for Add requests.
|
| void AddRequestDone(RequestQueue::AddRequestResult result,
|
| const SavePageRequest& request);
|
| @@ -497,6 +501,10 @@ TEST_F(RequestCoordinatorTest, SavePageLater) {
|
| DeviceConditions device_conditions(false, 75,
|
| net::NetworkChangeNotifier::CONNECTION_3G);
|
| SetDeviceConditionsForTest(device_conditions);
|
| + // Set up the fake network conditions for the NetworkConnectionNotifier.
|
| + SetNetworkConditionsForTest(
|
| + net::NetworkChangeNotifier::ConnectionType::CONNECTION_3G);
|
| + // Set up the fake network conditions for the network quality estimator.
|
| SetEffectiveConnectionTypeForTest(
|
| net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G);
|
| EnableOfflinerCallback(true);
|
| @@ -1082,8 +1090,10 @@ TEST_F(RequestCoordinatorTest, WatchdogTimeoutForImmediateProcessing) {
|
| // If low end device, pretend it is not so that immediate start happens.
|
| SetIsLowEndDeviceForTest(false);
|
|
|
| - // Set good network connection so that adding request will trigger
|
| - // immediate processing.
|
| + // Set up the fake network conditions for the NetworkConnectionNotifier.
|
| + SetNetworkConditionsForTest(
|
| + net::NetworkChangeNotifier::ConnectionType::CONNECTION_3G);
|
| + // Set up the fake network conditions for the network quality estimator.
|
| SetEffectiveConnectionTypeForTest(
|
| net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G);
|
|
|
| @@ -1255,6 +1265,10 @@ TEST_F(RequestCoordinatorTest, RemoveRequest) {
|
|
|
| TEST_F(RequestCoordinatorTest,
|
| SavePageStartsProcessingWhenConnectedAndNotLowEndDevice) {
|
| + // Set up the fake network conditions for the NetworkConnectionNotifier.
|
| + SetNetworkConditionsForTest(
|
| + net::NetworkChangeNotifier::ConnectionType::CONNECTION_3G);
|
| + // Set up the fake network conditions for the network quality estimator.
|
| SetEffectiveConnectionTypeForTest(
|
| net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G);
|
| EXPECT_NE(
|
| @@ -1320,6 +1334,8 @@ TEST_F(RequestCoordinatorTest,
|
| PumpLoop();
|
|
|
| // Now simulate reasonable connection.
|
| + SetNetworkConditionsForTest(
|
| + net::NetworkChangeNotifier::ConnectionType::CONNECTION_3G);
|
| SetEffectiveConnectionTypeForTest(
|
| net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G);
|
|
|
|
|