| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/base/transport_security_state.h" | 5 #include "net/base/transport_security_state.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 7 |
| 8 class TransportSecurityStateTest : public testing::Test { | 8 class TransportSecurityStateTest : public testing::Test { |
| 9 }; | 9 }; |
| 10 | 10 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 state->EnableHost("google.com", domain_state); | 238 state->EnableHost("google.com", domain_state); |
| 239 | 239 |
| 240 std::string output; | 240 std::string output; |
| 241 state->Serialise(&output); | 241 state->Serialise(&output); |
| 242 EXPECT_TRUE(state->Deserialise(output)); | 242 EXPECT_TRUE(state->Deserialise(output)); |
| 243 | 243 |
| 244 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "google.com")); | 244 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "google.com")); |
| 245 EXPECT_EQ(domain_state.mode, | 245 EXPECT_EQ(domain_state.mode, |
| 246 net::TransportSecurityState::DomainState::MODE_OPPORTUNISTIC); | 246 net::TransportSecurityState::DomainState::MODE_OPPORTUNISTIC); |
| 247 } | 247 } |
| 248 |
| 249 TEST_F(TransportSecurityStateTest, ChromeDotGoogleDotCom) { |
| 250 scoped_refptr<net::TransportSecurityState> state( |
| 251 new net::TransportSecurityState); |
| 252 |
| 253 net::TransportSecurityState::DomainState domain_state; |
| 254 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "chrome.google.com")); |
| 255 EXPECT_EQ(domain_state.mode, |
| 256 net::TransportSecurityState::DomainState::MODE_STRICT); |
| 257 } |
| OLD | NEW |