Index: chrome/browser/safe_browsing/download_protection_service_unittest.cc |
diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc |
index 2808703ccb73783737c9b2a16e74bdd0016d5763..ab391137268b48dd4230096f57e42d881cb462c6 100644 |
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc |
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc |
@@ -406,7 +406,7 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadSuccess) { |
EXPECT_CALL(*sb_service_->mock_database_manager(), |
MatchDownloadWhitelistUrl(_)) |
.WillRepeatedly(Return(false)); |
- EXPECT_CALL(*signature_util_, CheckSignature(info.local_file, _)).Times(4); |
+ EXPECT_CALL(*signature_util_, CheckSignature(info.local_file, _)).Times(5); |
download_service_->CheckClientDownload( |
info, |
@@ -464,6 +464,25 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadSuccess) { |
#else |
EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE)); |
#endif |
+ |
+ // If the response is dangerous_host the result should also be marked as |
+ // dangerous_host. |
+ response.set_verdict(ClientDownloadResponse::DANGEROUS_HOST); |
+ factory.SetFakeResponse( |
+ DownloadProtectionService::GetDownloadRequestUrl(), |
+ response.SerializeAsString(), |
+ true); |
+ |
+ download_service_->CheckClientDownload( |
+ info, |
+ base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, |
+ base::Unretained(this))); |
+ msg_loop_.Run(); |
+#if defined(OS_WIN) |
+ EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS_HOST)); |
+#else |
+ EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE)); |
+#endif |
} |
TEST_F(DownloadProtectionServiceTest, CheckClientDownloadHTTPS) { |