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

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

Issue 732423002: Update from chromium https://crrev.com/304586 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « net/http/transport_security_state_static.json ('k') | net/net.gyp » ('j') | 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) 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 EXPECT_TRUE(state.GetStaticDomainState("blog.torproject.org", &domain_state)); 533 EXPECT_TRUE(state.GetStaticDomainState("blog.torproject.org", &domain_state));
534 EXPECT_FALSE(domain_state.pkp.spki_hashes.empty()); 534 EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
535 535
536 EXPECT_TRUE(HasStaticPublicKeyPins("www.twitter.com")); 536 EXPECT_TRUE(HasStaticPublicKeyPins("www.twitter.com"));
537 537
538 // Check that Facebook subdomains have pinning but not HSTS. 538 // Check that Facebook subdomains have pinning but not HSTS.
539 EXPECT_TRUE(state.GetStaticDomainState("facebook.com", &domain_state)); 539 EXPECT_TRUE(state.GetStaticDomainState("facebook.com", &domain_state));
540 EXPECT_FALSE(domain_state.pkp.spki_hashes.empty()); 540 EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
541 EXPECT_TRUE(StaticShouldRedirect("facebook.com")); 541 EXPECT_TRUE(StaticShouldRedirect("facebook.com"));
542 542
543 EXPECT_TRUE(state.GetStaticDomainState("foo.facebook.com", &domain_state)); 543 EXPECT_FALSE(state.GetStaticDomainState("foo.facebook.com", &domain_state));
544 EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
545 EXPECT_FALSE(StaticShouldRedirect("foo.facebook.com"));
546 544
547 EXPECT_TRUE(state.GetStaticDomainState("www.facebook.com", &domain_state)); 545 EXPECT_TRUE(state.GetStaticDomainState("www.facebook.com", &domain_state));
548 EXPECT_FALSE(domain_state.pkp.spki_hashes.empty()); 546 EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
549 EXPECT_TRUE(StaticShouldRedirect("www.facebook.com")); 547 EXPECT_TRUE(StaticShouldRedirect("www.facebook.com"));
550 548
551 EXPECT_TRUE( 549 EXPECT_TRUE(
552 state.GetStaticDomainState("foo.www.facebook.com", &domain_state)); 550 state.GetStaticDomainState("foo.www.facebook.com", &domain_state));
553 EXPECT_FALSE(domain_state.pkp.spki_hashes.empty()); 551 EXPECT_FALSE(domain_state.pkp.spki_hashes.empty());
554 EXPECT_TRUE(StaticShouldRedirect("foo.www.facebook.com")); 552 EXPECT_TRUE(StaticShouldRedirect("foo.www.facebook.com"));
555 } 553 }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 // These hosts used to only be HSTS when SNI was available. 766 // These hosts used to only be HSTS when SNI was available.
769 EXPECT_TRUE(TransportSecurityState::IsGooglePinnedProperty( 767 EXPECT_TRUE(TransportSecurityState::IsGooglePinnedProperty(
770 "gmail.com")); 768 "gmail.com"));
771 EXPECT_TRUE(TransportSecurityState::IsGooglePinnedProperty( 769 EXPECT_TRUE(TransportSecurityState::IsGooglePinnedProperty(
772 "googlegroups.com")); 770 "googlegroups.com"));
773 EXPECT_TRUE(TransportSecurityState::IsGooglePinnedProperty( 771 EXPECT_TRUE(TransportSecurityState::IsGooglePinnedProperty(
774 "www.googlegroups.com")); 772 "www.googlegroups.com"));
775 } 773 }
776 774
777 } // namespace net 775 } // namespace net
OLDNEW
« no previous file with comments | « net/http/transport_security_state_static.json ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698