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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc

Issue 663023007: Include high-fidelity metadata about a download in incident reports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: robert comments (and sync to r300494, oops) Created 6 years, 2 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/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
+ 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,

Powered by Google App Engine
This is Rietveld 408576698