Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 419013003: Replace c/b/nss_context by a KeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added Linux implementation. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 727
727 #if defined(USE_NSS) 728 #if defined(USE_NSS)
728 class SSLUITestWithClientCert : public SSLUITest { 729 class SSLUITestWithClientCert : public SSLUITest {
729 public: 730 public:
730 SSLUITestWithClientCert() : cert_db_(NULL) {} 731 SSLUITestWithClientCert() : cert_db_(NULL) {}
731 732
732 virtual void SetUpOnMainThread() OVERRIDE { 733 virtual void SetUpOnMainThread() OVERRIDE {
733 SSLUITest::SetUpOnMainThread(); 734 SSLUITest::SetUpOnMainThread();
734 735
735 base::RunLoop loop; 736 base::RunLoop loop;
736 GetNSSCertDatabaseForProfile( 737 CertDatabaseServiceFactory::GetForBrowserContext(browser()->profile())
737 browser()->profile(), 738 ->GetNSSCertDatabase(
738 base::Bind(&SSLUITestWithClientCert::DidGetCertDatabase, 739 base::Bind(&SSLUITestWithClientCert::DidGetCertDatabase,
739 base::Unretained(this), 740 base::Unretained(this),
740 &loop)); 741 loop.QuitClosure()));
741 loop.Run(); 742 loop.Run();
742 } 743 }
743 744
744 protected: 745 protected:
745 void DidGetCertDatabase(base::RunLoop* loop, net::NSSCertDatabase* cert_db) { 746 void DidGetCertDatabase(const base::Closure& done_callback,
747 net::NSSCertDatabase* cert_db) {
746 cert_db_ = cert_db; 748 cert_db_ = cert_db;
747 loop->Quit(); 749 done_callback.Run();
748 } 750 }
749 751
750 net::NSSCertDatabase* cert_db_; 752 net::NSSCertDatabase* cert_db_;
751 }; 753 };
752 754
753 // SSL client certificate tests are only enabled when using NSS for private key 755 // SSL client certificate tests are only enabled when using NSS for private key
754 // storage, as only NSS can avoid modifying global machine state when testing. 756 // storage, as only NSS can avoid modifying global machine state when testing.
755 // See http://crbug.com/51132 757 // See http://crbug.com/51132
756 758
757 // Visit a HTTPS page which requires client cert authentication. The client 759 // Visit a HTTPS page which requires client cert authentication. The client
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 1871
1870 // Visit a page over https that contains a frame with a redirect. 1872 // Visit a page over https that contains a frame with a redirect.
1871 1873
1872 // XMLHttpRequest insecure content in synchronous mode. 1874 // XMLHttpRequest insecure content in synchronous mode.
1873 1875
1874 // XMLHttpRequest insecure content in asynchronous mode. 1876 // XMLHttpRequest insecure content in asynchronous mode.
1875 1877
1876 // XMLHttpRequest over bad ssl in synchronous mode. 1878 // XMLHttpRequest over bad ssl in synchronous mode.
1877 1879
1878 // XMLHttpRequest over OK ssl in synchronous mode. 1880 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698