| 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/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #if defined(USE_NSS) | 47 #if defined(USE_NSS) |
| 48 #include "net/base/nss_cert_database.h" | 48 #include "net/base/nss_cert_database.h" |
| 49 #endif // defined(USE_NSS) | 49 #endif // defined(USE_NSS) |
| 50 | 50 |
| 51 using content::InterstitialPage; | 51 using content::InterstitialPage; |
| 52 using content::NavigationController; | 52 using content::NavigationController; |
| 53 using content::NavigationEntry; | 53 using content::NavigationEntry; |
| 54 using content::SSLStatus; | 54 using content::SSLStatus; |
| 55 using content::WebContents; | 55 using content::WebContents; |
| 56 | 56 |
| 57 const base::FilePath::CharType kDocRoot[] = | |
| 58 FILE_PATH_LITERAL("chrome/test/data"); | |
| 59 | |
| 60 namespace { | 57 namespace { |
| 61 | 58 |
| 62 class ProvisionalLoadWaiter : public content::WebContentsObserver { | 59 class ProvisionalLoadWaiter : public content::WebContentsObserver { |
| 63 public: | 60 public: |
| 64 explicit ProvisionalLoadWaiter(WebContents* tab) | 61 explicit ProvisionalLoadWaiter(WebContents* tab) |
| 65 : WebContentsObserver(tab), waiting_(false), seen_(false) {} | 62 : WebContentsObserver(tab), waiting_(false), seen_(false) {} |
| 66 | 63 |
| 67 void Wait() { | 64 void Wait() { |
| 68 if (seen_) | 65 if (seen_) |
| 69 return; | 66 return; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 89 bool seen_; | 86 bool seen_; |
| 90 }; | 87 }; |
| 91 | 88 |
| 92 } // namespace | 89 } // namespace |
| 93 | 90 |
| 94 class SSLUITest : public InProcessBrowserTest { | 91 class SSLUITest : public InProcessBrowserTest { |
| 95 public: | 92 public: |
| 96 SSLUITest() | 93 SSLUITest() |
| 97 : https_server_(net::TestServer::TYPE_HTTPS, | 94 : https_server_(net::TestServer::TYPE_HTTPS, |
| 98 SSLOptions(SSLOptions::CERT_OK), | 95 SSLOptions(SSLOptions::CERT_OK), |
| 99 base::FilePath(kDocRoot)), | 96 net::TestServer::GetTestDataPath()), |
| 100 https_server_expired_(net::TestServer::TYPE_HTTPS, | 97 https_server_expired_(net::TestServer::TYPE_HTTPS, |
| 101 SSLOptions(SSLOptions::CERT_EXPIRED), | 98 SSLOptions(SSLOptions::CERT_EXPIRED), |
| 102 base::FilePath(kDocRoot)), | 99 net::TestServer::GetTestDataPath()), |
| 103 https_server_mismatched_(net::TestServer::TYPE_HTTPS, | 100 https_server_mismatched_(net::TestServer::TYPE_HTTPS, |
| 104 SSLOptions(SSLOptions::CERT_MISMATCHED_NAME), | 101 SSLOptions(SSLOptions::CERT_MISMATCHED_NAME), |
| 105 base::FilePath(kDocRoot)), | 102 net::TestServer::GetTestDataPath()), |
| 106 wss_server_expired_(net::TestServer::TYPE_WSS, | 103 wss_server_expired_(net::TestServer::TYPE_WSS, |
| 107 SSLOptions(SSLOptions::CERT_EXPIRED), | 104 SSLOptions(SSLOptions::CERT_EXPIRED), |
| 108 net::GetWebSocketTestDataDirectory()) {} | 105 net::TestServer::GetSourceRelativePath( |
| 106 net::GetWebSocketTestDataDirectory())) {} |
| 109 | 107 |
| 110 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 108 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 111 // Browser will both run and display insecure content. | 109 // Browser will both run and display insecure content. |
| 112 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); | 110 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); |
| 113 // Use process-per-site so that navigating to a same-site page in a | 111 // Use process-per-site so that navigating to a same-site page in a |
| 114 // new tab will use the same process. | 112 // new tab will use the same process. |
| 115 command_line->AppendSwitch(switches::kProcessPerSite); | 113 command_line->AppendSwitch(switches::kProcessPerSite); |
| 116 } | 114 } |
| 117 | 115 |
| 118 void CheckAuthenticatedState(WebContents* tab, | 116 void CheckAuthenticatedState(WebContents* tab, |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1629 | 1627 |
| 1630 // Visit a page over https that contains a frame with a redirect. | 1628 // Visit a page over https that contains a frame with a redirect. |
| 1631 | 1629 |
| 1632 // XMLHttpRequest insecure content in synchronous mode. | 1630 // XMLHttpRequest insecure content in synchronous mode. |
| 1633 | 1631 |
| 1634 // XMLHttpRequest insecure content in asynchronous mode. | 1632 // XMLHttpRequest insecure content in asynchronous mode. |
| 1635 | 1633 |
| 1636 // XMLHttpRequest over bad ssl in synchronous mode. | 1634 // XMLHttpRequest over bad ssl in synchronous mode. |
| 1637 | 1635 |
| 1638 // XMLHttpRequest over OK ssl in synchronous mode. | 1636 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |