| 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 "net/http/transport_security_state.h" | 5 #include "net/http/transport_security_state.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 "lookupByWaveIdHashAndWaveIdIdAndWaveIdDomainAndWaveletIdIdAnd" | 1228 "lookupByWaveIdHashAndWaveIdIdAndWaveIdDomainAndWaveletIdIdAnd" |
| 1229 "WaveletIdDomainAndBlipBlipid"; | 1229 "WaveletIdDomainAndBlipBlipid"; |
| 1230 TransportSecurityState::STSState sts_state; | 1230 TransportSecurityState::STSState sts_state; |
| 1231 TransportSecurityState::PKPState pkp_state; | 1231 TransportSecurityState::PKPState pkp_state; |
| 1232 // Just checks that we don't hit a NOTREACHED. | 1232 // Just checks that we don't hit a NOTREACHED. |
| 1233 EXPECT_FALSE(state.GetStaticDomainState(kLongName, &sts_state, &pkp_state)); | 1233 EXPECT_FALSE(state.GetStaticDomainState(kLongName, &sts_state, &pkp_state)); |
| 1234 EXPECT_FALSE(state.GetDynamicSTSState(kLongName, &sts_state)); | 1234 EXPECT_FALSE(state.GetDynamicSTSState(kLongName, &sts_state)); |
| 1235 EXPECT_FALSE(state.GetDynamicPKPState(kLongName, &pkp_state)); | 1235 EXPECT_FALSE(state.GetDynamicPKPState(kLongName, &pkp_state)); |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 TEST_F(TransportSecurityStateTest, BuiltinCertPins) { | 1238 #if defined(OS_ANDROID) |
| 1239 #define MAYBE_BuiltinCertPins DISABLED_BuiltinCertPins |
| 1240 #else |
| 1241 #define MAYBE_BuiltinCertPins BuiltinCertPins |
| 1242 #endif |
| 1243 TEST_F(TransportSecurityStateTest, MAYBE_BuiltinCertPins) { |
| 1239 TransportSecurityState state; | 1244 TransportSecurityState state; |
| 1240 EnableStaticPins(&state); | 1245 EnableStaticPins(&state); |
| 1241 TransportSecurityState::STSState sts_state; | 1246 TransportSecurityState::STSState sts_state; |
| 1242 TransportSecurityState::PKPState pkp_state; | 1247 TransportSecurityState::PKPState pkp_state; |
| 1243 | 1248 |
| 1244 EXPECT_TRUE( | 1249 EXPECT_TRUE( |
| 1245 state.GetStaticDomainState("chrome.google.com", &sts_state, &pkp_state)); | 1250 state.GetStaticDomainState("chrome.google.com", &sts_state, &pkp_state)); |
| 1246 EXPECT_TRUE(HasStaticPublicKeyPins("chrome.google.com")); | 1251 EXPECT_TRUE(HasStaticPublicKeyPins("chrome.google.com")); |
| 1247 | 1252 |
| 1248 HashValueVector hashes; | 1253 HashValueVector hashes; |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 base::FieldTrialList::CreateFieldTrial("EnforceCTForProblematicRoots", | 2337 base::FieldTrialList::CreateFieldTrial("EnforceCTForProblematicRoots", |
| 2333 "disabled"); | 2338 "disabled"); |
| 2334 | 2339 |
| 2335 EXPECT_FALSE( | 2340 EXPECT_FALSE( |
| 2336 state.ShouldRequireCT("www.example.com", before_cert.get(), hashes)); | 2341 state.ShouldRequireCT("www.example.com", before_cert.get(), hashes)); |
| 2337 EXPECT_FALSE( | 2342 EXPECT_FALSE( |
| 2338 state.ShouldRequireCT("www.example.com", after_cert.get(), hashes)); | 2343 state.ShouldRequireCT("www.example.com", after_cert.get(), hashes)); |
| 2339 } | 2344 } |
| 2340 | 2345 |
| 2341 } // namespace net | 2346 } // namespace net |
| OLD | NEW |