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

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

Issue 8638002: Don't send file URLs for download protection server pings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/safe_browsing/download_protection_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f82e1243bd4b6b2e131089c9daab6d102b5eaaf4..e34972a0b22eec3b41fcf9f387e726ff3c92ccd6 100644
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
@@ -233,6 +233,14 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadInvalidUrl) {
base::Unretained(this)));
msg_loop_.Run();
ExpectResult(DownloadProtectionService::SAFE);
+
+ info.download_url_chain.push_back(GURL("file://www.google.com/"));
+ download_service_->CheckClientDownload(
+ info,
+ base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
+ base::Unretained(this)));
+ msg_loop_.Run();
+ ExpectResult(DownloadProtectionService::SAFE);
}
TEST_F(DownloadProtectionServiceTest, CheckClientDownloadWhitelistedUrl) {
@@ -413,7 +421,7 @@ TEST_F(DownloadProtectionServiceTest,
info.local_file = FilePath(FILE_PATH_LITERAL("bla.tmp"));
info.target_file = FilePath(FILE_PATH_LITERAL("bla.exe"));
info.download_url_chain.push_back(GURL("http://www.google.com/"));
- info.download_url_chain.push_back(GURL("http://www.google.com/bla.exe"));
+ info.download_url_chain.push_back(GURL("ftp://www.google.com/bla.exe"));
info.referrer_url = GURL("http://www.google.com/");
info.sha256_hash = "hash";
info.total_bytes = 100;
@@ -434,7 +442,7 @@ TEST_F(DownloadProtectionServiceTest,
ASSERT_TRUE(fetcher);
ClientDownloadRequest request;
EXPECT_TRUE(request.ParseFromString(fetcher->upload_data()));
- EXPECT_EQ("http://www.google.com/bla.exe", request.url());
+ EXPECT_EQ("ftp://www.google.com/bla.exe", request.url());
EXPECT_EQ(info.sha256_hash, request.digests().sha256());
EXPECT_EQ(info.total_bytes, request.length());
EXPECT_EQ(info.user_initiated, request.user_initiated());
@@ -444,7 +452,7 @@ TEST_F(DownloadProtectionServiceTest,
"http://www.google.com/", ""));
EXPECT_TRUE(RequestContainsResource(request,
ClientDownloadRequest::DOWNLOAD_URL,
- "http://www.google.com/bla.exe",
+ "ftp://www.google.com/bla.exe",
info.referrer_url.spec()));
EXPECT_TRUE(request.has_signature());
EXPECT_EQ(0, request.signature().certificate_chain_size());
« no previous file with comments | « chrome/browser/safe_browsing/download_protection_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698