Chromium Code Reviews| Index: chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc |
| diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc |
| index 1f0584864f38d36c75dd0efbb1c3327ddf4ce77c..82144b0df6994a53a13f15eb797733b9e04adecc 100644 |
| --- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc |
| +++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc |
| @@ -153,6 +153,12 @@ class LastDownloadFinderTest : public testing::Test { |
| return profile; |
| } |
| + safe_browsing::LastDownloadFinder::DownloadDetailsGetter |
|
Alexei Svitkine (slow)
2014/10/27 17:09:07
Make the code in this file be in safe_browsing nam
grt (UTC plus 2)
2014/10/30 15:11:40
Done.
|
| + GetDownloadDetailsGetter() { |
| + return base::Bind(&LastDownloadFinderTest::GetDownloadDetails, |
| + base::Unretained(this)); |
| + } |
| + |
| void AddDownload(Profile* profile, const history::DownloadRow& download) { |
| base::RunLoop run_loop; |
| @@ -195,6 +201,7 @@ class LastDownloadFinderTest : public testing::Test { |
| scoped_ptr<safe_browsing::LastDownloadFinder> finder( |
| safe_browsing::LastDownloadFinder::Create( |
| + GetDownloadDetailsGetter(), |
| base::Bind(&LastDownloadFinderTest::OnLastDownload, |
| base::Unretained(this), |
| &last_download, |
| @@ -255,6 +262,14 @@ class LastDownloadFinderTest : public testing::Test { |
| // created. |
| void OnDownloadCreated(bool created) { ASSERT_TRUE(created); } |
| + void GetDownloadDetails( |
| + content::BrowserContext* context, |
| + const safe_browsing::DownloadMetadataManager::GetDownloadDetailsCallback& |
| + callback) { |
| + callback.Run( |
| + scoped_ptr<safe_browsing::ClientIncidentReport_DownloadDetails>()); |
| + } |
| + |
| int profile_number_; |
| }; |
| @@ -296,6 +311,7 @@ TEST_F(LastDownloadFinderTest, DeleteBeforeResults) { |
| // Start a finder and kill it before the search completes. |
| safe_browsing::LastDownloadFinder::Create( |
| + GetDownloadDetailsGetter(), |
| base::Bind(&LastDownloadFinderTest::NeverCalled, base::Unretained(this))) |
| .reset(); |
| @@ -320,6 +336,7 @@ TEST_F(LastDownloadFinderTest, AddProfileAfterStarting) { |
| // Create a finder that we expect will find a download in the second profile. |
| scoped_ptr<safe_browsing::LastDownloadFinder> finder( |
| safe_browsing::LastDownloadFinder::Create( |
| + GetDownloadDetailsGetter(), |
| base::Bind(&LastDownloadFinderTest::OnLastDownload, |
| base::Unretained(this), |
| &last_download, |