OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/certificate_provider/certificate_provider_serv
ice.h" | 5 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const net::CertificateList& certs) { | 45 const net::CertificateList& certs) { |
46 if (out_certs) | 46 if (out_certs) |
47 *out_certs = certs; | 47 *out_certs = certs; |
48 } | 48 } |
49 | 49 |
50 certificate_provider::CertificateInfo CreateCertInfo( | 50 certificate_provider::CertificateInfo CreateCertInfo( |
51 const std::string& cert_filename) { | 51 const std::string& cert_filename) { |
52 certificate_provider::CertificateInfo cert_info; | 52 certificate_provider::CertificateInfo cert_info; |
53 cert_info.certificate = | 53 cert_info.certificate = |
54 net::ImportCertFromFile(net::GetTestCertsDirectory(), cert_filename); | 54 net::ImportCertFromFile(net::GetTestCertsDirectory(), cert_filename); |
55 EXPECT_NE(nullptr, cert_info.certificate) << "Could not load " | 55 EXPECT_TRUE(cert_info.certificate) << "Could not load " << cert_filename; |
56 << cert_filename; | |
57 cert_info.type = net::SSLPrivateKey::Type::RSA; | 56 cert_info.type = net::SSLPrivateKey::Type::RSA; |
58 cert_info.supported_hashes.push_back(net::SSLPrivateKey::Hash::SHA256); | 57 cert_info.supported_hashes.push_back(net::SSLPrivateKey::Hash::SHA256); |
59 cert_info.max_signature_length_in_bytes = 123; | 58 cert_info.max_signature_length_in_bytes = 123; |
60 | 59 |
61 return cert_info; | 60 return cert_info; |
62 } | 61 } |
63 | 62 |
64 bool IsKeyEqualToCertInfo(const certificate_provider::CertificateInfo& info, | 63 bool IsKeyEqualToCertInfo(const certificate_provider::CertificateInfo& info, |
65 net::SSLPrivateKey* key) { | 64 net::SSLPrivateKey* key) { |
66 if (info.supported_hashes != key->GetDigestPreferences()) | 65 if (info.supported_hashes != key->GetDigestPreferences()) |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 EXPECT_EQ(net::OK, error); | 479 EXPECT_EQ(net::OK, error); |
481 | 480 |
482 // Unload the extension. | 481 // Unload the extension. |
483 service_->OnExtensionUnloaded(kExtension1); | 482 service_->OnExtensionUnloaded(kExtension1); |
484 | 483 |
485 task_runner_->RunUntilIdle(); | 484 task_runner_->RunUntilIdle(); |
486 EXPECT_EQ(net::ERR_FAILED, error); | 485 EXPECT_EQ(net::ERR_FAILED, error); |
487 } | 486 } |
488 | 487 |
489 } // namespace chromeos | 488 } // namespace chromeos |
OLD | NEW |