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( |