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

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

Issue 10005041: Remove SPDY 2.1 support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove references to deleted flags from chrome/browser Created 8 years, 8 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/http/http_server_properties.cc ('k') | net/http/http_stream_factory.h » ('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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 TEST_F(AlternateProtocolServerPropertiesTest, Initialize) { 203 TEST_F(AlternateProtocolServerPropertiesTest, Initialize) {
204 HostPortPair test_host_port_pair1("foo1", 80); 204 HostPortPair test_host_port_pair1("foo1", 80);
205 impl_.SetBrokenAlternateProtocol(test_host_port_pair1); 205 impl_.SetBrokenAlternateProtocol(test_host_port_pair1);
206 HostPortPair test_host_port_pair2("foo2", 80); 206 HostPortPair test_host_port_pair2("foo2", 80);
207 impl_.SetAlternateProtocol(test_host_port_pair2, 443, NPN_SPDY_1); 207 impl_.SetAlternateProtocol(test_host_port_pair2, 443, NPN_SPDY_1);
208 208
209 AlternateProtocolMap alternate_protocol_map; 209 AlternateProtocolMap alternate_protocol_map;
210 PortAlternateProtocolPair port_alternate_protocol_pair; 210 PortAlternateProtocolPair port_alternate_protocol_pair;
211 port_alternate_protocol_pair.port = 123; 211 port_alternate_protocol_pair.port = 123;
212 port_alternate_protocol_pair.protocol = NPN_SPDY_21; 212 port_alternate_protocol_pair.protocol = NPN_SPDY_2;
213 alternate_protocol_map[test_host_port_pair2] = port_alternate_protocol_pair; 213 alternate_protocol_map[test_host_port_pair2] = port_alternate_protocol_pair;
214 impl_.InitializeAlternateProtocolServers(&alternate_protocol_map); 214 impl_.InitializeAlternateProtocolServers(&alternate_protocol_map);
215 215
216 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair1)); 216 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair1));
217 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair2)); 217 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair2));
218 port_alternate_protocol_pair = 218 port_alternate_protocol_pair =
219 impl_.GetAlternateProtocol(test_host_port_pair1); 219 impl_.GetAlternateProtocol(test_host_port_pair1);
220 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, port_alternate_protocol_pair.protocol); 220 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, port_alternate_protocol_pair.protocol);
221 port_alternate_protocol_pair = 221 port_alternate_protocol_pair =
222 impl_.GetAlternateProtocol(test_host_port_pair2); 222 impl_.GetAlternateProtocol(test_host_port_pair2);
223 EXPECT_EQ(123, port_alternate_protocol_pair.port); 223 EXPECT_EQ(123, port_alternate_protocol_pair.port);
224 EXPECT_EQ(NPN_SPDY_21, port_alternate_protocol_pair.protocol); 224 EXPECT_EQ(NPN_SPDY_2, port_alternate_protocol_pair.protocol);
225 } 225 }
226 226
227 TEST_F(AlternateProtocolServerPropertiesTest, SetBroken) { 227 TEST_F(AlternateProtocolServerPropertiesTest, SetBroken) {
228 HostPortPair test_host_port_pair("foo", 80); 228 HostPortPair test_host_port_pair("foo", 80);
229 impl_.SetBrokenAlternateProtocol(test_host_port_pair); 229 impl_.SetBrokenAlternateProtocol(test_host_port_pair);
230 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair)); 230 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair));
231 PortAlternateProtocolPair alternate = 231 PortAlternateProtocolPair alternate =
232 impl_.GetAlternateProtocol(test_host_port_pair); 232 impl_.GetAlternateProtocol(test_host_port_pair);
233 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol); 233 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol);
234 234
235 impl_.SetAlternateProtocol( 235 impl_.SetAlternateProtocol(
236 test_host_port_pair, 236 test_host_port_pair,
237 1234, 237 1234,
238 NPN_SPDY_1); 238 NPN_SPDY_1);
239 alternate = impl_.GetAlternateProtocol(test_host_port_pair); 239 alternate = impl_.GetAlternateProtocol(test_host_port_pair);
240 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol) 240 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol)
241 << "Second attempt should be ignored."; 241 << "Second attempt should be ignored.";
242 } 242 }
243 243
244 TEST_F(AlternateProtocolServerPropertiesTest, Forced) { 244 TEST_F(AlternateProtocolServerPropertiesTest, Forced) {
245 // Test forced alternate protocols. 245 // Test forced alternate protocols.
246 246
247 PortAlternateProtocolPair default_protocol; 247 PortAlternateProtocolPair default_protocol;
248 default_protocol.port = 1234; 248 default_protocol.port = 1234;
249 default_protocol.protocol = NPN_SPDY_21; 249 default_protocol.protocol = NPN_SPDY_2;
250 HttpServerPropertiesImpl::ForceAlternateProtocol(default_protocol); 250 HttpServerPropertiesImpl::ForceAlternateProtocol(default_protocol);
251 251
252 // Verify the forced protocol. 252 // Verify the forced protocol.
253 HostPortPair test_host_port_pair("foo", 80); 253 HostPortPair test_host_port_pair("foo", 80);
254 EXPECT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair)); 254 EXPECT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair));
255 PortAlternateProtocolPair alternate = 255 PortAlternateProtocolPair alternate =
256 impl_.GetAlternateProtocol(test_host_port_pair); 256 impl_.GetAlternateProtocol(test_host_port_pair);
257 EXPECT_EQ(default_protocol.port, alternate.port); 257 EXPECT_EQ(default_protocol.port, alternate.port);
258 EXPECT_EQ(default_protocol.protocol, alternate.protocol); 258 EXPECT_EQ(default_protocol.protocol, alternate.protocol);
259 259
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 EXPECT_EQ(value3, flags_and_value3_ret.second); 395 EXPECT_EQ(value3, flags_and_value3_ret.second);
396 396
397 impl_.Clear(); 397 impl_.Clear();
398 EXPECT_EQ(0U, impl_.GetSpdySettings(spdy_server_google).size()); 398 EXPECT_EQ(0U, impl_.GetSpdySettings(spdy_server_google).size());
399 EXPECT_EQ(0U, impl_.GetSpdySettings(spdy_server_docs).size()); 399 EXPECT_EQ(0U, impl_.GetSpdySettings(spdy_server_docs).size());
400 } 400 }
401 401
402 } // namespace 402 } // namespace
403 403
404 } // namespace net 404 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties.cc ('k') | net/http/http_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698