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

Unified Diff: chrome/browser/safe_browsing/download_protection_service_unittest.cc

Issue 12087095: Sync csd.proto with server-side version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missing comma Created 7 years, 11 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
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) {
« no previous file with comments | « chrome/browser/safe_browsing/download_protection_service.cc ('k') | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698