| Index: components/policy/core/common/cloud/device_management_service_unittest.cc
|
| diff --git a/components/policy/core/common/cloud/device_management_service_unittest.cc b/components/policy/core/common/cloud/device_management_service_unittest.cc
|
| index fd4bf6535ca8ad2de4b201b5a0711bc1773348ea..3d3d0969aae45a51ea90c5f1a6b4f2f5dd64887b 100644
|
| --- a/components/policy/core/common/cloud/device_management_service_unittest.cc
|
| +++ b/components/policy/core/common/cloud/device_management_service_unittest.cc
|
| @@ -51,6 +51,9 @@ const char kRobotAuthCode[] = "robot-oauth-auth-code";
|
| class DeviceManagementServiceTestBase : public testing::Test {
|
| protected:
|
| DeviceManagementServiceTestBase() {
|
| + // Set retry delay to prevent timeouts.
|
| + policy::DeviceManagementService::SetRetryDelayForTesting(0);
|
| +
|
| request_context_ =
|
| new net::TestURLRequestContextGetter(loop_.task_runner());
|
| ResetService();
|
| @@ -610,6 +613,7 @@ TEST_F(DeviceManagementServiceTest, RetryOnProxyError) {
|
|
|
| // Generate a callback with a proxy failure.
|
| SendResponse(fetcher, net::ERR_PROXY_CONNECTION_FAILED, 200, std::string());
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| // Verify that a new URLFetcher was started that bypasses the proxy.
|
| fetcher = GetFetcher();
|
| @@ -640,6 +644,7 @@ TEST_F(DeviceManagementServiceTest, RetryOnBadResponseFromProxy) {
|
| // Generate a callback with a valid http response, that was generated by
|
| // a bad/wrong proxy.
|
| SendResponse(fetcher, net::OK, 200, std::string());
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| // Verify that a new URLFetcher was started that bypasses the proxy.
|
| fetcher = GetFetcher();
|
| @@ -666,6 +671,7 @@ TEST_F(DeviceManagementServiceTest, RetryOnNetworkChanges) {
|
| net::ERR_NETWORK_CHANGED));
|
| fetcher->set_url(GURL(kServiceUrl));
|
| fetcher->delegate()->OnURLFetchComplete(fetcher);
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| // Verify that a new URLFetcher was started that retries this job, after
|
| // having called OnJobRetry.
|
| @@ -692,6 +698,7 @@ TEST_F(DeviceManagementServiceTest, RetryLimit) {
|
| net::ERR_NETWORK_CHANGED));
|
| fetcher->set_url(GURL(kServiceUrl));
|
| fetcher->delegate()->OnURLFetchComplete(fetcher);
|
| + base::RunLoop().RunUntilIdle();
|
| Mock::VerifyAndClearExpectations(this);
|
| }
|
|
|
| @@ -705,6 +712,7 @@ TEST_F(DeviceManagementServiceTest, RetryLimit) {
|
| net::ERR_NETWORK_CHANGED));
|
| fetcher->set_url(GURL(kServiceUrl));
|
| fetcher->delegate()->OnURLFetchComplete(fetcher);
|
| + base::RunLoop().RunUntilIdle();
|
| Mock::VerifyAndClearExpectations(this);
|
| }
|
|
|
|
|