| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <list> | 6 #include <list> |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 const GURL kAuthURL = embedded_test_server()->GetURL(kAuthBasicPage); | 354 const GURL kAuthURL = embedded_test_server()->GetURL(kAuthBasicPage); |
| 355 const GURL kNoAuthURL = embedded_test_server()->GetURL(kNoAuthPage1); | 355 const GURL kNoAuthURL = embedded_test_server()->GetURL(kNoAuthPage1); |
| 356 | 356 |
| 357 NavigationController* controller = | 357 NavigationController* controller = |
| 358 &browser()->tab_strip_model()->GetActiveWebContents()->GetController(); | 358 &browser()->tab_strip_model()->GetActiveWebContents()->GetController(); |
| 359 | 359 |
| 360 LoginPromptBrowserTestObserver observer; | 360 LoginPromptBrowserTestObserver observer; |
| 361 observer.Register(content::Source<NavigationController>(controller)); | 361 observer.Register(content::Source<NavigationController>(controller)); |
| 362 | 362 |
| 363 // One LOAD_STOP event for LoginInterstitial, second for kAuthURL and third | 363 // One LOAD_STOP event for LoginInterstitial, second for kAuthURL and third |
| 364 // for kNoAuthURL. | 364 // for kNoAuthURL, unless PlzNavigate is active, in which case the |
| 365 const int kLoadStopEvents = 3; | 365 // interrupted ongoing navigation does not receive LOAD_STOP. |
| 366 const int kLoadStopEvents = content::IsBrowserSideNavigationEnabled() ? 2 : 3; |
| 366 WindowedLoadStopObserver load_stop_waiter(controller, kLoadStopEvents); | 367 WindowedLoadStopObserver load_stop_waiter(controller, kLoadStopEvents); |
| 367 WindowedAuthNeededObserver auth_needed_waiter(controller); | 368 WindowedAuthNeededObserver auth_needed_waiter(controller); |
| 368 browser()->OpenURL(OpenURLParams(kAuthURL, Referrer(), | 369 browser()->OpenURL(OpenURLParams(kAuthURL, Referrer(), |
| 369 WindowOpenDisposition::CURRENT_TAB, | 370 WindowOpenDisposition::CURRENT_TAB, |
| 370 ui::PAGE_TRANSITION_TYPED, false)); | 371 ui::PAGE_TRANSITION_TYPED, false)); |
| 371 auth_needed_waiter.Wait(); | 372 auth_needed_waiter.Wait(); |
| 372 WindowedAuthCancelledObserver auth_cancelled_waiter(controller); | 373 WindowedAuthCancelledObserver auth_cancelled_waiter(controller); |
| 373 // Navigating while auth is requested is the same as cancelling. | 374 // Navigating while auth is requested is the same as cancelling. |
| 374 browser()->OpenURL(OpenURLParams(kNoAuthURL, Referrer(), | 375 browser()->OpenURL(OpenURLParams(kNoAuthURL, Referrer(), |
| 375 WindowOpenDisposition::CURRENT_TAB, | 376 WindowOpenDisposition::CURRENT_TAB, |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 // out. | 1495 // out. |
| 1495 EXPECT_TRUE( | 1496 EXPECT_TRUE( |
| 1496 WaitForRenderFrameReady(contents->GetInterstitialPage()->GetMainFrame())); | 1497 WaitForRenderFrameReady(contents->GetInterstitialPage()->GetMainFrame())); |
| 1497 EXPECT_TRUE(contents->ShowingInterstitialPage()); | 1498 EXPECT_TRUE(contents->ShowingInterstitialPage()); |
| 1498 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, contents->GetInterstitialPage() | 1499 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, contents->GetInterstitialPage() |
| 1499 ->GetDelegateForTesting() | 1500 ->GetDelegateForTesting() |
| 1500 ->GetTypeForTesting()); | 1501 ->GetTypeForTesting()); |
| 1501 } | 1502 } |
| 1502 | 1503 |
| 1503 } // namespace | 1504 } // namespace |
| OLD | NEW |