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

Unified Diff: chrome/test/ppapi/ppapi_filechooser_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/test/ppapi/ppapi_filechooser_browsertest.cc
diff --git a/chrome/test/ppapi/ppapi_filechooser_browsertest.cc b/chrome/test/ppapi/ppapi_filechooser_browsertest.cc
index 74de60a8d9870a3a7cc9eee5da1c2577ec96a36e..0acbec4f6fb8bcb7337255f68e047a5ba5b0536d 100644
--- a/chrome/test/ppapi/ppapi_filechooser_browsertest.cc
+++ b/chrome/test/ppapi/ppapi_filechooser_browsertest.cc
@@ -15,7 +15,7 @@
#include "ui/shell_dialogs/selected_file_info.h"
#if defined(FULL_SAFE_BROWSING)
-#include "chrome/browser/safe_browsing/safe_browsing_service.h"
+#include "chrome/browser/safe_browsing/test_safe_browsing_service.h"
#include "components/safe_browsing_db/test_database_manager.h"
#endif
@@ -138,46 +138,24 @@ class FakeDatabaseManager
~FakeDatabaseManager() override {}
};
-class TestSafeBrowsingService : public SafeBrowsingService {
- public:
- safe_browsing::SafeBrowsingDatabaseManager* CreateDatabaseManager() override {
- return new FakeDatabaseManager();
- }
-
- protected:
- ~TestSafeBrowsingService() override {}
-
- safe_browsing::SafeBrowsingProtocolManagerDelegate*
- GetProtocolManagerDelegate() override {
- // Our FakeDatabaseManager doesn't implement this delegate.
- return NULL;
- }
-};
-
-class TestSafeBrowsingServiceFactory
- : public safe_browsing::SafeBrowsingServiceFactory {
- public:
- SafeBrowsingService* CreateSafeBrowsingService() override {
- SafeBrowsingService* service = new TestSafeBrowsingService();
- return service;
- }
-};
-
class PPAPIFileChooserTest : public OutOfProcessPPAPITest {};
class PPAPIFileChooserTestWithSBService : public PPAPIFileChooserTest {
public:
void SetUp() override {
+ safe_browsing_service_factory_.SetTestDatabaseManager(
+ new FakeDatabaseManager());
SafeBrowsingService::RegisterFactory(&safe_browsing_service_factory_);
PPAPIFileChooserTest::SetUp();
}
+
void TearDown() override {
PPAPIFileChooserTest::TearDown();
SafeBrowsingService::RegisterFactory(nullptr);
}
- private:
- TestSafeBrowsingServiceFactory safe_browsing_service_factory_;
+ protected:
+ safe_browsing::TestSafeBrowsingServiceFactory safe_browsing_service_factory_;
};
} // namespace

Powered by Google App Engine
This is Rietveld 408576698