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

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

Issue 1031243002: Unify the QUIC dispatcher and make the QuicServer work. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: QuicChromeServerDispatchPacketTest Created 5 years, 9 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
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_server.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/tools/quic/quic_dispatcher.h" 5 #include "net/tools/quic/quic_dispatcher.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "net/quic/crypto/crypto_handshake.h" 10 #include "net/quic/crypto/crypto_handshake.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 class QuicDispatcherTest : public ::testing::Test { 118 class QuicDispatcherTest : public ::testing::Test {
119 public: 119 public:
120 QuicDispatcherTest() 120 QuicDispatcherTest()
121 : helper_(&eps_), 121 : helper_(&eps_),
122 crypto_config_(QuicCryptoServerConfig::TESTING, 122 crypto_config_(QuicCryptoServerConfig::TESTING,
123 QuicRandom::GetInstance()), 123 QuicRandom::GetInstance()),
124 dispatcher_(config_, crypto_config_, &eps_), 124 dispatcher_(config_, crypto_config_, &eps_),
125 time_wait_list_manager_(nullptr), 125 time_wait_list_manager_(nullptr),
126 session1_(nullptr), 126 session1_(nullptr),
127 session2_(nullptr) { 127 session2_(nullptr) {
128 dispatcher_.Initialize(1); 128 dispatcher_.InitializeWithWriter(new QuicDefaultPacketWriter(1));
129 } 129 }
130 130
131 ~QuicDispatcherTest() override {} 131 ~QuicDispatcherTest() override {}
132 132
133 MockConnection* connection1() { 133 MockConnection* connection1() {
134 return reinterpret_cast<MockConnection*>(session1_->connection()); 134 return reinterpret_cast<MockConnection*>(session1_->connection());
135 } 135 }
136 136
137 MockConnection* connection2() { 137 MockConnection* connection2() {
138 return reinterpret_cast<MockConnection*>(session2_->connection()); 138 return reinterpret_cast<MockConnection*>(session2_->connection());
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 // And we'll resume where we left off when we get another call. 489 // And we'll resume where we left off when we get another call.
490 EXPECT_CALL(*connection2(), OnCanWrite()); 490 EXPECT_CALL(*connection2(), OnCanWrite());
491 dispatcher_.OnCanWrite(); 491 dispatcher_.OnCanWrite();
492 EXPECT_FALSE(dispatcher_.HasPendingWrites()); 492 EXPECT_FALSE(dispatcher_.HasPendingWrites());
493 } 493 }
494 494
495 } // namespace 495 } // namespace
496 } // namespace test 496 } // namespace test
497 } // namespace tools 497 } // namespace tools
498 } // namespace net 498 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698