| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 auth_needed_waiter.Wait(); | 340 auth_needed_waiter.Wait(); |
| 341 WindowedAuthCancelledObserver auth_cancelled_waiter(controller); | 341 WindowedAuthCancelledObserver auth_cancelled_waiter(controller); |
| 342 LoginHandler* handler = *observer.handlers().begin(); | 342 LoginHandler* handler = *observer.handlers().begin(); |
| 343 ASSERT_TRUE(handler); | 343 ASSERT_TRUE(handler); |
| 344 handler->CancelAuth(); | 344 handler->CancelAuth(); |
| 345 auth_cancelled_waiter.Wait(); | 345 auth_cancelled_waiter.Wait(); |
| 346 load_stop_waiter.Wait(); | 346 load_stop_waiter.Wait(); |
| 347 EXPECT_TRUE(observer.handlers().empty()); | 347 EXPECT_TRUE(observer.handlers().empty()); |
| 348 } | 348 } |
| 349 | 349 |
| 350 // Flaky on linux chromeos bots: crbug.com/648826. |
| 351 #if defined(OS_LINUX) && defined(OS_CHROMEOS) |
| 352 #define MAYBE_TestCancelAuth_OnNavigation DISABLED_TestCancelAuth_OnNavigation |
| 353 #else |
| 354 #define MAYBE_TestCancelAuth_OnNavigation TestCancelAuth_OnNavigation |
| 355 #endif |
| 350 // Test login prompt cancellation on navigation to a new page. | 356 // Test login prompt cancellation on navigation to a new page. |
| 351 IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, TestCancelAuth_OnNavigation) { | 357 IN_PROC_BROWSER_TEST_F(LoginPromptBrowserTest, |
| 358 MAYBE_TestCancelAuth_OnNavigation) { |
| 352 ASSERT_TRUE(embedded_test_server()->Start()); | 359 ASSERT_TRUE(embedded_test_server()->Start()); |
| 353 const GURL kAuthURL = embedded_test_server()->GetURL(kAuthBasicPage); | 360 const GURL kAuthURL = embedded_test_server()->GetURL(kAuthBasicPage); |
| 354 const GURL kNoAuthURL = embedded_test_server()->GetURL(kNoAuthPage1); | 361 const GURL kNoAuthURL = embedded_test_server()->GetURL(kNoAuthPage1); |
| 355 | 362 |
| 356 NavigationController* controller = | 363 NavigationController* controller = |
| 357 &browser()->tab_strip_model()->GetActiveWebContents()->GetController(); | 364 &browser()->tab_strip_model()->GetActiveWebContents()->GetController(); |
| 358 | 365 |
| 359 LoginPromptBrowserTestObserver observer; | 366 LoginPromptBrowserTestObserver observer; |
| 360 observer.Register(content::Source<NavigationController>(controller)); | 367 observer.Register(content::Source<NavigationController>(controller)); |
| 361 | 368 |
| (...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1488 // out. | 1495 // out. |
| 1489 EXPECT_TRUE( | 1496 EXPECT_TRUE( |
| 1490 WaitForRenderFrameReady(contents->GetInterstitialPage()->GetMainFrame())); | 1497 WaitForRenderFrameReady(contents->GetInterstitialPage()->GetMainFrame())); |
| 1491 EXPECT_TRUE(contents->ShowingInterstitialPage()); | 1498 EXPECT_TRUE(contents->ShowingInterstitialPage()); |
| 1492 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, contents->GetInterstitialPage() | 1499 EXPECT_EQ(SSLBlockingPage::kTypeForTesting, contents->GetInterstitialPage() |
| 1493 ->GetDelegateForTesting() | 1500 ->GetDelegateForTesting() |
| 1494 ->GetTypeForTesting()); | 1501 ->GetTypeForTesting()); |
| 1495 } | 1502 } |
| 1496 | 1503 |
| 1497 } // namespace | 1504 } // namespace |
| OLD | NEW |