Chromium Code Reviews| 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 DISABLED_TestHTTPSExpiredCertAndPro ceed | |
|
viettrungluu
2014/07/23 15:26:42
nit (here and below): you can avoid the line longe
jam
2014/07/23 16:02:06
Done.
| |
| 454 #else | |
| 455 #define MAYBE_TestHTTPSExpiredCertAndProceed TestHTTPSExpiredCertAndProceed | |
| 456 #endif | |
| 457 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestHTTPSExpiredCertAndProceed) { | |
| 452 ASSERT_TRUE(https_server_expired_.Start()); | 458 ASSERT_TRUE(https_server_expired_.Start()); |
| 453 | 459 |
| 454 ui_test_utils::NavigateToURL(browser(), | 460 ui_test_utils::NavigateToURL(browser(), |
| 455 https_server_expired_.GetURL("files/ssl/google.html")); | 461 https_server_expired_.GetURL("files/ssl/google.html")); |
| 456 | 462 |
| 457 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 463 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
| 458 CheckAuthenticationBrokenState( | 464 CheckAuthenticationBrokenState( |
| 459 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); | 465 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); |
| 460 | 466 |
| 461 ProceedThroughInterstitial(tab); | 467 ProceedThroughInterstitial(tab); |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 982 bool js_result = false; | 988 bool js_result = false; |
| 983 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 989 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
| 984 tab, | 990 tab, |
| 985 "window.domAutomationController.send(IsFooSet());", | 991 "window.domAutomationController.send(IsFooSet());", |
| 986 &js_result)); | 992 &js_result)); |
| 987 EXPECT_FALSE(js_result); | 993 EXPECT_FALSE(js_result); |
| 988 } | 994 } |
| 989 | 995 |
| 990 // 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 |
| 991 // load). | 997 // load). |
| 992 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentLoadedFromJS) { | 998 #if defined(OS_LINUX) |
| 999 // flaky http://crbug.com/396462 | |
| 1000 #define MAYBE_TestDisplaysInsecureContentLoadedFromJS DISABLED_TestDisplaysInsec ureContentLoadedFromJS | |
| 1001 #else | |
| 1002 #define MAYBE_TestDisplaysInsecureContentLoadedFromJS TestDisplaysInsecureConten tLoadedFromJS | |
| 1003 #endif | |
| 1004 IN_PROC_BROWSER_TEST_F(SSLUITest, | |
| 1005 MAYBE_TestDisplaysInsecureContentLoadedFromJS) { | |
| 993 ASSERT_TRUE(test_server()->Start()); | 1006 ASSERT_TRUE(test_server()->Start()); |
| 994 ASSERT_TRUE(https_server_.Start()); | 1007 ASSERT_TRUE(https_server_.Start()); |
| 995 | 1008 |
| 996 std::string replacement_path; | 1009 std::string replacement_path; |
| 997 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( | 1010 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( |
| 998 "files/ssl/page_with_dynamic_insecure_content.html", | 1011 "files/ssl/page_with_dynamic_insecure_content.html", |
| 999 test_server()->host_port_pair(), | 1012 test_server()->host_port_pair(), |
| 1000 &replacement_path)); | 1013 &replacement_path)); |
| 1001 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 1014 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( |
| 1002 replacement_path)); | 1015 replacement_path)); |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1749 // We shouldn't have an interstitial page showing here. | 1762 // We shouldn't have an interstitial page showing here. |
| 1750 | 1763 |
| 1751 // Test page run a WebSocket wss connection test. The result will be shown | 1764 // Test page run a WebSocket wss connection test. The result will be shown |
| 1752 // as page title. | 1765 // as page title. |
| 1753 const base::string16 result = watcher.WaitAndGetTitle(); | 1766 const base::string16 result = watcher.WaitAndGetTitle(); |
| 1754 EXPECT_TRUE(LowerCaseEqualsASCII(result, "pass")); | 1767 EXPECT_TRUE(LowerCaseEqualsASCII(result, "pass")); |
| 1755 } | 1768 } |
| 1756 | 1769 |
| 1757 // Verifies that the interstitial can proceed, even if JavaScript is disabled. | 1770 // Verifies that the interstitial can proceed, even if JavaScript is disabled. |
| 1758 // http://crbug.com/322948 | 1771 // http://crbug.com/322948 |
| 1759 IN_PROC_BROWSER_TEST_F(SSLUITest, TestInterstitialJavaScriptProceeds) { | 1772 #if defined(OS_LINUX) |
| 1773 // flaky http://crbug.com/396458 | |
| 1774 #define MAYBE_TestInterstitialJavaScriptProceeds DISABLED_TestInterstitialJavaSc riptProceeds | |
| 1775 #else | |
| 1776 #define MAYBE_TestInterstitialJavaScriptProceeds TestInterstitialJavaScriptProce eds | |
| 1777 #endif | |
| 1778 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestInterstitialJavaScriptProceeds) { | |
| 1760 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( | 1779 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( |
| 1761 CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK); | 1780 CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK); |
| 1762 | 1781 |
| 1763 ASSERT_TRUE(https_server_expired_.Start()); | 1782 ASSERT_TRUE(https_server_expired_.Start()); |
| 1764 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 1783 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
| 1765 ui_test_utils::NavigateToURL(browser(), | 1784 ui_test_utils::NavigateToURL(browser(), |
| 1766 https_server_expired_.GetURL("files/ssl/google.html")); | 1785 https_server_expired_.GetURL("files/ssl/google.html")); |
| 1767 CheckAuthenticationBrokenState( | 1786 CheckAuthenticationBrokenState( |
| 1768 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); | 1787 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); |
| 1769 | 1788 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1846 | 1865 |
| 1847 // Visit a page over https that contains a frame with a redirect. | 1866 // Visit a page over https that contains a frame with a redirect. |
| 1848 | 1867 |
| 1849 // XMLHttpRequest insecure content in synchronous mode. | 1868 // XMLHttpRequest insecure content in synchronous mode. |
| 1850 | 1869 |
| 1851 // XMLHttpRequest insecure content in asynchronous mode. | 1870 // XMLHttpRequest insecure content in asynchronous mode. |
| 1852 | 1871 |
| 1853 // XMLHttpRequest over bad ssl in synchronous mode. | 1872 // XMLHttpRequest over bad ssl in synchronous mode. |
| 1854 | 1873 |
| 1855 // XMLHttpRequest over OK ssl in synchronous mode. | 1874 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |