1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-09 20:42:44 +03:00
Files
mvfst/quic/state/test/QuicPacingFunctionsTest.cpp
Xiaoting Tang 2d00d56fbd Put outstanding packets, events and associated counters in one class
Summary: ^

Reviewed By: yangchi

Differential Revision: D21956286

fbshipit-source-id: 305b879ad11df23aae8e0c3aac4645c0136b3012
2020-06-10 12:45:28 -07:00

36 lines
825 B
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
#include <quic/state/QuicPacingFunctions.h>
#include <folly/portability/GTest.h>
using namespace testing;
namespace quic {
namespace test {
class QuicPacingFunctionsTest : public Test {};
TEST_F(QuicPacingFunctionsTest, OnKeyEstablished) {
QuicConnectionStateBase conn(QuicNodeType::Client);
EXPECT_FALSE(conn.canBePaced);
updatePacingOnKeyEstablished(conn);
EXPECT_TRUE(conn.canBePaced);
}
TEST_F(QuicPacingFunctionsTest, OnClose) {
QuicConnectionStateBase conn(QuicNodeType::Client);
conn.canBePaced = true;
updatePacingOnClose(conn);
EXPECT_FALSE(conn.canBePaced);
}
} // namespace test
} // namespace quic