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

Unified Diff: net/tools/quic/quic_server_session_test.cc

Issue 1422533006: Merge GetIncomingDynamicStream and GetDynamicStream into a single GetOrCreateDynamicStream method i… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106419223
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_server_session_test.cc
diff --git a/net/tools/quic/quic_server_session_test.cc b/net/tools/quic/quic_server_session_test.cc
index 57058276e5d07f1da1d81fc207cdebaa4c380a7f..2b1b9610d80827eaed3aa0f46712e3589a980f3f 100644
--- a/net/tools/quic/quic_server_session_test.cc
+++ b/net/tools/quic/quic_server_session_test.cc
@@ -54,9 +54,9 @@ namespace test {
class QuicServerSessionPeer {
public:
- static ReliableQuicStream* GetIncomingDynamicStream(QuicServerSession* s,
+ static ReliableQuicStream* GetOrCreateDynamicStream(QuicServerSession* s,
QuicStreamId id) {
- return s->GetIncomingDynamicStream(id);
+ return s->GetOrCreateDynamicStream(id);
}
static void SetCryptoStream(QuicServerSession* s,
QuicCryptoServerStream* crypto_stream) {
@@ -213,14 +213,14 @@ TEST_P(QuicServerSessionTest, MaxOpenStreams) {
QuicStreamId stream_id = kClientDataStreamId1;
// Open the max configured number of streams, should be no problem.
for (size_t i = 0; i < kMaxStreamsForTest; ++i) {
- EXPECT_TRUE(QuicServerSessionPeer::GetIncomingDynamicStream(session_.get(),
+ EXPECT_TRUE(QuicServerSessionPeer::GetOrCreateDynamicStream(session_.get(),
stream_id));
stream_id += 2;
}
// Open more streams: server should accept slightly more than the limit.
for (size_t i = 0; i < kMaxStreamsMinimumIncrement; ++i) {
- EXPECT_TRUE(QuicServerSessionPeer::GetIncomingDynamicStream(session_.get(),
+ EXPECT_TRUE(QuicServerSessionPeer::GetOrCreateDynamicStream(session_.get(),
stream_id));
stream_id += 2;
}
@@ -235,7 +235,7 @@ TEST_P(QuicServerSessionTest, MaxOpenStreams) {
EXPECT_CALL(*connection_, SendRstStream(stream_id, QUIC_REFUSED_STREAM, 0));
}
// Even if the connection remains open, the stream creation should fail.
- EXPECT_FALSE(QuicServerSessionPeer::GetIncomingDynamicStream(session_.get(),
+ EXPECT_FALSE(QuicServerSessionPeer::GetOrCreateDynamicStream(session_.get(),
stream_id));
}
@@ -255,7 +255,7 @@ TEST_P(QuicServerSessionTest, MaxAvailableStreams) {
EXPECT_LE(10 * kMaxStreamsForTest, kAvailableStreamLimit);
EXPECT_EQ(0u, session_->GetNumOpenStreams());
- EXPECT_TRUE(QuicServerSessionPeer::GetIncomingDynamicStream(
+ EXPECT_TRUE(QuicServerSessionPeer::GetOrCreateDynamicStream(
session_.get(), kClientDataStreamId1));
// Establish available streams up to the server's limit.
@@ -263,7 +263,7 @@ TEST_P(QuicServerSessionTest, MaxAvailableStreams) {
FLAGS_allow_many_available_streams
? kClientDataStreamId1 + (kAvailableStreamLimit)*2 + 2
: kClientDataStreamId1 + (session_->get_max_open_streams() - 1) * 2;
- EXPECT_TRUE(QuicServerSessionPeer::GetIncomingDynamicStream(
+ EXPECT_TRUE(QuicServerSessionPeer::GetOrCreateDynamicStream(
session_.get(), kLimitingStreamId));
// A further available stream will result in connection close.
@@ -275,7 +275,7 @@ TEST_P(QuicServerSessionTest, MaxAvailableStreams) {
}
// This forces stream kLimitingStreamId + 2 to become available, which
// violates the quota.
- EXPECT_FALSE(QuicServerSessionPeer::GetIncomingDynamicStream(
+ EXPECT_FALSE(QuicServerSessionPeer::GetOrCreateDynamicStream(
session_.get(), kLimitingStreamId + 4));
}
@@ -283,14 +283,14 @@ TEST_P(QuicServerSessionTest, GetEvenIncomingError) {
// Incoming streams on the server session must be odd.
EXPECT_CALL(*connection_, SendConnectionClose(QUIC_INVALID_STREAM_ID));
EXPECT_EQ(nullptr,
- QuicServerSessionPeer::GetIncomingDynamicStream(session_.get(), 4));
+ QuicServerSessionPeer::GetOrCreateDynamicStream(session_.get(), 4));
}
TEST_P(QuicServerSessionTest, GetStreamDisconnected) {
// Don't create new streams if the connection is disconnected.
QuicConnectionPeer::CloseConnection(connection_);
EXPECT_DFATAL(
- QuicServerSessionPeer::GetIncomingDynamicStream(session_.get(), 5),
+ QuicServerSessionPeer::GetOrCreateDynamicStream(session_.get(), 5),
"ShouldCreateIncomingDynamicStream called when disconnected");
}
@@ -307,7 +307,7 @@ TEST_P(QuicServerSessionTest, SetFecProtectionFromConfig) {
// optionally protected.
EXPECT_EQ(FEC_PROTECT_ALWAYS, QuicSpdySessionPeer::GetHeadersStream(
session_.get())->fec_policy());
- ReliableQuicStream* stream = QuicServerSessionPeer::GetIncomingDynamicStream(
+ ReliableQuicStream* stream = QuicServerSessionPeer::GetOrCreateDynamicStream(
session_.get(), kClientDataStreamId1);
ASSERT_TRUE(stream);
EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream->fec_policy());
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698