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

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

Issue 2589983002: Create a QUIC wrapper around scoped_refptr. (Closed)
Patch Set: rm = nullptr Created 4 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_simple_server_session.h" 5 #include "net/tools/quic/quic_simple_server_session.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 QuicStreamId promised_stream_id, 72 QuicStreamId promised_stream_id,
73 SpdyHeaderBlock headers) override { 73 SpdyHeaderBlock headers) override {
74 return WritePushPromiseMock(original_stream_id, promised_stream_id, 74 return WritePushPromiseMock(original_stream_id, promised_stream_id,
75 headers); 75 headers);
76 } 76 }
77 MOCK_METHOD3(WritePushPromiseMock, 77 MOCK_METHOD3(WritePushPromiseMock,
78 size_t(QuicStreamId original_stream_id, 78 size_t(QuicStreamId original_stream_id,
79 QuicStreamId promised_stream_id, 79 QuicStreamId promised_stream_id,
80 const SpdyHeaderBlock& headers)); 80 const SpdyHeaderBlock& headers));
81 81
82 size_t WriteHeaders( 82 size_t WriteHeaders(QuicStreamId stream_id,
83 QuicStreamId stream_id, 83 SpdyHeaderBlock headers,
84 SpdyHeaderBlock headers, 84 bool fin,
85 bool fin, 85 SpdyPriority priority,
86 SpdyPriority priority, 86 QuicReferenceCountedPointer<QuicAckListenerInterface>
87 scoped_refptr<QuicAckListenerInterface> ack_listener) override { 87 ack_listener) override {
88 return WriteHeadersMock(stream_id, headers, fin, priority, ack_listener); 88 return WriteHeadersMock(stream_id, headers, fin, priority, ack_listener);
89 } 89 }
90 MOCK_METHOD5( 90 MOCK_METHOD5(
91 WriteHeadersMock, 91 WriteHeadersMock,
92 size_t(QuicStreamId stream_id, 92 size_t(QuicStreamId stream_id,
93 const SpdyHeaderBlock& headers, 93 const SpdyHeaderBlock& headers,
94 bool fin, 94 bool fin,
95 SpdyPriority priority, 95 SpdyPriority priority,
96 const scoped_refptr<QuicAckListenerInterface>& ack_listener)); 96 const QuicReferenceCountedPointer<QuicAckListenerInterface>&
97 ack_listener));
97 }; 98 };
98 99
99 class MockQuicCryptoServerStream : public QuicCryptoServerStream { 100 class MockQuicCryptoServerStream : public QuicCryptoServerStream {
100 public: 101 public:
101 explicit MockQuicCryptoServerStream( 102 explicit MockQuicCryptoServerStream(
102 const QuicCryptoServerConfig* crypto_config, 103 const QuicCryptoServerConfig* crypto_config,
103 QuicCompressedCertsCache* compressed_certs_cache, 104 QuicCompressedCertsCache* compressed_certs_cache,
104 QuicServerSessionBase* session, 105 QuicServerSessionBase* session,
105 QuicCryptoServerStream::Helper* helper) 106 QuicCryptoServerStream::Helper* helper)
106 : QuicCryptoServerStream(crypto_config, 107 : QuicCryptoServerStream(crypto_config,
(...skipping 21 matching lines...) Expand all
128 MockAlarmFactory* alarm_factory, 129 MockAlarmFactory* alarm_factory,
129 Perspective perspective, 130 Perspective perspective,
130 const QuicVersionVector& supported_versions) 131 const QuicVersionVector& supported_versions)
131 : MockQuicConnection(helper, 132 : MockQuicConnection(helper,
132 alarm_factory, 133 alarm_factory,
133 perspective, 134 perspective,
134 supported_versions) {} 135 supported_versions) {}
135 136
136 MOCK_METHOD5( 137 MOCK_METHOD5(
137 SendStreamData, 138 SendStreamData,
138 QuicConsumedData(QuicStreamId id, 139 QuicConsumedData(
139 QuicIOVector iov, 140 QuicStreamId id,
140 QuicStreamOffset offset, 141 QuicIOVector iov,
141 bool fin, 142 QuicStreamOffset offset,
142 scoped_refptr<QuicAckListenerInterface> listern)); 143 bool fin,
144 QuicReferenceCountedPointer<QuicAckListenerInterface> listern));
143 }; 145 };
144 146
145 class QuicSimpleServerSessionPeer { 147 class QuicSimpleServerSessionPeer {
146 public: 148 public:
147 static void SetCryptoStream(QuicSimpleServerSession* s, 149 static void SetCryptoStream(QuicSimpleServerSession* s,
148 QuicCryptoServerStream* crypto_stream) { 150 QuicCryptoServerStream* crypto_stream) {
149 s->crypto_stream_.reset(crypto_stream); 151 s->crypto_stream_.reset(crypto_stream);
150 s->static_streams()[kCryptoStreamId] = crypto_stream; 152 s->static_streams()[kCryptoStreamId] = crypto_stream;
151 } 153 }
152 154
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 .WillOnce(Return(QuicConsumedData(kStreamFlowControlWindowSize, false))); 621 .WillOnce(Return(QuicConsumedData(kStreamFlowControlWindowSize, false)));
620 622
621 EXPECT_CALL(*connection_, SendBlocked(stream_to_open)); 623 EXPECT_CALL(*connection_, SendBlocked(stream_to_open));
622 QuicRstStreamFrame rst(stream_got_reset, QUIC_STREAM_CANCELLED, 0); 624 QuicRstStreamFrame rst(stream_got_reset, QUIC_STREAM_CANCELLED, 0);
623 visitor_->OnRstStream(rst); 625 visitor_->OnRstStream(rst);
624 } 626 }
625 627
626 } // namespace 628 } // namespace
627 } // namespace test 629 } // namespace test
628 } // namespace net 630 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_simple_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698