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

Unified Diff: chrome/browser/download/download_browsertest.cc

Issue 1943993006: Create test fixture for SafeBrowsingService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/download/download_danger_prompt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index 42c441650785120dcf524bd20315ba0199031ca6..f838c1e3248d8f2af1cbd45cac0e3182db60602c 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -111,8 +111,7 @@
#if defined(FULL_SAFE_BROWSING)
#include "chrome/browser/safe_browsing/download_feedback_service.h"
#include "chrome/browser/safe_browsing/download_protection_service.h"
-#include "chrome/browser/safe_browsing/safe_browsing_database.h"
-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
+#include "chrome/browser/safe_browsing/test_safe_browsing_service.h"
#endif
using content::BrowserContext;
@@ -1090,7 +1089,7 @@ class FakeDownloadProtectionService
};
class FakeSafeBrowsingService
- : public safe_browsing::SafeBrowsingService,
+ : public safe_browsing::TestSafeBrowsingService,
public safe_browsing::ServicesDelegate::ServicesCreator {
public:
FakeSafeBrowsingService() {
@@ -1098,8 +1097,6 @@ class FakeSafeBrowsingService
safe_browsing::ServicesDelegate::CreateForTest(this, this);
}
- std::string GetDownloadReport() const { return report_; }
-
protected:
~FakeSafeBrowsingService() override {}
@@ -1122,13 +1119,6 @@ class FakeSafeBrowsingService
return nullptr;
}
- // SafeBrowsingService:
- void SendSerializedDownloadReport(const std::string& report) override {
- report_ = report;
- }
-
- std::string report_;
-
DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingService);
};
@@ -3385,7 +3375,7 @@ IN_PROC_BROWSER_TEST_F(
safe_browsing::ClientSafeBrowsingReportRequest actual_report;
actual_report.ParseFromString(
test_safe_browsing_factory_->fake_safe_browsing_service()
- ->GetDownloadReport());
+ ->serilized_download_report());
EXPECT_EQ(safe_browsing::ClientSafeBrowsingReportRequest::
DANGEROUS_DOWNLOAD_WARNING,
actual_report.type());
@@ -3418,9 +3408,9 @@ IN_PROC_BROWSER_TEST_F(
DownloadItem* download = downloads[0];
DownloadCommands(download).ExecuteCommand(DownloadCommands::DISCARD);
- EXPECT_TRUE(
- test_safe_browsing_factory_->fake_safe_browsing_service()
- ->GetDownloadReport().empty());
+ EXPECT_TRUE(test_safe_browsing_factory_->fake_safe_browsing_service()
+ ->serilized_download_report()
+ .empty());
}
#endif // FULL_SAFE_BROWSING
« no previous file with comments | « no previous file | chrome/browser/download/download_danger_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698