| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestOKHTTPS) { | 270 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestOKHTTPS) { |
| 271 ASSERT_TRUE(https_server_.Start()); | 271 ASSERT_TRUE(https_server_.Start()); |
| 272 | 272 |
| 273 ui_test_utils::NavigateToURL(browser(), | 273 ui_test_utils::NavigateToURL(browser(), |
| 274 https_server_.GetURL("files/ssl/google.html")); | 274 https_server_.GetURL("files/ssl/google.html")); |
| 275 | 275 |
| 276 CheckAuthenticatedState(browser()->GetSelectedTabContents(), false); | 276 CheckAuthenticatedState(browser()->GetSelectedTabContents(), false); |
| 277 } | 277 } |
| 278 | 278 |
| 279 // Visits a page with https error and proceed: | 279 // Visits a page with https error and proceed: |
| 280 // Disabled, http://crbug.com/68448. | 280 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndProceed) { |
| 281 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestHTTPSExpiredCertAndProceed) { | |
| 282 ASSERT_TRUE(https_server_expired_.Start()); | 281 ASSERT_TRUE(https_server_expired_.Start()); |
| 283 | 282 |
| 284 ui_test_utils::NavigateToURL(browser(), | 283 ui_test_utils::NavigateToURL(browser(), |
| 285 https_server_expired_.GetURL("files/ssl/google.html")); | 284 https_server_expired_.GetURL("files/ssl/google.html")); |
| 286 | 285 |
| 287 TabContents* tab = browser()->GetSelectedTabContents(); | 286 TabContents* tab = browser()->GetSelectedTabContents(); |
| 288 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 287 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 289 true); // Interstitial showing | 288 true); // Interstitial showing |
| 290 | 289 |
| 291 ProceedThroughInterstitial(tab); | 290 ProceedThroughInterstitial(tab); |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 | 781 |
| 783 // Load again but over SSL. It should be marked as displaying insecure | 782 // Load again but over SSL. It should be marked as displaying insecure |
| 784 // content (even though the image comes from the WebCore memory cache). | 783 // content (even though the image comes from the WebCore memory cache). |
| 785 const GURL url_https = https_server_.GetURL(replacement_path); | 784 const GURL url_https = https_server_.GetURL(replacement_path); |
| 786 ui_test_utils::NavigateToURL(browser(), url_https); | 785 ui_test_utils::NavigateToURL(browser(), url_https); |
| 787 CheckAuthenticationBrokenState(tab, 0, true, false); | 786 CheckAuthenticationBrokenState(tab, 0, true, false); |
| 788 } | 787 } |
| 789 | 788 |
| 790 // This test ensures the CN invalid status does not 'stick' to a certificate | 789 // This test ensures the CN invalid status does not 'stick' to a certificate |
| 791 // (see bug #1044942) and that it depends on the host-name. | 790 // (see bug #1044942) and that it depends on the host-name. |
| 792 // Disabled, see http://crbug.com/68448 and http://crbug.com/49377. | 791 IN_PROC_BROWSER_TEST_F(SSLUITest, TestCNInvalidStickiness) { |
| 793 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestCNInvalidStickiness) { | |
| 794 ASSERT_TRUE(https_server_.Start()); | 792 ASSERT_TRUE(https_server_.Start()); |
| 795 ASSERT_TRUE(https_server_mismatched_.Start()); | 793 ASSERT_TRUE(https_server_mismatched_.Start()); |
| 796 | 794 |
| 797 // First we hit the server with hostname, this generates an invalid policy | 795 // First we hit the server with hostname, this generates an invalid policy |
| 798 // error. | 796 // error. |
| 799 ui_test_utils::NavigateToURL(browser(), | 797 ui_test_utils::NavigateToURL(browser(), |
| 800 https_server_mismatched_.GetURL("files/ssl/google.html")); | 798 https_server_mismatched_.GetURL("files/ssl/google.html")); |
| 801 | 799 |
| 802 // We get an interstitial page as a result. | 800 // We get an interstitial page as a result. |
| 803 TabContents* tab = browser()->GetSelectedTabContents(); | 801 TabContents* tab = browser()->GetSelectedTabContents(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 825 | 823 |
| 826 #if defined(OS_CHROMEOS) | 824 #if defined(OS_CHROMEOS) |
| 827 // This test seems to be flaky and hang on chromiumos. | 825 // This test seems to be flaky and hang on chromiumos. |
| 828 // http://crbug.com/84419 | 826 // http://crbug.com/84419 |
| 829 #define MAYBE_TestRefNavigation DISABLED_TestRefNavigation | 827 #define MAYBE_TestRefNavigation DISABLED_TestRefNavigation |
| 830 #else | 828 #else |
| 831 #define MAYBE_TestRefNavigation TestRefNavigation | 829 #define MAYBE_TestRefNavigation TestRefNavigation |
| 832 #endif | 830 #endif |
| 833 | 831 |
| 834 // Test that navigating to a #ref does not change a bad security state. | 832 // Test that navigating to a #ref does not change a bad security state. |
| 835 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestRefNavigation) { | 833 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRefNavigation) { |
| 836 ASSERT_TRUE(https_server_expired_.Start()); | 834 ASSERT_TRUE(https_server_expired_.Start()); |
| 837 | 835 |
| 838 ui_test_utils::NavigateToURL(browser(), | 836 ui_test_utils::NavigateToURL(browser(), |
| 839 https_server_expired_.GetURL("files/ssl/page_with_refs.html")); | 837 https_server_expired_.GetURL("files/ssl/page_with_refs.html")); |
| 840 | 838 |
| 841 TabContents* tab = browser()->GetSelectedTabContents(); | 839 TabContents* tab = browser()->GetSelectedTabContents(); |
| 842 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 840 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 843 true); // Interstitial showing. | 841 true); // Interstitial showing. |
| 844 | 842 |
| 845 ProceedThroughInterstitial(tab); | 843 ProceedThroughInterstitial(tab); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 content::NOTIFICATION_LOAD_STOP, | 890 content::NOTIFICATION_LOAD_STOP, |
| 893 content::NotificationService::AllSources()); | 891 content::NotificationService::AllSources()); |
| 894 browser()->AddSelectedTabWithURL(url, content::PAGE_TRANSITION_TYPED); | 892 browser()->AddSelectedTabWithURL(url, content::PAGE_TRANSITION_TYPED); |
| 895 observer.Wait(); | 893 observer.Wait(); |
| 896 | 894 |
| 897 // Close the first tab. | 895 // Close the first tab. |
| 898 browser()->CloseTabContents(tab1); | 896 browser()->CloseTabContents(tab1); |
| 899 } | 897 } |
| 900 | 898 |
| 901 // Visit a page over bad https that is a redirect to a page with good https. | 899 // Visit a page over bad https that is a redirect to a page with good https. |
| 902 // Crashes: http://crbug.com/77374 | 900 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectBadToGoodHTTPS) { |
| 903 // Previously marked as flaky: http://crbug.com/40932 | |
| 904 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestRedirectBadToGoodHTTPS) { | |
| 905 ASSERT_TRUE(https_server_.Start()); | 901 ASSERT_TRUE(https_server_.Start()); |
| 906 ASSERT_TRUE(https_server_expired_.Start()); | 902 ASSERT_TRUE(https_server_expired_.Start()); |
| 907 | 903 |
| 908 GURL url1 = https_server_expired_.GetURL("server-redirect?"); | 904 GURL url1 = https_server_expired_.GetURL("server-redirect?"); |
| 909 GURL url2 = https_server_.GetURL("files/ssl/google.html"); | 905 GURL url2 = https_server_.GetURL("files/ssl/google.html"); |
| 910 | 906 |
| 911 ui_test_utils::NavigateToURL(browser(), GURL(url1.spec() + url2.spec())); | 907 ui_test_utils::NavigateToURL(browser(), GURL(url1.spec() + url2.spec())); |
| 912 | 908 |
| 913 TabContents* tab = browser()->GetSelectedTabContents(); | 909 TabContents* tab = browser()->GetSelectedTabContents(); |
| 914 | 910 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 935 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 931 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 936 true); // Interstitial showing. | 932 true); // Interstitial showing. |
| 937 | 933 |
| 938 ProceedThroughInterstitial(tab); | 934 ProceedThroughInterstitial(tab); |
| 939 | 935 |
| 940 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 936 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 941 false); // No interstitial showing. | 937 false); // No interstitial showing. |
| 942 } | 938 } |
| 943 | 939 |
| 944 // Visit a page over http that is a redirect to a page with good HTTPS. | 940 // Visit a page over http that is a redirect to a page with good HTTPS. |
| 945 // Disabled, http://crbug.com/70216. | 941 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectHTTPToGoodHTTPS) { |
| 946 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestRedirectHTTPToGoodHTTPS) { | |
| 947 ASSERT_TRUE(test_server()->Start()); | 942 ASSERT_TRUE(test_server()->Start()); |
| 948 ASSERT_TRUE(https_server_.Start()); | 943 ASSERT_TRUE(https_server_.Start()); |
| 949 | 944 |
| 950 TabContents* tab = browser()->GetSelectedTabContents(); | 945 TabContents* tab = browser()->GetSelectedTabContents(); |
| 951 | 946 |
| 952 // HTTP redirects to good HTTPS. | 947 // HTTP redirects to good HTTPS. |
| 953 GURL http_url = test_server()->GetURL("server-redirect?"); | 948 GURL http_url = test_server()->GetURL("server-redirect?"); |
| 954 GURL good_https_url = | 949 GURL good_https_url = |
| 955 https_server_.GetURL("files/ssl/google.html"); | 950 https_server_.GetURL("files/ssl/google.html"); |
| 956 | 951 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 | 1003 |
| 1009 // | 1004 // |
| 1010 // Frame navigation | 1005 // Frame navigation |
| 1011 // | 1006 // |
| 1012 | 1007 |
| 1013 // From a good HTTPS top frame: | 1008 // From a good HTTPS top frame: |
| 1014 // - navigate to an OK HTTPS frame | 1009 // - navigate to an OK HTTPS frame |
| 1015 // - navigate to a bad HTTPS (expect unsafe content and filtered frame), then | 1010 // - navigate to a bad HTTPS (expect unsafe content and filtered frame), then |
| 1016 // back | 1011 // back |
| 1017 // - navigate to HTTP (expect insecure content), then back | 1012 // - navigate to HTTP (expect insecure content), then back |
| 1018 // Disabled, http://crbug.com/18626. | 1013 IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { |
| 1019 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestGoodFrameNavigation) { | |
| 1020 ASSERT_TRUE(test_server()->Start()); | 1014 ASSERT_TRUE(test_server()->Start()); |
| 1021 ASSERT_TRUE(https_server_.Start()); | 1015 ASSERT_TRUE(https_server_.Start()); |
| 1022 ASSERT_TRUE(https_server_expired_.Start()); | 1016 ASSERT_TRUE(https_server_expired_.Start()); |
| 1023 | 1017 |
| 1024 std::string top_frame_path; | 1018 std::string top_frame_path; |
| 1025 ASSERT_TRUE(GetTopFramePath(*test_server(), | 1019 ASSERT_TRUE(GetTopFramePath(*test_server(), |
| 1026 https_server_, | 1020 https_server_, |
| 1027 https_server_expired_, | 1021 https_server_expired_, |
| 1028 &top_frame_path)); | 1022 &top_frame_path)); |
| 1029 | 1023 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 | 1299 |
| 1306 // Visit a page over https that contains a frame with a redirect. | 1300 // Visit a page over https that contains a frame with a redirect. |
| 1307 | 1301 |
| 1308 // XMLHttpRequest insecure content in synchronous mode. | 1302 // XMLHttpRequest insecure content in synchronous mode. |
| 1309 | 1303 |
| 1310 // XMLHttpRequest insecure content in asynchronous mode. | 1304 // XMLHttpRequest insecure content in asynchronous mode. |
| 1311 | 1305 |
| 1312 // XMLHttpRequest over bad ssl in synchronous mode. | 1306 // XMLHttpRequest over bad ssl in synchronous mode. |
| 1313 | 1307 |
| 1314 // XMLHttpRequest over OK ssl in synchronous mode. | 1308 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |