Index: chrome/browser/captive_portal/captive_portal_service.cc |
diff --git a/chrome/browser/captive_portal/captive_portal_service.cc b/chrome/browser/captive_portal/captive_portal_service.cc |
index 93c37a8c1b81f69c8f9c174e934e7a1276f8a3bd..26248862a6cfb05da801d7dc5b518260f7630b62 100644 |
--- a/chrome/browser/captive_portal/captive_portal_service.cc |
+++ b/chrome/browser/captive_portal/captive_portal_service.cc |
@@ -214,6 +214,10 @@ CaptivePortalService::~CaptivePortalService() { |
void CaptivePortalService::DetectCaptivePortal() { |
DCHECK(CalledOnValidThread()); |
+ // Detection should be disabled only in tests. |
+ if (testing_state_ == IGNORE_REQUESTS_FOR_TESTING) |
+ return; |
+ |
// If a request is pending or running, do nothing. |
if (state_ == STATE_CHECKING_FOR_PORTAL || state_ == STATE_TIMER_RUNNING) |
return; |