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

Side by Side Diff: net/tools/quic/end_to_end_test.cc

Issue 2464603002: Break reliance of QuicDispatcher on QuicServerSessionBase (Closed)
Patch Set: Updated patchset dependency Created 4 years, 1 month 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
« no previous file with comments | « net/quic/core/quic_server_session_base.h ('k') | net/tools/quic/quic_dispatcher.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 <stddef.h> 5 #include <stddef.h>
6 #include <sys/epoll.h> 6 #include <sys/epoll.h>
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 1811
1812 ASSERT_TRUE(Initialize()); 1812 ASSERT_TRUE(Initialize());
1813 1813
1814 client_->client()->WaitForCryptoHandshakeConfirmed(); 1814 client_->client()->WaitForCryptoHandshakeConfirmed();
1815 server_thread_->WaitForCryptoHandshakeConfirmed(); 1815 server_thread_->WaitForCryptoHandshakeConfirmed();
1816 1816
1817 server_thread_->Pause(); 1817 server_thread_->Pause();
1818 QuicSpdySession* const client_session = client_->client()->session(); 1818 QuicSpdySession* const client_session = client_->client()->session();
1819 QuicDispatcher* dispatcher = 1819 QuicDispatcher* dispatcher =
1820 QuicServerPeer::GetDispatcher(server_thread_->server()); 1820 QuicServerPeer::GetDispatcher(server_thread_->server());
1821 QuicSpdySession* server_session = 1821 auto server_session = static_cast<QuicSpdySession*>(
1822 dispatcher->session_map().begin()->second.get(); 1822 dispatcher->session_map().begin()->second.get());
1823 1823
1824 ExpectFlowControlsSynced(client_session->flow_controller(), 1824 ExpectFlowControlsSynced(client_session->flow_controller(),
1825 server_session->flow_controller()); 1825 server_session->flow_controller());
1826 ExpectFlowControlsSynced( 1826 ExpectFlowControlsSynced(
1827 QuicSessionPeer::GetCryptoStream(client_session)->flow_controller(), 1827 QuicSessionPeer::GetCryptoStream(client_session)->flow_controller(),
1828 QuicSessionPeer::GetCryptoStream(server_session)->flow_controller()); 1828 QuicSessionPeer::GetCryptoStream(server_session)->flow_controller());
1829 ExpectFlowControlsSynced( 1829 ExpectFlowControlsSynced(
1830 QuicSpdySessionPeer::GetHeadersStream(client_session)->flow_controller(), 1830 QuicSpdySessionPeer::GetHeadersStream(client_session)->flow_controller(),
1831 QuicSpdySessionPeer::GetHeadersStream(server_session)->flow_controller()); 1831 QuicSpdySessionPeer::GetHeadersStream(server_session)->flow_controller());
1832 1832
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
2453 2453
2454 // Pause the server so we can access the server's internals without races. 2454 // Pause the server so we can access the server's internals without races.
2455 server_thread_->Pause(); 2455 server_thread_->Pause();
2456 2456
2457 QuicDispatcher* dispatcher = 2457 QuicDispatcher* dispatcher =
2458 QuicServerPeer::GetDispatcher(server_thread_->server()); 2458 QuicServerPeer::GetDispatcher(server_thread_->server());
2459 QuicDispatcher::SessionMap const& map = 2459 QuicDispatcher::SessionMap const& map =
2460 QuicDispatcherPeer::session_map(dispatcher); 2460 QuicDispatcherPeer::session_map(dispatcher);
2461 QuicDispatcher::SessionMap::const_iterator it = map.begin(); 2461 QuicDispatcher::SessionMap::const_iterator it = map.begin();
2462 EXPECT_TRUE(it != map.end()); 2462 EXPECT_TRUE(it != map.end());
2463 QuicServerSessionBase* server_session = it->second.get(); 2463 QuicSession* server_session = it->second.get();
2464 2464
2465 // The stream is not waiting for the arrival of the peer's final offset. 2465 // The stream is not waiting for the arrival of the peer's final offset.
2466 EXPECT_EQ( 2466 EXPECT_EQ(
2467 0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(server_session) 2467 0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(server_session)
2468 .size()); 2468 .size());
2469 2469
2470 server_thread_->Resume(); 2470 server_thread_->Resume();
2471 } 2471 }
2472 2472
2473 TEST_P(EndToEndTest, LargePostEarlyResponse) { 2473 TEST_P(EndToEndTest, LargePostEarlyResponse) {
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 client_->WaitForResponse(); 2984 client_->WaitForResponse();
2985 EXPECT_EQ(kBarResponseBody, client_->response_body()); 2985 EXPECT_EQ(kBarResponseBody, client_->response_body());
2986 QuicConnectionStats client_stats = 2986 QuicConnectionStats client_stats =
2987 client_->client()->session()->connection()->GetStats(); 2987 client_->client()->session()->connection()->GetStats();
2988 EXPECT_EQ(0u, client_stats.packets_lost); 2988 EXPECT_EQ(0u, client_stats.packets_lost);
2989 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); 2989 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos());
2990 } 2990 }
2991 } // namespace 2991 } // namespace
2992 } // namespace test 2992 } // namespace test
2993 } // namespace net 2993 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_server_session_base.h ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698