| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 : WebContentsObserver(tab), waiting_(false), seen_(false) {} | 64 : WebContentsObserver(tab), waiting_(false), seen_(false) {} |
| 65 | 65 |
| 66 void Wait() { | 66 void Wait() { |
| 67 if (seen_) | 67 if (seen_) |
| 68 return; | 68 return; |
| 69 | 69 |
| 70 waiting_ = true; | 70 waiting_ = true; |
| 71 content::RunMessageLoop(); | 71 content::RunMessageLoop(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void DidFailProvisionalLoad( | 74 virtual void DidFailProvisionalLoad( |
| 75 int64 frame_id, | 75 int64 frame_id, |
| 76 bool is_main_frame, | 76 bool is_main_frame, |
| 77 const GURL& validated_url, | 77 const GURL& validated_url, |
| 78 int error_code, | 78 int error_code, |
| 79 const string16& error_description, | 79 const string16& error_description, |
| 80 content::RenderViewHost* render_view_host) OVERRIDE { | 80 content::RenderViewHost* render_view_host) OVERRIDE { |
| 81 seen_ = true; | 81 seen_ = true; |
| 82 if (waiting_) | 82 if (waiting_) |
| 83 MessageLoopForUI::current()->Quit(); | 83 MessageLoopForUI::current()->Quit(); |
| 84 } | 84 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 99 https_server_expired_(net::TestServer::TYPE_HTTPS, | 99 https_server_expired_(net::TestServer::TYPE_HTTPS, |
| 100 SSLOptions(SSLOptions::CERT_EXPIRED), | 100 SSLOptions(SSLOptions::CERT_EXPIRED), |
| 101 FilePath(kDocRoot)), | 101 FilePath(kDocRoot)), |
| 102 https_server_mismatched_(net::TestServer::TYPE_HTTPS, | 102 https_server_mismatched_(net::TestServer::TYPE_HTTPS, |
| 103 SSLOptions(SSLOptions::CERT_MISMATCHED_NAME), | 103 SSLOptions(SSLOptions::CERT_MISMATCHED_NAME), |
| 104 FilePath(kDocRoot)), | 104 FilePath(kDocRoot)), |
| 105 wss_server_expired_(net::TestServer::TYPE_WSS, | 105 wss_server_expired_(net::TestServer::TYPE_WSS, |
| 106 SSLOptions(SSLOptions::CERT_EXPIRED), | 106 SSLOptions(SSLOptions::CERT_EXPIRED), |
| 107 net::GetWebSocketTestDataDirectory()) {} | 107 net::GetWebSocketTestDataDirectory()) {} |
| 108 | 108 |
| 109 virtual void SetUpCommandLine(CommandLine* command_line) { | 109 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 110 // Browser will both run and display insecure content. | 110 // Browser will both run and display insecure content. |
| 111 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); | 111 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); |
| 112 // Use process-per-site so that navigating to a same-site page in a | 112 // Use process-per-site so that navigating to a same-site page in a |
| 113 // new tab will use the same process. | 113 // new tab will use the same process. |
| 114 command_line->AppendSwitch(switches::kProcessPerSite); | 114 command_line->AppendSwitch(switches::kProcessPerSite); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void CheckAuthenticatedState(WebContents* tab, | 117 void CheckAuthenticatedState(WebContents* tab, |
| 118 bool displayed_insecure_content) { | 118 bool displayed_insecure_content) { |
| 119 ASSERT_FALSE(tab->IsCrashed()); | 119 ASSERT_FALSE(tab->IsCrashed()); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 typedef net::TestServer::SSLOptions SSLOptions; | 304 typedef net::TestServer::SSLOptions SSLOptions; |
| 305 | 305 |
| 306 DISALLOW_COPY_AND_ASSIGN(SSLUITest); | 306 DISALLOW_COPY_AND_ASSIGN(SSLUITest); |
| 307 }; | 307 }; |
| 308 | 308 |
| 309 class SSLUITestBlock : public SSLUITest { | 309 class SSLUITestBlock : public SSLUITest { |
| 310 public: | 310 public: |
| 311 SSLUITestBlock() : SSLUITest() {} | 311 SSLUITestBlock() : SSLUITest() {} |
| 312 | 312 |
| 313 // Browser will neither run nor display insecure content. | 313 // Browser will neither run nor display insecure content. |
| 314 virtual void SetUpCommandLine(CommandLine* command_line) { | 314 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 315 command_line->AppendSwitch(switches::kNoDisplayingInsecureContent); | 315 command_line->AppendSwitch(switches::kNoDisplayingInsecureContent); |
| 316 } | 316 } |
| 317 }; | 317 }; |
| 318 | 318 |
| 319 class SSLUITestIgnoreCertErrors : public SSLUITest { | 319 class SSLUITestIgnoreCertErrors : public SSLUITest { |
| 320 public: | 320 public: |
| 321 SSLUITestIgnoreCertErrors() : SSLUITest() {} | 321 SSLUITestIgnoreCertErrors() : SSLUITest() {} |
| 322 | 322 |
| 323 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 323 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 324 // Browser will ignore certificate errors. | 324 // Browser will ignore certificate errors. |
| (...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 | 1628 |
| 1629 // Visit a page over https that contains a frame with a redirect. | 1629 // Visit a page over https that contains a frame with a redirect. |
| 1630 | 1630 |
| 1631 // XMLHttpRequest insecure content in synchronous mode. | 1631 // XMLHttpRequest insecure content in synchronous mode. |
| 1632 | 1632 |
| 1633 // XMLHttpRequest insecure content in asynchronous mode. | 1633 // XMLHttpRequest insecure content in asynchronous mode. |
| 1634 | 1634 |
| 1635 // XMLHttpRequest over bad ssl in synchronous mode. | 1635 // XMLHttpRequest over bad ssl in synchronous mode. |
| 1636 | 1636 |
| 1637 // XMLHttpRequest over OK ssl in synchronous mode. | 1637 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |