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

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

Issue 2681783003: Since SafeBrowsingNavigationObserverManager cleans up navigation events every two minutes, if downl… (Closed)
Patch Set: Created 3 years, 10 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 3fddf4ae47c50b8fafaac0784708b10f1b7b6b4c..04a46573a2ad35d65bcd0a3de01236e51615f577 100644
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
@@ -1724,6 +1724,7 @@ TEST_F(DownloadProtectionServiceTest, TestCheckDownloadUrl) {
std::string hash = "hash";
content::MockDownloadItem item;
+ EXPECT_CALL(item, GetURL()).WillRepeatedly(ReturnRef(url_chain.back()));
EXPECT_CALL(item, GetUrlChain()).WillRepeatedly(ReturnRef(url_chain));
EXPECT_CALL(item, GetReferrerUrl()).WillRepeatedly(ReturnRef(referrer));
EXPECT_CALL(item, GetHash()).WillRepeatedly(ReturnRef(hash));
@@ -1737,8 +1738,8 @@ TEST_F(DownloadProtectionServiceTest, TestCheckDownloadUrl) {
.WillOnce(Return(true));
RunLoop run_loop;
download_service_->CheckDownloadUrl(
- item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
- base::Unretained(this), run_loop.QuitClosure()));
+ &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
+ base::Unretained(this), run_loop.QuitClosure()));
run_loop.Run();
EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE));
Mock::VerifyAndClearExpectations(sb_service_.get());
@@ -1750,8 +1751,8 @@ TEST_F(DownloadProtectionServiceTest, TestCheckDownloadUrl) {
DoAll(CheckDownloadUrlDone(SB_THREAT_TYPE_SAFE), Return(false)));
RunLoop run_loop;
download_service_->CheckDownloadUrl(
- item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
- base::Unretained(this), run_loop.QuitClosure()));
+ &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
+ base::Unretained(this), run_loop.QuitClosure()));
run_loop.Run();
EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE));
Mock::VerifyAndClearExpectations(sb_service_.get());
@@ -1763,8 +1764,8 @@ TEST_F(DownloadProtectionServiceTest, TestCheckDownloadUrl) {
Return(false)));
RunLoop run_loop;
download_service_->CheckDownloadUrl(
- item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
- base::Unretained(this), run_loop.QuitClosure()));
+ &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
+ base::Unretained(this), run_loop.QuitClosure()));
run_loop.Run();
EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE));
Mock::VerifyAndClearExpectations(sb_service_.get());
@@ -1776,8 +1777,8 @@ TEST_F(DownloadProtectionServiceTest, TestCheckDownloadUrl) {
Return(false)));
RunLoop run_loop;
download_service_->CheckDownloadUrl(
- item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
- base::Unretained(this), run_loop.QuitClosure()));
+ &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
+ base::Unretained(this), run_loop.QuitClosure()));
run_loop.Run();
EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS));
}

Powered by Google App Engine
This is Rietveld 408576698