| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <map> | 5 #include <map> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 CaptivePortalTabReloader* GetTabReloader(WebContents* web_contents) const; | 939 CaptivePortalTabReloader* GetTabReloader(WebContents* web_contents) const; |
| 940 | 940 |
| 941 private: | 941 private: |
| 942 DISALLOW_COPY_AND_ASSIGN(CaptivePortalBrowserTest); | 942 DISALLOW_COPY_AND_ASSIGN(CaptivePortalBrowserTest); |
| 943 }; | 943 }; |
| 944 | 944 |
| 945 CaptivePortalBrowserTest::CaptivePortalBrowserTest() { | 945 CaptivePortalBrowserTest::CaptivePortalBrowserTest() { |
| 946 } | 946 } |
| 947 | 947 |
| 948 void CaptivePortalBrowserTest::SetUpOnMainThread() { | 948 void CaptivePortalBrowserTest::SetUpOnMainThread() { |
| 949 // Wait for the InstantNTP prerendered contents to load so it doesn't |
| 950 // interfere with the later checks. |
| 951 MultiNavigationObserver navigation_observer; |
| 952 navigation_observer.WaitForNavigations(1); |
| 953 |
| 949 // Enable mock requests. | 954 // Enable mock requests. |
| 950 content::BrowserThread::PostTask( | 955 content::BrowserThread::PostTask( |
| 951 content::BrowserThread::IO, FROM_HERE, | 956 content::BrowserThread::IO, FROM_HERE, |
| 952 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); | 957 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); |
| 953 URLRequestMockCaptivePortalJobFactory::AddUrlHandlers(); | 958 URLRequestMockCaptivePortalJobFactory::AddUrlHandlers(); |
| 954 | 959 |
| 955 // Double-check that the captive portal service isn't enabled by default for | 960 // Double-check that the captive portal service isn't enabled by default for |
| 956 // browser tests. | 961 // browser tests. |
| 957 EXPECT_EQ(CaptivePortalService::DISABLED_FOR_TESTING, | 962 EXPECT_EQ(CaptivePortalService::DISABLED_FOR_TESTING, |
| 958 CaptivePortalService::get_state_for_testing()); | 963 CaptivePortalService::get_state_for_testing()); |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2197 base::Bind(&AddHstsHost, | 2202 base::Bind(&AddHstsHost, |
| 2198 make_scoped_refptr(browser()->profile()->GetRequestContext()), | 2203 make_scoped_refptr(browser()->profile()->GetRequestContext()), |
| 2199 http_timeout_url.host())); | 2204 http_timeout_url.host())); |
| 2200 | 2205 |
| 2201 SlowLoadBehindCaptivePortal(browser(), true, http_timeout_url, 1, 1); | 2206 SlowLoadBehindCaptivePortal(browser(), true, http_timeout_url, 1, 1); |
| 2202 Login(browser(), 1, 0); | 2207 Login(browser(), 1, 0); |
| 2203 FailLoadsAfterLogin(browser(), 1); | 2208 FailLoadsAfterLogin(browser(), 1); |
| 2204 } | 2209 } |
| 2205 | 2210 |
| 2206 } // namespace captive_portal | 2211 } // namespace captive_portal |
| OLD | NEW |