Skip to content

Commit

Permalink
Bug fix in sampling whitelisted download.
Browse files Browse the repository at this point in the history
BUG=553674

Review URL: https://codereview.chromium.org/1911543002

Cr-Commit-Position: refs/heads/master@{#388575}
  • Loading branch information
jialiul authored and Commit bot committed Apr 20, 2016
1 parent be08824 commit 2c43aa6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/safe_browsing/download_protection_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,8 @@ class DownloadProtectionService::CheckClientDownloadRequest
request.set_url(SanitizeUrl(item_->GetUrlChain().back()));
request.mutable_digests()->set_sha256(item_->GetHash());
request.set_length(item_->GetReceivedBytes());
request.set_skipped_url_whitelist(true);
request.set_skipped_certificate_whitelist(true);
request.set_skipped_url_whitelist(skipped_url_whitelist_);
request.set_skipped_certificate_whitelist(skipped_certificate_whitelist_);
for (size_t i = 0; i < item_->GetUrlChain().size(); ++i) {
ClientDownloadRequest::Resource* resource = request.add_resources();
resource->set_url(SanitizeUrl(item_->GetUrlChain()[i]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,8 @@ TEST_F(DownloadProtectionServiceTest,

EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS));
EXPECT_TRUE(HasClientDownloadRequest());
EXPECT_FALSE(GetClientDownloadRequest()->skipped_url_whitelist());
EXPECT_FALSE(GetClientDownloadRequest()->skipped_certificate_whitelist());
ClearClientDownloadRequest();

// Check that the referrer is not matched against the whitelist.
Expand All @@ -674,6 +676,8 @@ TEST_F(DownloadProtectionServiceTest,

EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS));
EXPECT_TRUE(HasClientDownloadRequest());
EXPECT_FALSE(GetClientDownloadRequest()->skipped_url_whitelist());
EXPECT_FALSE(GetClientDownloadRequest()->skipped_certificate_whitelist());
ClearClientDownloadRequest();

// Redirect from a site shouldn't be checked either.
Expand All @@ -686,6 +690,8 @@ TEST_F(DownloadProtectionServiceTest,

EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS));
EXPECT_TRUE(HasClientDownloadRequest());
EXPECT_FALSE(GetClientDownloadRequest()->skipped_url_whitelist());
EXPECT_FALSE(GetClientDownloadRequest()->skipped_certificate_whitelist());
ClearClientDownloadRequest();

// Only if the final url is whitelisted should it be SAFE.
Expand Down

0 comments on commit 2c43aa6

Please sign in to comment.