Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include "net/spdy/spdy_io_buffer.h" | 7 #include "net/spdy/spdy_io_buffer.h" |
| 8 #include "net/spdy/spdy_session_pool.h" | 8 #include "net/spdy/spdy_session_pool.h" |
| 9 #include "net/spdy/spdy_stream.h" | 9 #include "net/spdy/spdy_stream.h" |
| 10 #include "net/spdy/spdy_test_util.h" | 10 #include "net/spdy/spdy_test_util.h" |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 520 } | 520 } |
| 521 | 521 |
| 522 TEST_F(SpdySessionTest, IPPooling) { | 522 TEST_F(SpdySessionTest, IPPooling) { |
| 523 IPPoolingTest(false); | 523 IPPoolingTest(false); |
| 524 } | 524 } |
| 525 | 525 |
| 526 TEST_F(SpdySessionTest, IPPoolingCloseCurrentSessions) { | 526 TEST_F(SpdySessionTest, IPPoolingCloseCurrentSessions) { |
| 527 IPPoolingTest(true); | 527 IPPoolingTest(true); |
| 528 } | 528 } |
| 529 | 529 |
| 530 TEST_F(SpdySessionTest, ClearSettingsStorage) { | |
| 531 SpdySettingsStorage new_settings_storage; | |
|
wtc
2011/05/21 01:38:33
Nit: please remove "new_" from the variable name.
rkn1
2011/05/21 01:54:40
Done.
| |
| 532 const std::string kTestHost("www.foo.com"); | |
| 533 const int kTestPort = 80; | |
| 534 HostPortPair test_host_port_pair(kTestHost, kTestPort); | |
| 535 spdy::SpdySettings test_settings; | |
| 536 spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST); | |
| 537 id.set_id(spdy::SETTINGS_FLAG_PLEASE_PERSIST); | |
|
wtc
2011/05/21 01:38:33
This comment also applies to the next unit test.
rkn1
2011/05/21 01:54:40
Done.
| |
| 538 const size_t max_concurrent_streams = 2; | |
| 539 test_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); | |
| 540 | |
| 541 new_settings_storage.Set(test_host_port_pair, test_settings); | |
| 542 EXPECT_NE(0u, new_settings_storage.Get(test_host_port_pair).size()); | |
| 543 new_settings_storage.Clear(); | |
| 544 EXPECT_EQ(0u, new_settings_storage.Get(test_host_port_pair).size()); | |
| 545 } | |
| 546 | |
| 547 TEST_F(SpdySessionTest, ClearSettingsStorageOnIPAddressChanged) { | |
| 548 const std::string kTestHost("www.foo.com"); | |
| 549 const int kTestPort = 80; | |
| 550 HostPortPair test_host_port_pair(kTestHost, kTestPort); | |
| 551 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); | |
|
wtc
2011/05/21 01:38:33
Delete this line. The 'pair' variable is not used
rkn1
2011/05/21 01:54:40
Done.
| |
| 552 | |
| 553 SpdySessionDependencies session_deps; | |
| 554 scoped_refptr<HttpNetworkSession> http_session( | |
| 555 SpdySessionDependencies::SpdyCreateSession(&session_deps)); | |
| 556 SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool()); | |
| 557 | |
| 558 SpdySettingsStorage* test_settings_storage = | |
| 559 spdy_session_pool->mutable_spdy_settings(); | |
| 560 spdy::SettingsFlagsAndId id(spdy::SETTINGS_FLAG_PLEASE_PERSIST); | |
| 561 const size_t max_concurrent_streams = 2; | |
| 562 spdy::SpdySettings test_settings; | |
| 563 test_settings.push_back(spdy::SpdySetting(id, max_concurrent_streams)); | |
| 564 | |
| 565 test_settings_storage->Set(test_host_port_pair, test_settings); | |
| 566 EXPECT_NE(0u, test_settings_storage->Get(test_host_port_pair).size()); | |
| 567 spdy_session_pool->OnIPAddressChanged(); | |
| 568 EXPECT_EQ(0u, test_settings_storage->Get(test_host_port_pair).size()); | |
| 569 } | |
| 570 | |
| 530 } // namespace | 571 } // namespace |
| 531 | 572 |
| 532 } // namespace net | 573 } // namespace net |
| OLD | NEW |