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 29 matching lines...) Expand all Loading... | |
| 40 #include "content/public/common/ssl_status.h" | 40 #include "content/public/common/ssl_status.h" |
| 41 #include "content/public/test/browser_test_utils.h" | 41 #include "content/public/test/browser_test_utils.h" |
| 42 #include "content/public/test/download_test_observer.h" | 42 #include "content/public/test/download_test_observer.h" |
| 43 #include "content/public/test/test_renderer_host.h" | 43 #include "content/public/test/test_renderer_host.h" |
| 44 #include "net/base/net_errors.h" | 44 #include "net/base/net_errors.h" |
| 45 #include "net/base/test_data_directory.h" | 45 #include "net/base/test_data_directory.h" |
| 46 #include "net/cert/cert_status_flags.h" | 46 #include "net/cert/cert_status_flags.h" |
| 47 #include "net/test/spawned_test_server/spawned_test_server.h" | 47 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 48 | 48 |
| 49 #if defined(USE_NSS) | 49 #if defined(USE_NSS) |
| 50 #include "chrome/browser/net/nss_context.h" | 50 #include "chrome/browser/net/cert_database_service_factory.h" |
| 51 #include "components/cert_database/public/cert_database_service.h" | |
| 51 #include "net/base/crypto_module.h" | 52 #include "net/base/crypto_module.h" |
| 52 #include "net/cert/nss_cert_database.h" | 53 #include "net/cert/nss_cert_database.h" |
| 53 #endif // defined(USE_NSS) | 54 #endif // defined(USE_NSS) |
| 54 | 55 |
| 55 using base::ASCIIToUTF16; | 56 using base::ASCIIToUTF16; |
| 56 using content::InterstitialPage; | 57 using content::InterstitialPage; |
| 57 using content::NavigationController; | 58 using content::NavigationController; |
| 58 using content::NavigationEntry; | 59 using content::NavigationEntry; |
| 59 using content::SSLStatus; | 60 using content::SSLStatus; |
| 60 using content::WebContents; | 61 using content::WebContents; |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 735 | 736 |
| 736 #if defined(USE_NSS) | 737 #if defined(USE_NSS) |
| 737 class SSLUITestWithClientCert : public SSLUITest { | 738 class SSLUITestWithClientCert : public SSLUITest { |
| 738 public: | 739 public: |
| 739 SSLUITestWithClientCert() : cert_db_(NULL) {} | 740 SSLUITestWithClientCert() : cert_db_(NULL) {} |
| 740 | 741 |
| 741 virtual void SetUpOnMainThread() override { | 742 virtual void SetUpOnMainThread() override { |
| 742 SSLUITest::SetUpOnMainThread(); | 743 SSLUITest::SetUpOnMainThread(); |
| 743 | 744 |
| 744 base::RunLoop loop; | 745 base::RunLoop loop; |
| 745 GetNSSCertDatabaseForProfile( | 746 cert_database::CertDatabaseServiceFactory::GetForBrowserContext( |
| 746 browser()->profile(), | 747 browser()->profile()) |
| 747 base::Bind(&SSLUITestWithClientCert::DidGetCertDatabase, | 748 ->GetNSSCertDatabase( |
|
Joao da Silva
2014/10/30 09:48:01
May be NULL?
pneubeck (no reviews)
2014/11/05 14:53:36
Done.
| |
| 748 base::Unretained(this), | 749 base::Bind(&SSLUITestWithClientCert::DidGetCertDatabase, |
| 749 &loop)); | 750 base::Unretained(this), |
| 751 loop.QuitClosure())); | |
| 750 loop.Run(); | 752 loop.Run(); |
| 751 } | 753 } |
| 752 | 754 |
| 753 protected: | 755 protected: |
| 754 void DidGetCertDatabase(base::RunLoop* loop, net::NSSCertDatabase* cert_db) { | 756 void DidGetCertDatabase(const base::Closure& done_callback, |
| 757 net::NSSCertDatabase* cert_db) { | |
| 755 cert_db_ = cert_db; | 758 cert_db_ = cert_db; |
| 756 loop->Quit(); | 759 done_callback.Run(); |
| 757 } | 760 } |
| 758 | 761 |
| 759 net::NSSCertDatabase* cert_db_; | 762 net::NSSCertDatabase* cert_db_; |
| 760 }; | 763 }; |
| 761 | 764 |
| 762 // SSL client certificate tests are only enabled when using NSS for private key | 765 // SSL client certificate tests are only enabled when using NSS for private key |
| 763 // storage, as only NSS can avoid modifying global machine state when testing. | 766 // storage, as only NSS can avoid modifying global machine state when testing. |
| 764 // See http://crbug.com/51132 | 767 // See http://crbug.com/51132 |
| 765 | 768 |
| 766 // Visit a HTTPS page which requires client cert authentication. The client | 769 // Visit a HTTPS page which requires client cert authentication. The client |
| (...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1880 | 1883 |
| 1881 // Visit a page over https that contains a frame with a redirect. | 1884 // Visit a page over https that contains a frame with a redirect. |
| 1882 | 1885 |
| 1883 // XMLHttpRequest insecure content in synchronous mode. | 1886 // XMLHttpRequest insecure content in synchronous mode. |
| 1884 | 1887 |
| 1885 // XMLHttpRequest insecure content in asynchronous mode. | 1888 // XMLHttpRequest insecure content in asynchronous mode. |
| 1886 | 1889 |
| 1887 // XMLHttpRequest over bad ssl in synchronous mode. | 1890 // XMLHttpRequest over bad ssl in synchronous mode. |
| 1888 | 1891 |
| 1889 // XMLHttpRequest over OK ssl in synchronous mode. | 1892 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |