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

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: 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
Index: chrome/browser/download/download_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index dd3987c7cbd9119d96d03b9a86310a54a9b29b27..711dbb59a08607e9ca2b911ec6b18f7a65733b79 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -110,8 +110,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;
@@ -1089,7 +1088,7 @@ class FakeDownloadProtectionService
};
class FakeSafeBrowsingService
- : public safe_browsing::SafeBrowsingService,
+ : public safe_browsing::TestSafeBrowsingService,
public safe_browsing::ServicesDelegate::ServicesCreator {
public:
FakeSafeBrowsingService() {
@@ -1097,8 +1096,6 @@ class FakeSafeBrowsingService
safe_browsing::ServicesDelegate::CreateForTest(this, this);
}
- std::string GetDownloadReport() const { return report_; }
-
protected:
~FakeSafeBrowsingService() override {}
@@ -1121,13 +1118,6 @@ class FakeSafeBrowsingService
return nullptr;
}
- // SafeBrowsingService:
- void SendSerializedDownloadReport(const std::string& report) override {
- report_ = report;
- }
-
- std::string report_;
-
DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingService);
};
@@ -3393,7 +3383,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());
@@ -3428,7 +3418,7 @@ IN_PROC_BROWSER_TEST_F(
EXPECT_TRUE(
test_safe_browsing_factory_->fake_safe_browsing_service()
- ->GetDownloadReport().empty());
+ ->serilized_download_report().empty());
}
#endif // FULL_SAFE_BROWSING
« no previous file with comments | « no previous file | chrome/browser/download/download_danger_prompt.cc » ('j') | chrome/browser/download/download_danger_prompt.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698