| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/policy/policy_cert_verifier.h" | 5 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 net::NSSCertDatabase::TrustBits trust = | 86 net::NSSCertDatabase::TrustBits trust = |
| 87 cert_db_->GetCertTrust(cert.get(), type); | 87 cert_db_->GetCertTrust(cert.get(), type); |
| 88 EXPECT_EQ(net::NSSCertDatabase::TRUST_DEFAULT, trust); | 88 EXPECT_EQ(net::NSSCertDatabase::TRUST_DEFAULT, trust); |
| 89 | 89 |
| 90 return cert; | 90 return cert; |
| 91 } | 91 } |
| 92 | 92 |
| 93 protected: | 93 protected: |
| 94 crypto::ScopedTestNSSDB test_nssdb_; | 94 crypto::ScopedTestNSSDB test_nssdb_; |
| 95 net::NSSCertDatabase* cert_db_; | 95 net::NSSCertDatabase* cert_db_; |
| 96 MessageLoop loop_; | 96 base::MessageLoop loop_; |
| 97 content::TestBrowserThread ui_thread_; | 97 content::TestBrowserThread ui_thread_; |
| 98 content::TestBrowserThread io_thread_; | 98 content::TestBrowserThread io_thread_; |
| 99 TestingProfileManager profile_manager_; | 99 TestingProfileManager profile_manager_; |
| 100 TestingProfile* profile_; | 100 TestingProfile* profile_; |
| 101 MockCertTrustAnchorProvider trust_provider_; | 101 MockCertTrustAnchorProvider trust_provider_; |
| 102 scoped_ptr<PolicyCertVerifier> cert_verifier_; | 102 scoped_ptr<PolicyCertVerifier> cert_verifier_; |
| 103 const net::CertificateList empty_cert_list_; | 103 const net::CertificateList empty_cert_list_; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 TEST_F(PolicyCertVerifierTest, VerifyUntrustedCert) { | 106 TEST_F(PolicyCertVerifierTest, VerifyUntrustedCert) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // Note: this hits the cached result from the first Verify() in this test. | 288 // Note: this hits the cached result from the first Verify() in this test. |
| 289 EXPECT_EQ(net::ERR_CERT_AUTHORITY_INVALID, error); | 289 EXPECT_EQ(net::ERR_CERT_AUTHORITY_INVALID, error); |
| 290 | 290 |
| 291 // The profile is still tainted. | 291 // The profile is still tainted. |
| 292 base::RunLoop().RunUntilIdle(); | 292 base::RunLoop().RunUntilIdle(); |
| 293 EXPECT_TRUE( | 293 EXPECT_TRUE( |
| 294 profile_->GetPrefs()->GetBoolean(prefs::kUsedPolicyCertificatesOnce)); | 294 profile_->GetPrefs()->GetBoolean(prefs::kUsedPolicyCertificatesOnce)); |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace policy | 297 } // namespace policy |
| OLD | NEW |