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 8bc60d7d39b39a8aefad1b1581d76a97235752db..f0ded308d87122c558eed48c34f6731d7bb07f35 100644 |
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc |
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc |
@@ -386,7 +386,7 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadSuccess) { |
EXPECT_CALL(*sb_service_, MatchDownloadWhitelistUrl(_)) |
.WillRepeatedly(Return(false)); |
- EXPECT_CALL(*signature_util_, CheckSignature(info.local_file, _)).Times(3); |
+ EXPECT_CALL(*signature_util_, CheckSignature(info.local_file, _)).Times(4); |
download_service_->CheckClientDownload( |
info, |
@@ -426,6 +426,24 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadSuccess) { |
#else |
ExpectResult(DownloadProtectionService::SAFE); |
#endif |
+ |
+ // If the response is uncommon the result should also be marked as uncommon. |
+ response.set_verdict(ClientDownloadResponse::UNCOMMON); |
+ factory.SetFakeResponse( |
+ DownloadProtectionService::kDownloadRequestUrl, |
+ response.SerializeAsString(), |
+ true); |
+ |
+ download_service_->CheckClientDownload( |
+ info, |
+ base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, |
+ base::Unretained(this))); |
+ msg_loop_.Run(); |
+#if defined(OS_WIN) |
+ ExpectResult(DownloadProtectionService::UNCOMMON); |
+#else |
+ ExpectResult(DownloadProtectionService::SAFE); |
+#endif |
} |
TEST_F(DownloadProtectionServiceTest, CheckClientDownloadValidateRequest) { |