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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 ASSERT_TRUE(https_server_.Start()); | 441 ASSERT_TRUE(https_server_.Start()); |
442 | 442 |
443 ui_test_utils::NavigateToURL(browser(), | 443 ui_test_utils::NavigateToURL(browser(), |
444 https_server_.GetURL("files/ssl/google.html")); | 444 https_server_.GetURL("files/ssl/google.html")); |
445 | 445 |
446 CheckAuthenticatedState(browser()->tab_strip_model()->GetActiveWebContents(), | 446 CheckAuthenticatedState(browser()->tab_strip_model()->GetActiveWebContents(), |
447 AuthState::NONE); | 447 AuthState::NONE); |
448 } | 448 } |
449 | 449 |
450 // Visits a page with https error and proceed: | 450 // Visits a page with https error and proceed: |
451 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndProceed) { | 451 #if defined(OS_LINUX) |
| 452 // flaky http://crbug.com/396462 |
| 453 #define MAYBE_TestHTTPSExpiredCertAndProceed \ |
| 454 DISABLED_TestHTTPSExpiredCertAndProceed |
| 455 #else |
| 456 #define MAYBE_TestHTTPSExpiredCertAndProceed TestHTTPSExpiredCertAndProceed |
| 457 #endif |
| 458 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestHTTPSExpiredCertAndProceed) { |
452 ASSERT_TRUE(https_server_expired_.Start()); | 459 ASSERT_TRUE(https_server_expired_.Start()); |
453 | 460 |
454 ui_test_utils::NavigateToURL(browser(), | 461 ui_test_utils::NavigateToURL(browser(), |
455 https_server_expired_.GetURL("files/ssl/google.html")); | 462 https_server_expired_.GetURL("files/ssl/google.html")); |
456 | 463 |
457 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 464 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
458 CheckAuthenticationBrokenState( | 465 CheckAuthenticationBrokenState( |
459 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); | 466 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); |
460 | 467 |
461 ProceedThroughInterstitial(tab); | 468 ProceedThroughInterstitial(tab); |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 bool js_result = false; | 988 bool js_result = false; |
982 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 989 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
983 tab, | 990 tab, |
984 "window.domAutomationController.send(IsFooSet());", | 991 "window.domAutomationController.send(IsFooSet());", |
985 &js_result)); | 992 &js_result)); |
986 EXPECT_FALSE(js_result); | 993 EXPECT_FALSE(js_result); |
987 } | 994 } |
988 | 995 |
989 // Visits a page with insecure content loaded by JS (after the initial page | 996 // Visits a page with insecure content loaded by JS (after the initial page |
990 // load). | 997 // load). |
991 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentLoadedFromJS) { | 998 #if defined(OS_LINUX) |
| 999 // flaky http://crbug.com/396462 |
| 1000 #define MAYBE_TestDisplaysInsecureContentLoadedFromJS \ |
| 1001 DISABLED_TestDisplaysInsecureContentLoadedFromJS |
| 1002 #else |
| 1003 #define MAYBE_TestDisplaysInsecureContentLoadedFromJS \ |
| 1004 TestDisplaysInsecureContentLoadedFromJS |
| 1005 #endif |
| 1006 IN_PROC_BROWSER_TEST_F(SSLUITest, |
| 1007 MAYBE_TestDisplaysInsecureContentLoadedFromJS) { |
992 ASSERT_TRUE(test_server()->Start()); | 1008 ASSERT_TRUE(test_server()->Start()); |
993 ASSERT_TRUE(https_server_.Start()); | 1009 ASSERT_TRUE(https_server_.Start()); |
994 | 1010 |
995 std::string replacement_path; | 1011 std::string replacement_path; |
996 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( | 1012 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( |
997 "files/ssl/page_with_dynamic_insecure_content.html", | 1013 "files/ssl/page_with_dynamic_insecure_content.html", |
998 test_server()->host_port_pair(), | 1014 test_server()->host_port_pair(), |
999 &replacement_path)); | 1015 &replacement_path)); |
1000 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 1016 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( |
1001 replacement_path)); | 1017 replacement_path)); |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 // We shouldn't have an interstitial page showing here. | 1764 // We shouldn't have an interstitial page showing here. |
1749 | 1765 |
1750 // Test page run a WebSocket wss connection test. The result will be shown | 1766 // Test page run a WebSocket wss connection test. The result will be shown |
1751 // as page title. | 1767 // as page title. |
1752 const base::string16 result = watcher.WaitAndGetTitle(); | 1768 const base::string16 result = watcher.WaitAndGetTitle(); |
1753 EXPECT_TRUE(LowerCaseEqualsASCII(result, "pass")); | 1769 EXPECT_TRUE(LowerCaseEqualsASCII(result, "pass")); |
1754 } | 1770 } |
1755 | 1771 |
1756 // Verifies that the interstitial can proceed, even if JavaScript is disabled. | 1772 // Verifies that the interstitial can proceed, even if JavaScript is disabled. |
1757 // http://crbug.com/322948 | 1773 // http://crbug.com/322948 |
1758 IN_PROC_BROWSER_TEST_F(SSLUITest, TestInterstitialJavaScriptProceeds) { | 1774 #if defined(OS_LINUX) |
| 1775 // flaky http://crbug.com/396458 |
| 1776 #define MAYBE_TestInterstitialJavaScriptProceeds \ |
| 1777 DISABLED_TestInterstitialJavaScriptProceeds |
| 1778 #else |
| 1779 #define MAYBE_TestInterstitialJavaScriptProceeds \ |
| 1780 TestInterstitialJavaScriptProceeds |
| 1781 #endif |
| 1782 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestInterstitialJavaScriptProceeds) { |
1759 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( | 1783 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( |
1760 CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK); | 1784 CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK); |
1761 | 1785 |
1762 ASSERT_TRUE(https_server_expired_.Start()); | 1786 ASSERT_TRUE(https_server_expired_.Start()); |
1763 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 1787 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
1764 ui_test_utils::NavigateToURL(browser(), | 1788 ui_test_utils::NavigateToURL(browser(), |
1765 https_server_expired_.GetURL("files/ssl/google.html")); | 1789 https_server_expired_.GetURL("files/ssl/google.html")); |
1766 CheckAuthenticationBrokenState( | 1790 CheckAuthenticationBrokenState( |
1767 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); | 1791 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); |
1768 | 1792 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1845 | 1869 |
1846 // Visit a page over https that contains a frame with a redirect. | 1870 // Visit a page over https that contains a frame with a redirect. |
1847 | 1871 |
1848 // XMLHttpRequest insecure content in synchronous mode. | 1872 // XMLHttpRequest insecure content in synchronous mode. |
1849 | 1873 |
1850 // XMLHttpRequest insecure content in asynchronous mode. | 1874 // XMLHttpRequest insecure content in asynchronous mode. |
1851 | 1875 |
1852 // XMLHttpRequest over bad ssl in synchronous mode. | 1876 // XMLHttpRequest over bad ssl in synchronous mode. |
1853 | 1877 |
1854 // XMLHttpRequest over OK ssl in synchronous mode. | 1878 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |