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

Side by Side Diff: net/quic/core/quic_session_test.cc

Issue 2306173003: Add a new QuicFlagSaver class for saving/restoring the values of QUIC flags in tests. (Closed)
Patch Set: Better Created 4 years, 3 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
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/quic/core/quic_session.h" 5 #include "net/quic/core/quic_session.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 259 }
260 260
261 void CloseStream(QuicStreamId id) { 261 void CloseStream(QuicStreamId id) {
262 EXPECT_CALL(*connection_, SendRstStream(id, _, _)); 262 EXPECT_CALL(*connection_, SendRstStream(id, _, _));
263 session_.CloseStream(id); 263 session_.CloseStream(id);
264 closed_streams_.insert(id); 264 closed_streams_.insert(id);
265 } 265 }
266 266
267 QuicVersion version() const { return connection_->version(); } 267 QuicVersion version() const { return connection_->version(); }
268 268
269 QuicFlagSaver flags_; // Save/restore all QUIC flag values.
269 MockQuicConnectionHelper helper_; 270 MockQuicConnectionHelper helper_;
270 MockAlarmFactory alarm_factory_; 271 MockAlarmFactory alarm_factory_;
271 StrictMock<MockQuicConnection>* connection_; 272 StrictMock<MockQuicConnection>* connection_;
272 TestSession session_; 273 TestSession session_;
273 set<QuicStreamId> closed_streams_; 274 set<QuicStreamId> closed_streams_;
274 SpdyHeaderBlock headers_; 275 SpdyHeaderBlock headers_;
275 }; 276 };
276 277
277 class QuicSessionTestServer : public QuicSessionTestBase { 278 class QuicSessionTestServer : public QuicSessionTestBase {
278 protected: 279 protected:
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 if (version() <= QUIC_VERSION_35) { 1253 if (version() <= QUIC_VERSION_35) {
1253 EXPECT_FALSE(session_.force_hol_blocking()); 1254 EXPECT_FALSE(session_.force_hol_blocking());
1254 } else { 1255 } else {
1255 EXPECT_TRUE(session_.force_hol_blocking()); 1256 EXPECT_TRUE(session_.force_hol_blocking());
1256 } 1257 }
1257 } 1258 }
1258 1259
1259 } // namespace 1260 } // namespace
1260 } // namespace test 1261 } // namespace test
1261 } // namespace net 1262 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_server_session_base_test.cc ('k') | net/quic/core/quic_stream_sequencer_buffer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698