1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-08 09:42:06 +03:00

Getter API of Quic stream priority

Summary: as title

Reviewed By: afrind, avasylev

Differential Revision: D26744365

fbshipit-source-id: 5c5d104ca76c77f14371c20d6f791fca8d7cfe38
This commit is contained in:
Yang Chi
2021-03-02 19:38:43 -08:00
committed by Facebook GitHub Bot
parent 6f63fa59ca
commit 0b42e07216
6 changed files with 40 additions and 1 deletions

View File

@@ -3265,5 +3265,19 @@ TEST_F(QuicTransportTest, GetStreamPacketsTxedMultiplePackets) {
Mock::VerifyAndClearExpectations(&lastByteTxCb);
}
TEST_F(QuicTransportTest, PrioritySetAndGet) {
auto stream = transport_->createBidirectionalStream().value();
EXPECT_EQ(kDefaultPriority, transport_->getStreamPriority(stream).value());
transport_->setStreamPriority(stream, 0, false);
EXPECT_EQ(Priority(0, false), transport_->getStreamPriority(stream).value());
auto nonExistStreamPri = transport_->getStreamPriority(stream + 4);
EXPECT_TRUE(nonExistStreamPri.hasError());
EXPECT_EQ(LocalErrorCode::STREAM_NOT_EXISTS, nonExistStreamPri.error());
transport_->close(folly::none);
auto closedConnStreamPri = transport_->getStreamPriority(stream);
EXPECT_TRUE(closedConnStreamPri.hasError());
EXPECT_EQ(LocalErrorCode::CONNECTION_CLOSED, closedConnStreamPri.error());
}
} // namespace test
} // namespace quic