Index: chrome/browser/captive_portal/captive_portal_service.h |
=================================================================== |
--- chrome/browser/captive_portal/captive_portal_service.h (revision 148558) |
+++ chrome/browser/captive_portal/captive_portal_service.h (working copy) |
@@ -76,6 +76,13 @@ |
// checks return INTERNET_CONNECTED. |
bool enabled() const { return enabled_; } |
+ // Used to disable captive portal detection so it doesn't interfere with |
+ // tests. Should be called before the service is created. |
+ static void set_is_disabled_for_testing(bool is_disabled_for_testing) { |
+ is_disabled_for_testing_ = is_disabled_for_testing; |
+ } |
+ static bool is_disabled_for_testing() { return is_disabled_for_testing_; } |
+ |
private: |
friend class CaptivePortalServiceTest; |
friend class CaptivePortalBrowserTest; |
@@ -211,6 +218,8 @@ |
base::OneShotTimer<CaptivePortalService> check_captive_portal_timer_; |
+ static bool is_disabled_for_testing_; |
+ |
DISALLOW_COPY_AND_ASSIGN(CaptivePortalService); |
}; |