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

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

Issue 10309002: Reimplements net::AddressList without struct addrinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get_canonical_name -> canonical_name. iterator to indexing Created 8 years, 7 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/spdy/spdy_session_spdy2_unittest.cc ('k') | net/spdy/spdy_test_util_spdy2.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/spdy/spdy_session.h" 5 #include "net/spdy/spdy_session.h"
6 6
7 #include "net/base/host_cache.h" 7 #include "net/base/host_cache.h"
8 #include "net/base/ip_endpoint.h" 8 #include "net/base/ip_endpoint.h"
9 #include "net/base/net_log_unittest.h" 9 #include "net/base/net_log_unittest.h"
10 #include "net/spdy/spdy_io_buffer.h" 10 #include "net/spdy/spdy_io_buffer.h"
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); 803 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle);
804 EXPECT_EQ(OK, connection->Init(test_host_port_pair.ToString(), 804 EXPECT_EQ(OK, connection->Init(test_host_port_pair.ToString(),
805 transport_params, MEDIUM, CompletionCallback(), 805 transport_params, MEDIUM, CompletionCallback(),
806 http_session->GetTransportSocketPool( 806 http_session->GetTransportSocketPool(
807 HttpNetworkSession::NORMAL_SOCKET_POOL), 807 HttpNetworkSession::NORMAL_SOCKET_POOL),
808 BoundNetLog())); 808 BoundNetLog()));
809 EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK)); 809 EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
810 810
811 // TODO(rtenneti): MockClientSocket::GetPeerAddress return's 0 as the port 811 // TODO(rtenneti): MockClientSocket::GetPeerAddress return's 0 as the port
812 // number. Fix it to return port 80 and then use GetPeerAddress to AddAlias. 812 // number. Fix it to return port 80 and then use GetPeerAddress to AddAlias.
813 const addrinfo* address = test_hosts[0].addresses.head();
814 SpdySessionPoolPeer pool_peer(spdy_session_pool); 813 SpdySessionPoolPeer pool_peer(spdy_session_pool);
815 pool_peer.AddAlias(address, test_hosts[0].pair); 814 pool_peer.AddAlias(test_hosts[0].addresses.front(), test_hosts[0].pair);
816 815
817 // Flush the SpdySession::OnReadComplete() task. 816 // Flush the SpdySession::OnReadComplete() task.
818 MessageLoop::current()->RunAllPending(); 817 MessageLoop::current()->RunAllPending();
819 818
820 // The third host has no overlap with the first, so it can't pool IPs. 819 // The third host has no overlap with the first, so it can't pool IPs.
821 EXPECT_FALSE(spdy_session_pool->HasSession(test_hosts[2].pair)); 820 EXPECT_FALSE(spdy_session_pool->HasSession(test_hosts[2].pair));
822 821
823 // The second host overlaps with the first, and should IP pool. 822 // The second host overlaps with the first, and should IP pool.
824 EXPECT_TRUE(spdy_session_pool->HasSession(test_hosts[1].pair)); 823 EXPECT_TRUE(spdy_session_pool->HasSession(test_hosts[1].pair));
825 824
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 &spdy_stream2, 1192 &spdy_stream2,
1194 BoundNetLog(), 1193 BoundNetLog(),
1195 callback1.callback())); 1194 callback1.callback()));
1196 1195
1197 EXPECT_EQ(spdy_stream2->send_window_size(), window_size); 1196 EXPECT_EQ(spdy_stream2->send_window_size(), window_size);
1198 spdy_stream2->Cancel(); 1197 spdy_stream2->Cancel();
1199 spdy_stream2 = NULL; 1198 spdy_stream2 = NULL;
1200 } 1199 }
1201 1200
1202 } // namespace net 1201 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_spdy2_unittest.cc ('k') | net/spdy/spdy_test_util_spdy2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698