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

Side by Side Diff: net/spdy/spdy_session_unittest.cc

Issue 7349023: Changed SPDY's ip connection pooling logic to only add the used IP, (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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
« net/spdy/spdy_session_pool.cc ('K') | « net/spdy/spdy_session_pool.cc ('k') | no next file » | 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) 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // manually, calling SpdySessionPool::Remove() directly. If it is true, 411 // manually, calling SpdySessionPool::Remove() directly. If it is true,
412 // sessions are closed with SpdySessionPool::CloseCurrentSessions(). 412 // sessions are closed with SpdySessionPool::CloseCurrentSessions().
413 void IPPoolingTest(bool clean_via_close_current_sessions) { 413 void IPPoolingTest(bool clean_via_close_current_sessions) {
414 const int kTestPort = 80; 414 const int kTestPort = 80;
415 struct TestHosts { 415 struct TestHosts {
416 std::string name; 416 std::string name;
417 std::string iplist; 417 std::string iplist;
418 HostPortProxyPair pair; 418 HostPortProxyPair pair;
419 } test_hosts[] = { 419 } test_hosts[] = {
420 { "www.foo.com", "192.168.0.1,192.168.0.5" }, 420 { "www.foo.com", "192.168.0.1,192.168.0.5" },
421 { "images.foo.com", "192.168.0.2,192.168.0.3,192.168.0.5" }, 421 { "images.foo.com", "192.168.0.2,192.168.0.3,192.168.0.1" },
422 { "js.foo.com", "192.168.0.4,192.168.0.3" }, 422 { "js.foo.com", "192.168.0.4,192.168.0.3" },
423 }; 423 };
424 424
425 SpdySessionDependencies session_deps; 425 SpdySessionDependencies session_deps;
426 session_deps.host_resolver->set_synchronous_mode(true); 426 session_deps.host_resolver->set_synchronous_mode(true);
427 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) { 427 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) {
428 session_deps.host_resolver->rules()->AddIPLiteralRule(test_hosts[i].name, 428 session_deps.host_resolver->rules()->AddIPLiteralRule(test_hosts[i].name,
429 test_hosts[i].iplist, ""); 429 test_hosts[i].iplist, "");
430 430
431 // This test requires that the HostResolver cache be populated. Normal 431 // This test requires that the HostResolver cache be populated. Normal
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 566
567 test_settings_storage->Set(test_host_port_pair, test_settings); 567 test_settings_storage->Set(test_host_port_pair, test_settings);
568 EXPECT_NE(0u, test_settings_storage->Get(test_host_port_pair).size()); 568 EXPECT_NE(0u, test_settings_storage->Get(test_host_port_pair).size());
569 spdy_session_pool->OnIPAddressChanged(); 569 spdy_session_pool->OnIPAddressChanged();
570 EXPECT_EQ(0u, test_settings_storage->Get(test_host_port_pair).size()); 570 EXPECT_EQ(0u, test_settings_storage->Get(test_host_port_pair).size());
571 } 571 }
572 572
573 } // namespace 573 } // namespace
574 574
575 } // namespace net 575 } // namespace net
OLDNEW
« net/spdy/spdy_session_pool.cc ('K') | « net/spdy/spdy_session_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698