Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc

Issue 70863002: Refactored the ComponentCloudPolicyService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698