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 |