Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: net/base/transport_security_state_unittest.cc

Issue 460135: STS: add chrome.google.com to the built in STS list. (Closed)
Patch Set: Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« net/base/transport_security_state.cc ('K') | « net/base/transport_security_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698