| Index: chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc
|
| diff --git a/chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc b/chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc
|
| index fd6a3773a4e6fd4711be49e70dfc926dfacf6830..484e47ca1132099c22e40ef972bc755ca6b50e0b 100644
|
| --- a/chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc
|
| +++ b/chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc
|
| @@ -332,4 +332,21 @@ TEST_F(ComponentCloudPolicyUpdaterTest, NoPolicy) {
|
| EXPECT_FALSE(fetcher_factory_.GetFetcherByID(0));
|
| }
|
|
|
| +TEST_F(ComponentCloudPolicyUpdaterTest, CancelUpdate) {
|
| + // Submit a policy fetch response with a valid download URL.
|
| + updater_->UpdateExternalPolicy(CreateResponse());
|
| + task_runner_->RunUntilIdle();
|
| +
|
| + // Verify that the download has been started.
|
| + EXPECT_TRUE(fetcher_factory_.GetFetcherByID(0));
|
| +
|
| + // Now cancel that update before the download completes.
|
| + EXPECT_CALL(store_delegate_, OnComponentCloudPolicyStoreUpdated()).Times(0);
|
| + updater_->CancelUpdate(
|
| + PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, kTestExtension));
|
| + task_runner_->RunUntilIdle();
|
| + Mock::VerifyAndClearExpectations(&store_delegate_);
|
| + EXPECT_FALSE(fetcher_factory_.GetFetcherByID(0));
|
| +}
|
| +
|
| } // namespace policy
|
|
|