OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ssl/ssl_host_state.h" | 5 #include "content/browser/ssl/ssl_host_state.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 | 7 |
8 namespace { | 8 namespace { |
9 | 9 |
10 // Certificates for test data. They're obtained with: | 10 // Certificates for test data. They're obtained with: |
11 // | 11 // |
12 // $ openssl s_client -connect [host]:443 -showcerts | 12 // $ openssl s_client -connect [host]:443 -showcerts |
13 // $ openssl x509 -inform PEM -outform DER > /tmp/host.der | 13 // $ openssl x509 -inform PEM -outform DER > /tmp/host.der |
14 // $ xxd -i /tmp/host.der | 14 // $ xxd -i /tmp/host.der |
15 | 15 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 state.DenyCertForHost(google_cert.get(), "example.com"); | 146 state.DenyCertForHost(google_cert.get(), "example.com"); |
147 | 147 |
148 EXPECT_EQ(state.QueryPolicy(google_cert.get(), "www.google.com"), | 148 EXPECT_EQ(state.QueryPolicy(google_cert.get(), "www.google.com"), |
149 net::CertPolicy::ALLOWED); | 149 net::CertPolicy::ALLOWED); |
150 EXPECT_EQ(state.QueryPolicy(google_cert.get(), "google.com"), | 150 EXPECT_EQ(state.QueryPolicy(google_cert.get(), "google.com"), |
151 net::CertPolicy::UNKNOWN); | 151 net::CertPolicy::UNKNOWN); |
152 EXPECT_EQ(state.QueryPolicy(google_cert.get(), "example.com"), | 152 EXPECT_EQ(state.QueryPolicy(google_cert.get(), "example.com"), |
153 net::CertPolicy::DENIED); | 153 net::CertPolicy::DENIED); |
154 } | 154 } |
OLD | NEW |