OLD | NEW |
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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 } | 336 } |
337 | 337 |
338 TEST_F(AlternateProtocolServerPropertiesTest, SetBroken) { | 338 TEST_F(AlternateProtocolServerPropertiesTest, SetBroken) { |
339 HostPortPair test_host_port_pair("foo", 80); | 339 HostPortPair test_host_port_pair("foo", 80); |
340 impl_.SetBrokenAlternateProtocol(test_host_port_pair); | 340 impl_.SetBrokenAlternateProtocol(test_host_port_pair); |
341 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair)); | 341 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair)); |
342 PortAlternateProtocolPair alternate = | 342 PortAlternateProtocolPair alternate = |
343 impl_.GetAlternateProtocol(test_host_port_pair); | 343 impl_.GetAlternateProtocol(test_host_port_pair); |
344 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol); | 344 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol); |
345 | 345 |
346 impl_.SetAlternateProtocol( | 346 impl_.SetAlternateProtocol(test_host_port_pair, 1234, NPN_SPDY_3); |
347 test_host_port_pair, | |
348 1234, | |
349 NPN_SPDY_3); | |
350 alternate = impl_.GetAlternateProtocol(test_host_port_pair); | 347 alternate = impl_.GetAlternateProtocol(test_host_port_pair); |
351 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol) | 348 EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol) |
352 << "Second attempt should be ignored."; | 349 << "Second attempt should be ignored."; |
353 } | 350 } |
354 | 351 |
355 TEST_F(AlternateProtocolServerPropertiesTest, ClearBroken) { | 352 TEST_F(AlternateProtocolServerPropertiesTest, ClearBroken) { |
356 HostPortPair test_host_port_pair("foo", 80); | 353 HostPortPair test_host_port_pair("foo", 80); |
357 impl_.SetBrokenAlternateProtocol(test_host_port_pair); | 354 impl_.SetBrokenAlternateProtocol(test_host_port_pair); |
358 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair)); | 355 ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair)); |
359 PortAlternateProtocolPair alternate = | 356 PortAlternateProtocolPair alternate = |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 it1_ret = settings_map1_it_ret.find(id1); | 597 it1_ret = settings_map1_it_ret.find(id1); |
601 EXPECT_TRUE(it1_ret != settings_map1_it_ret.end()); | 598 EXPECT_TRUE(it1_ret != settings_map1_it_ret.end()); |
602 flags_and_value1_ret = it1_ret->second; | 599 flags_and_value1_ret = it1_ret->second; |
603 EXPECT_EQ(SETTINGS_FLAG_PERSISTED, flags_and_value1_ret.first); | 600 EXPECT_EQ(SETTINGS_FLAG_PERSISTED, flags_and_value1_ret.first); |
604 EXPECT_EQ(value1, flags_and_value1_ret.second); | 601 EXPECT_EQ(value1, flags_and_value1_ret.second); |
605 } | 602 } |
606 | 603 |
607 } // namespace | 604 } // namespace |
608 | 605 |
609 } // namespace net | 606 } // namespace net |
OLD | NEW |