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

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

Issue 2068423002: Cleanup usage of canonical_suffixes in HttpServerPropertiesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ClearAlternativeServices
Patch Set: fix comments Created 4 years, 6 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
« no previous file with comments | « net/http/http_server_properties_impl.cc ('k') | net/http/http_server_properties_manager.cc » ('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/http_server_properties_impl.h" 5 #include "net/http/http_server_properties_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 // Since |canonical_alternative_service2| has an empty host, 890 // Since |canonical_alternative_service2| has an empty host,
891 // GetAlternativeServices should substitute the hostname of its |origin| 891 // GetAlternativeServices should substitute the hostname of its |origin|
892 // argument. 892 // argument.
893 EXPECT_EQ(test_server.host(), alternative_service_vector[1].host); 893 EXPECT_EQ(test_server.host(), alternative_service_vector[1].host);
894 EXPECT_EQ(canonical_alternative_service2.protocol, 894 EXPECT_EQ(canonical_alternative_service2.protocol,
895 alternative_service_vector[1].protocol); 895 alternative_service_vector[1].protocol);
896 EXPECT_EQ(canonical_alternative_service2.port, 896 EXPECT_EQ(canonical_alternative_service2.port,
897 alternative_service_vector[1].port); 897 alternative_service_vector[1].port);
898 898
899 // Verify the canonical suffix. 899 // Verify the canonical suffix.
900 EXPECT_EQ(".c.youtube.com", impl_.GetCanonicalSuffix(test_server.host())); 900 EXPECT_EQ(".c.youtube.com", *impl_.GetCanonicalSuffix(test_server.host()));
901 EXPECT_EQ(".c.youtube.com", 901 EXPECT_EQ(".c.youtube.com",
902 impl_.GetCanonicalSuffix(canonical_server.host())); 902 *impl_.GetCanonicalSuffix(canonical_server.host()));
903 } 903 }
904 904
905 TEST_F(AlternateProtocolServerPropertiesTest, ClearCanonical) { 905 TEST_F(AlternateProtocolServerPropertiesTest, ClearCanonical) {
906 url::SchemeHostPort test_server("https", "foo.c.youtube.com", 443); 906 url::SchemeHostPort test_server("https", "foo.c.youtube.com", 443);
907 url::SchemeHostPort canonical_server("https", "bar.c.youtube.com", 443); 907 url::SchemeHostPort canonical_server("https", "bar.c.youtube.com", 443);
908 AlternativeService canonical_alternative_service(QUIC, "bar.c.youtube.com", 908 AlternativeService canonical_alternative_service(QUIC, "bar.c.youtube.com",
909 1234); 909 1234);
910 910
911 SetAlternativeService(canonical_server, canonical_alternative_service); 911 SetAlternativeService(canonical_server, canonical_alternative_service);
912 impl_.SetAlternativeServices(canonical_server, 912 impl_.SetAlternativeServices(canonical_server,
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 EXPECT_EQ(quic_server_info1, *(impl_.GetQuicServerInfo(quic_server_id))); 1526 EXPECT_EQ(quic_server_info1, *(impl_.GetQuicServerInfo(quic_server_id)));
1527 1527
1528 impl_.Clear(); 1528 impl_.Clear();
1529 EXPECT_EQ(0u, impl_.quic_server_info_map().size()); 1529 EXPECT_EQ(0u, impl_.quic_server_info_map().size());
1530 EXPECT_EQ(nullptr, impl_.GetQuicServerInfo(quic_server_id)); 1530 EXPECT_EQ(nullptr, impl_.GetQuicServerInfo(quic_server_id));
1531 } 1531 }
1532 1532
1533 } // namespace 1533 } // namespace
1534 1534
1535 } // namespace net 1535 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_impl.cc ('k') | net/http/http_server_properties_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698