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

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

Issue 1009543004: Create a Perspective enum to use instead of a bool is_server to improve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NET_EXPORT_PRIVATE to fix compiler error 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_session_test.cc » ('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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 }; 63 };
64 64
65 // A Connection class which unregisters the session from the dispatcher 65 // A Connection class which unregisters the session from the dispatcher
66 // when sending connection close. 66 // when sending connection close.
67 // It'd be slightly more realistic to do this from the Session but it would 67 // It'd be slightly more realistic to do this from the Session but it would
68 // involve a lot more mocking. 68 // involve a lot more mocking.
69 class MockServerConnection : public MockConnection { 69 class MockServerConnection : public MockConnection {
70 public: 70 public:
71 MockServerConnection(QuicConnectionId connection_id, 71 MockServerConnection(QuicConnectionId connection_id,
72 QuicDispatcher* dispatcher) 72 QuicDispatcher* dispatcher)
73 : MockConnection(connection_id, true), 73 : MockConnection(connection_id, Perspective::IS_SERVER),
74 dispatcher_(dispatcher) {} 74 dispatcher_(dispatcher) {}
75 75
76 void UnregisterOnConnectionClosed() { 76 void UnregisterOnConnectionClosed() {
77 LOG(ERROR) << "Unregistering " << connection_id(); 77 LOG(ERROR) << "Unregistering " << connection_id();
78 dispatcher_->OnConnectionClosed(connection_id(), QUIC_NO_ERROR); 78 dispatcher_->OnConnectionClosed(connection_id(), QUIC_NO_ERROR);
79 } 79 }
80 private: 80 private:
81 QuicDispatcher* dispatcher_; 81 QuicDispatcher* dispatcher_;
82 }; 82 };
83 83
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 // And we'll resume where we left off when we get another call. 480 // And we'll resume where we left off when we get another call.
481 EXPECT_CALL(*connection2(), OnCanWrite()); 481 EXPECT_CALL(*connection2(), OnCanWrite());
482 dispatcher_.OnCanWrite(); 482 dispatcher_.OnCanWrite();
483 EXPECT_FALSE(dispatcher_.HasPendingWrites()); 483 EXPECT_FALSE(dispatcher_.HasPendingWrites());
484 } 484 }
485 485
486 } // namespace 486 } // namespace
487 } // namespace test 487 } // namespace test
488 } // namespace tools 488 } // namespace tools
489 } // namespace net 489 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698