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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service_browsertest.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/safe_browsing_service_browsertest.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
index 884b45b4b8f20566cbad9a8485e0a42a9f27ea5e..071e5bf9d277ca1ea118fc968a9084d9ac25024b 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/profiles/startup_task_runner_service_factory.h"
#include "chrome/browser/safe_browsing/client_side_detection_service.h"
#include "chrome/browser/safe_browsing/database_manager.h"
+#include "chrome/browser/safe_browsing/local_database_manager.h"
#include "chrome/browser/safe_browsing/metadata.pb.h"
#include "chrome/browser/safe_browsing/protocol_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_database.h"
@@ -52,6 +53,10 @@
#include "chromeos/chromeos_switches.h"
#endif
+#if !defined(SAFE_BROWSING_DB_LOCAL)
+#error This test requires SAFE_BROWSING_DB_LOCAL.
+#endif
+
using content::BrowserThread;
using content::InterstitialPage;
using content::WebContents;
@@ -474,13 +479,22 @@ class SafeBrowsingServiceTest : public InProcessBrowserTest {
pm_factory_.GetProtocolManager()->IntroduceDelay(delay);
}
- base::TimeDelta GetCheckTimeout(SafeBrowsingService* sb_service) {
- return sb_service->database_manager()->check_timeout_;
+ // TODO(nparker): Remove the need for this by wiring in our own
+ // SafeBrowsingDatabaseManager factory and keep a ptr to the subclass.
+ // Or add a Get/SetTimeout to sbdbmgr.
+ static LocalSafeBrowsingDatabaseManager* LocalDatabaseManagerForService(
+ SafeBrowsingService* sb_service) {
+ return static_cast<LocalSafeBrowsingDatabaseManager*>(
+ sb_service->database_manager().get());
+ }
+
+ static base::TimeDelta GetCheckTimeout(SafeBrowsingService* sb_service) {
+ return LocalDatabaseManagerForService(sb_service)->check_timeout_;
}
- void SetCheckTimeout(SafeBrowsingService* sb_service,
- const base::TimeDelta& delay) {
- sb_service->database_manager()->check_timeout_ = delay;
+ static void SetCheckTimeout(SafeBrowsingService* sb_service,
+ const base::TimeDelta& delay) {
+ LocalDatabaseManagerForService(sb_service)->check_timeout_ = delay;
}
void CreateCSDService() {
@@ -1256,8 +1270,8 @@ class SafeBrowsingDatabaseManagerCookieTest : public InProcessBrowserTest {
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseManagerCookieTest);
};
-// Test that a Safe Browsing database update request both sends cookies and can
-// save cookies.
+// Test that a Local Safe Browsing database update request both sends cookies
+// and can save cookies.
IN_PROC_BROWSER_TEST_F(SafeBrowsingDatabaseManagerCookieTest,
TestSBUpdateCookies) {
content::WindowedNotificationObserver observer(

Powered by Google App Engine
This is Rietveld 408576698