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

Unified Diff: chrome/browser/safe_browsing/client_side_detection_host_unittest.cc

Issue 1110723002: Split to SafeBrowsingDatabaseManager into Local* and Remote*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to review. Tweak comments and list initializer. Created 5 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/safe_browsing/client_side_detection_host_unittest.cc
diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
index 382460e3efac3ad99a734ca7426c3d52c2ef65b1..6f8249ceb9e2c8ca318dae6839de44667a25a689 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/safe_browsing/client_side_detection_service.h"
#include "chrome/browser/safe_browsing/database_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
+#include "chrome/browser/safe_browsing/test_database_manager.h"
#include "chrome/browser/safe_browsing/ui_manager.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/safe_browsing/csd.pb.h"
@@ -152,10 +153,9 @@ class MockSafeBrowsingUIManager : public SafeBrowsingUIManager {
DISALLOW_COPY_AND_ASSIGN(MockSafeBrowsingUIManager);
};
-class MockSafeBrowsingDatabaseManager : public SafeBrowsingDatabaseManager {
+class MockSafeBrowsingDatabaseManager : public TestSafeBrowsingDatabaseManager {
public:
- explicit MockSafeBrowsingDatabaseManager(SafeBrowsingService* service)
- : SafeBrowsingDatabaseManager(service) { }
+ MockSafeBrowsingDatabaseManager() {}
MOCK_METHOD1(MatchCsdWhitelistUrl, bool(const GURL&));
MOCK_METHOD1(MatchMalwareIP, bool(const std::string& ip_address));
@@ -206,12 +206,9 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness {
// Inject service classes.
csd_service_.reset(new StrictMock<MockClientSideDetectionService>());
- // Only used for initializing mock objects.
- SafeBrowsingService* sb_service =
- SafeBrowsingService::CreateSafeBrowsingService();
- database_manager_ =
- new StrictMock<MockSafeBrowsingDatabaseManager>(sb_service);
- ui_manager_ = new StrictMock<MockSafeBrowsingUIManager>(sb_service);
+ database_manager_ = new StrictMock<MockSafeBrowsingDatabaseManager>();
+ ui_manager_ = new StrictMock<MockSafeBrowsingUIManager>(
+ SafeBrowsingService::CreateSafeBrowsingService());
csd_host_.reset(safe_browsing::ClientSideDetectionHost::Create(
web_contents()));
csd_host_->set_client_side_detection_service(csd_service_.get());

Powered by Google App Engine
This is Rietveld 408576698