| 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 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1703 navigation_observer.WaitForNavigations(1); | 1703 navigation_observer.WaitForNavigations(1); |
| 1704 | 1704 |
| 1705 EXPECT_EQ(1, navigation_observer.NumNavigationsForTab( | 1705 EXPECT_EQ(1, navigation_observer.NumNavigationsForTab( |
| 1706 chrome::GetWebContentsAt(browser(), 0))); | 1706 chrome::GetWebContentsAt(browser(), 0))); |
| 1707 EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, | 1707 EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, |
| 1708 GetStateOfTabReloaderAt(browser(), 0)); | 1708 GetStateOfTabReloaderAt(browser(), 0)); |
| 1709 EXPECT_EQ(0, portal_observer.num_results_received()); | 1709 EXPECT_EQ(0, portal_observer.num_results_received()); |
| 1710 } | 1710 } |
| 1711 | 1711 |
| 1712 // Checks that navigating back to a timeout triggers captive portal detection. | 1712 // Checks that navigating back to a timeout triggers captive portal detection. |
| 1713 IN_PROC_BROWSER_TEST_F(CaptivePortalBrowserTest, GoBackToTimeout) { | 1713 // Disabled: http://crbug.com/136310 |
| 1714 IN_PROC_BROWSER_TEST_F(CaptivePortalBrowserTest, DISABLED_GoBackToTimeout) { |
| 1714 // Disable captive portal detection so the first navigation doesn't open a | 1715 // Disable captive portal detection so the first navigation doesn't open a |
| 1715 // login tab. | 1716 // login tab. |
| 1716 EnableCaptivePortalDetection(browser()->profile(), false); | 1717 EnableCaptivePortalDetection(browser()->profile(), false); |
| 1717 | 1718 |
| 1718 SlowLoadNoCaptivePortal(browser(), RESULT_INTERNET_CONNECTED); | 1719 SlowLoadNoCaptivePortal(browser(), RESULT_INTERNET_CONNECTED); |
| 1719 | 1720 |
| 1720 // Navigate to a working page. | 1721 // Navigate to a working page. |
| 1721 ui_test_utils::NavigateToURL(browser(), | 1722 ui_test_utils::NavigateToURL(browser(), |
| 1722 URLRequestMockHTTPJob::GetMockUrl( | 1723 URLRequestMockHTTPJob::GetMockUrl( |
| 1723 FilePath(FILE_PATH_LITERAL("title2.html")))); | 1724 FilePath(FILE_PATH_LITERAL("title2.html")))); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1760 EXPECT_EQ(1, NumLoadingTabs()); | 1761 EXPECT_EQ(1, NumLoadingTabs()); |
| 1761 | 1762 |
| 1762 SetSlowSSLLoadTime(tab_reloader, base::TimeDelta::FromDays(1)); | 1763 SetSlowSSLLoadTime(tab_reloader, base::TimeDelta::FromDays(1)); |
| 1763 Login(browser(), 1, 0); | 1764 Login(browser(), 1, 0); |
| 1764 FailLoadsAfterLogin(browser(), 1); | 1765 FailLoadsAfterLogin(browser(), 1); |
| 1765 } | 1766 } |
| 1766 | 1767 |
| 1767 // Checks that reloading a timeout triggers captive portal detection. | 1768 // Checks that reloading a timeout triggers captive portal detection. |
| 1768 // Much like the last test, though the captive portal is disabled before | 1769 // Much like the last test, though the captive portal is disabled before |
| 1769 // the inital navigation, rather than captive portal detection. | 1770 // the inital navigation, rather than captive portal detection. |
| 1770 IN_PROC_BROWSER_TEST_F(CaptivePortalBrowserTest, ReloadTimeout) { | 1771 // Disabled: http://crbug.com/136310 |
| 1772 IN_PROC_BROWSER_TEST_F(CaptivePortalBrowserTest, DISABLED_ReloadTimeout) { |
| 1771 URLRequestMockCaptivePortalJobFactory::SetBehindCaptivePortal(false); | 1773 URLRequestMockCaptivePortalJobFactory::SetBehindCaptivePortal(false); |
| 1772 | 1774 |
| 1773 // Do the first navigation while not behind a captive portal. | 1775 // Do the first navigation while not behind a captive portal. |
| 1774 CaptivePortalObserver portal_observer(browser()->profile()); | 1776 CaptivePortalObserver portal_observer(browser()->profile()); |
| 1775 ui_test_utils::NavigateToURL(browser(), GURL(kMockHttpsUrl)); | 1777 ui_test_utils::NavigateToURL(browser(), GURL(kMockHttpsUrl)); |
| 1776 ASSERT_EQ(0, portal_observer.num_results_received()); | 1778 ASSERT_EQ(0, portal_observer.num_results_received()); |
| 1777 ASSERT_EQ(1, browser()->tab_count()); | 1779 ASSERT_EQ(1, browser()->tab_count()); |
| 1778 | 1780 |
| 1779 // A captive portal spontaneously appears. | 1781 // A captive portal spontaneously appears. |
| 1780 URLRequestMockCaptivePortalJobFactory::SetBehindCaptivePortal(true); | 1782 URLRequestMockCaptivePortalJobFactory::SetBehindCaptivePortal(true); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 GetStateOfTabReloaderAt(active_browser, 0)); | 1891 GetStateOfTabReloaderAt(active_browser, 0)); |
| 1890 EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, | 1892 EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, |
| 1891 GetStateOfTabReloaderAt(active_browser, 1)); | 1893 GetStateOfTabReloaderAt(active_browser, 1)); |
| 1892 EXPECT_TRUE(IsLoginTab(chrome::GetTabContentsAt(active_browser, 1))); | 1894 EXPECT_TRUE(IsLoginTab(chrome::GetTabContentsAt(active_browser, 1))); |
| 1893 | 1895 |
| 1894 // Simulate logging in. | 1896 // Simulate logging in. |
| 1895 Login(active_browser, 0, 1); | 1897 Login(active_browser, 0, 1); |
| 1896 } | 1898 } |
| 1897 | 1899 |
| 1898 } // namespace captive_portal | 1900 } // namespace captive_portal |
| OLD | NEW |