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

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

Issue 12542015: Fixed a glitch in the ComponentCloudPolicyUpdater where a protobuf field was read before being vali… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months 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
« no previous file with comments | « chrome/browser/policy/component_cloud_policy_updater.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/component_cloud_policy_updater_unittest.cc
diff --git a/chrome/browser/policy/component_cloud_policy_updater_unittest.cc b/chrome/browser/policy/component_cloud_policy_updater_unittest.cc
index 77fdbfa32b17714ec76375ee93d9146338816079..b7b883472fe880095f72a9f96caebc542391c814 100644
--- a/chrome/browser/policy/component_cloud_policy_updater_unittest.cc
+++ b/chrome/browser/policy/component_cloud_policy_updater_unittest.cc
@@ -428,4 +428,20 @@ TEST_F(ComponentCloudPolicyUpdaterTest, InvalidatedJob) {
EXPECT_EQ(GURL(kTestDownload3), fetcher->GetOriginalURL());
}
+TEST_F(ComponentCloudPolicyUpdaterTest, NoPolicy) {
+ // Start a fetch with a valid download url.
+ updater_->UpdateExternalPolicy(CreateResponse());
+ net::TestURLFetcher* fetcher = GetCurrentFetcher();
+ ASSERT_TRUE(fetcher);
+
+ // Now update the policy fetch response before the fetch completes. The new
+ // data does not have a download url.
+ builder_.payload().Clear();
+ updater_->UpdateExternalPolicy(CreateResponse());
+
+ // The download has been cancelled.
+ fetcher = GetCurrentFetcher();
+ ASSERT_FALSE(fetcher);
+}
+
} // namespace policy
« no previous file with comments | « chrome/browser/policy/component_cloud_policy_updater.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698