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

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..fe500eac067fd8ec22fc56e3152892ce3547a892 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc
+++ b/chrome/browser/policy/cloud/component_cloud_policy_updater_unittest.cc
@@ -4,8 +4,6 @@
#include "chrome/browser/policy/cloud/component_cloud_policy_updater.h"
-#include <string>
-
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/files/scoped_temp_dir.h"
@@ -332,4 +330,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
« no previous file with comments | « chrome/browser/policy/cloud/component_cloud_policy_updater.cc ('k') | chrome/browser/policy/configuration_policy_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698