| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/time.h" | 6 #include "base/time.h" |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
| 11 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 11 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
| 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
| 16 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
| 17 #include "content/browser/renderer_host/test_render_view_host.h" | |
| 18 #include "content/public/browser/interstitial_page.h" | 17 #include "content/public/browser/interstitial_page.h" |
| 19 #include "content/public/browser/navigation_controller.h" | 18 #include "content/public/browser/navigation_controller.h" |
| 20 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
| 21 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
| 22 #include "content/public/browser/render_view_host.h" | 21 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 24 #include "content/public/browser/web_contents_observer.h" | 23 #include "content/public/browser/web_contents_observer.h" |
| 25 #include "content/public/common/security_style.h" | 24 #include "content/public/common/security_style.h" |
| 26 #include "content/public/common/ssl_status.h" | 25 #include "content/public/common/ssl_status.h" |
| 26 #include "content/test/test_renderer_host.h" |
| 27 #include "net/base/cert_status_flags.h" | 27 #include "net/base/cert_status_flags.h" |
| 28 #include "net/test/test_server.h" | 28 #include "net/test/test_server.h" |
| 29 | 29 |
| 30 using content::InterstitialPage; | 30 using content::InterstitialPage; |
| 31 using content::NavigationController; | 31 using content::NavigationController; |
| 32 using content::NavigationEntry; | 32 using content::NavigationEntry; |
| 33 using content::SSLStatus; | 33 using content::SSLStatus; |
| 34 using content::WebContents; | 34 using content::WebContents; |
| 35 | 35 |
| 36 const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); | 36 const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 true); // Interstitial showing | 418 true); // Interstitial showing |
| 419 | 419 |
| 420 ProvisionalLoadWaiter load_failed_observer(tab); | 420 ProvisionalLoadWaiter load_failed_observer(tab); |
| 421 | 421 |
| 422 // Simulate user clicking on back button (crbug.com/39248). | 422 // Simulate user clicking on back button (crbug.com/39248). |
| 423 browser()->GoBack(CURRENT_TAB); | 423 browser()->GoBack(CURRENT_TAB); |
| 424 | 424 |
| 425 // Wait until we hear the load failure, and make sure we haven't swapped out | 425 // Wait until we hear the load failure, and make sure we haven't swapped out |
| 426 // the previous page. Prevents regression of http://crbug.com/82667. | 426 // the previous page. Prevents regression of http://crbug.com/82667. |
| 427 load_failed_observer.Wait(); | 427 load_failed_observer.Wait(); |
| 428 EXPECT_FALSE(content::TestRenderViewHost::IsRenderViewHostSwappedOut( | 428 EXPECT_FALSE(content::RenderViewHostTester::IsRenderViewHostSwappedOut( |
| 429 tab->GetRenderViewHost())); | 429 tab->GetRenderViewHost())); |
| 430 | 430 |
| 431 // We should be back at the original good page. | 431 // We should be back at the original good page. |
| 432 EXPECT_FALSE(browser()->GetSelectedWebContents()->GetInterstitialPage()); | 432 EXPECT_FALSE(browser()->GetSelectedWebContents()->GetInterstitialPage()); |
| 433 CheckUnauthenticatedState(tab); | 433 CheckUnauthenticatedState(tab); |
| 434 } | 434 } |
| 435 | 435 |
| 436 // Visits a page with https error and then goes back using GoToOffset. | 436 // Visits a page with https error and then goes back using GoToOffset. |
| 437 // Disabled because its flaky: http://crbug.com/40932, http://crbug.com/43575. | 437 // Disabled because its flaky: http://crbug.com/40932, http://crbug.com/43575. |
| 438 IN_PROC_BROWSER_TEST_F(SSLUITest, | 438 IN_PROC_BROWSER_TEST_F(SSLUITest, |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 | 1364 |
| 1365 // Visit a page over https that contains a frame with a redirect. | 1365 // Visit a page over https that contains a frame with a redirect. |
| 1366 | 1366 |
| 1367 // XMLHttpRequest insecure content in synchronous mode. | 1367 // XMLHttpRequest insecure content in synchronous mode. |
| 1368 | 1368 |
| 1369 // XMLHttpRequest insecure content in asynchronous mode. | 1369 // XMLHttpRequest insecure content in asynchronous mode. |
| 1370 | 1370 |
| 1371 // XMLHttpRequest over bad ssl in synchronous mode. | 1371 // XMLHttpRequest over bad ssl in synchronous mode. |
| 1372 | 1372 |
| 1373 // XMLHttpRequest over OK ssl in synchronous mode. | 1373 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |