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

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

Issue 6107003: Merge 70613 - net: add (*.)splendidbacon.com to HSTS preloaded.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/597/src/
Patch Set: Created 9 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « net/base/transport_security_state.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 namespace net { 8 namespace net {
9 9
10 class TransportSecurityStateTest : public testing::Test { 10 class TransportSecurityStateTest : public testing::Test {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 341
342 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "www.noisebridge.net")); 342 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "www.noisebridge.net"));
343 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "noisebridge.net")); 343 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "noisebridge.net"));
344 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "foo.noisebridge.net")); 344 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "foo.noisebridge.net"));
345 345
346 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "neg9.org")); 346 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "neg9.org"));
347 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "www.neg9.org")); 347 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "www.neg9.org"));
348 348
349 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "factor.cc")); 349 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "factor.cc"));
350 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "www.factor.cc")); 350 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "www.factor.cc"));
351
352 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "splendidbacon.com"));
353 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "www.splendidbacon.com"));
354 EXPECT_TRUE(state->IsEnabledForHost(&domain_state, "foo.splendidbacon.com"));
351 } 355 }
352 356
353 TEST_F(TransportSecurityStateTest, LongNames) { 357 TEST_F(TransportSecurityStateTest, LongNames) {
354 scoped_refptr<TransportSecurityState> state( 358 scoped_refptr<TransportSecurityState> state(
355 new TransportSecurityState); 359 new TransportSecurityState);
356 const char kLongName[] = 360 const char kLongName[] =
357 "lookupByWaveIdHashAndWaveIdIdAndWaveIdDomainAndWaveletIdIdAnd" 361 "lookupByWaveIdHashAndWaveIdIdAndWaveIdDomainAndWaveletIdIdAnd"
358 "WaveletIdDomainAndBlipBlipid"; 362 "WaveletIdDomainAndBlipBlipid";
359 TransportSecurityState::DomainState domain_state; 363 TransportSecurityState::DomainState domain_state;
360 // Just checks that we don't hit a NOTREACHED. 364 // Just checks that we don't hit a NOTREACHED.
361 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, kLongName)); 365 EXPECT_FALSE(state->IsEnabledForHost(&domain_state, kLongName));
362 } 366 }
363 367
364 } // namespace net 368 } // namespace net
OLDNEW
« no previous file with comments | « net/base/transport_security_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698