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 <memory> | 6 #include <memory> |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2282 // tabs to stop loading before navigating. | 2282 // tabs to stop loading before navigating. |
2283 CaptivePortalObserver portal_observer(browser()->profile()); | 2283 CaptivePortalObserver portal_observer(browser()->profile()); |
2284 MultiNavigationObserver test_navigation_observer; | 2284 MultiNavigationObserver test_navigation_observer; |
2285 browser()->OpenURL(content::OpenURLParams(cert_error_url, content::Referrer(), | 2285 browser()->OpenURL(content::OpenURLParams(cert_error_url, content::Referrer(), |
2286 WindowOpenDisposition::CURRENT_TAB, | 2286 WindowOpenDisposition::CURRENT_TAB, |
2287 ui::PAGE_TRANSITION_TYPED, false)); | 2287 ui::PAGE_TRANSITION_TYPED, false)); |
2288 // Expect three navigations: | 2288 // Expect three navigations: |
2289 // 1- For stopping the hanging page. | 2289 // 1- For stopping the hanging page. |
2290 // 2- For completing the load of the above navigation. | 2290 // 2- For completing the load of the above navigation. |
2291 // 3- For completing the load of the login tab. | 2291 // 3- For completing the load of the login tab. |
2292 // NOTE: for PlzNaviate the first one doesn't show up. | 2292 // NOTE: for PlzNavigate the first one doesn't show up. |
2293 test_navigation_observer.WaitForNavigations( | 2293 test_navigation_observer.WaitForNavigations( |
2294 content::IsBrowserSideNavigationEnabled() ? 2 : 3); | 2294 content::IsBrowserSideNavigationEnabled() ? 2 : 3); |
2295 // Should end up with a captive portal interstitial and a new login tab. | 2295 // Should end up with a captive portal interstitial and a new login tab. |
2296 WaitForInterstitialAttach(broken_tab_contents); | 2296 WaitForInterstitialAttach(broken_tab_contents); |
2297 ASSERT_TRUE(broken_tab_contents->ShowingInterstitialPage()); | 2297 ASSERT_TRUE(broken_tab_contents->ShowingInterstitialPage()); |
2298 EXPECT_EQ(CaptivePortalBlockingPage::kTypeForTesting, | 2298 EXPECT_EQ(CaptivePortalBlockingPage::kTypeForTesting, |
2299 broken_tab_contents->GetInterstitialPage() | 2299 broken_tab_contents->GetInterstitialPage() |
2300 ->GetDelegateForTesting() | 2300 ->GetDelegateForTesting() |
2301 ->GetTypeForTesting()); | 2301 ->GetTypeForTesting()); |
2302 ASSERT_EQ(initial_tab_count + 1, tab_strip_model->count()); | 2302 ASSERT_EQ(initial_tab_count + 1, tab_strip_model->count()); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2830 | 2830 |
2831 EXPECT_EQ(CaptivePortalTabReloader::STATE_NEEDS_RELOAD, | 2831 EXPECT_EQ(CaptivePortalTabReloader::STATE_NEEDS_RELOAD, |
2832 GetStateOfTabReloaderAt(browser(), broken_tab_index)); | 2832 GetStateOfTabReloaderAt(browser(), broken_tab_index)); |
2833 | 2833 |
2834 WaitForInterstitialAttach(broken_tab_contents); | 2834 WaitForInterstitialAttach(broken_tab_contents); |
2835 portal_observer.WaitForResults(1); | 2835 portal_observer.WaitForResults(1); |
2836 | 2836 |
2837 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, | 2837 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, |
2838 GetInterstitialType(broken_tab_contents)); | 2838 GetInterstitialType(broken_tab_contents)); |
2839 } | 2839 } |
OLD | NEW |