Make VideoSendStreamTest.DoesNotUtilizeUlpfecForH264WithNackEnabled useful again.
This test was inadvertently made useless in https://codereview.webrtc.org/2558303002/. Prior to that CL, at least 100 media packets -- but no ULPFEC packets -- had to be sent before the test claimed that ULPFEC was not utilized. This CL reinstates that behaviour, but instead of counting packets we expect the test to time out when ULPFEC should not be utilized. This solution is simple in code, but increases the test duration from 70 ms to 10000 ms. Note, however, that the 70 ms duration was for a test that didn't test anything interesting... TESTED=Using gtest-parallel locally: 2000 test runs without flakes. BUG=webrtc:6851 Review-Url: https://codereview.webrtc.org/2592693002 Cr-Commit-Position: refs/heads/master@{#15859}
This commit is contained in:
parent
a82775f6a6
commit
20d4547e5d
@ -358,7 +358,7 @@ class UlpfecObserver : public test::EndToEndTest {
|
||||
bool expect_ulpfec,
|
||||
const std::string& codec,
|
||||
VideoEncoder* encoder)
|
||||
: EndToEndTest(VideoSendStreamTest::kDefaultTimeoutMs),
|
||||
: EndToEndTest(kTimeoutMs),
|
||||
encoder_(encoder),
|
||||
payload_name_(codec),
|
||||
use_nack_(use_nack),
|
||||
@ -368,6 +368,10 @@ class UlpfecObserver : public test::EndToEndTest {
|
||||
sent_ulpfec_(false),
|
||||
header_extensions_enabled_(header_extensions_enabled) {}
|
||||
|
||||
// Some of the test cases are expected to time out and thus we are using
|
||||
// a shorter timeout window than the default here.
|
||||
static constexpr size_t kTimeoutMs = 10000;
|
||||
|
||||
private:
|
||||
Action OnSendRtp(const uint8_t* packet, size_t length) override {
|
||||
RTPHeader header;
|
||||
@ -421,9 +425,8 @@ class UlpfecObserver : public test::EndToEndTest {
|
||||
}
|
||||
}
|
||||
|
||||
if (sent_media_) {
|
||||
if (sent_ulpfec_ || !expect_ulpfec_)
|
||||
observation_complete_.Set();
|
||||
if (sent_media_ && sent_ulpfec_) {
|
||||
observation_complete_.Set();
|
||||
}
|
||||
|
||||
prev_header_ = header;
|
||||
@ -474,7 +477,8 @@ class UlpfecObserver : public test::EndToEndTest {
|
||||
}
|
||||
|
||||
void PerformTest() override {
|
||||
EXPECT_TRUE(Wait()) << "Timed out waiting for ULPFEC and/or media packets.";
|
||||
EXPECT_EQ(expect_ulpfec_, Wait())
|
||||
<< "Timed out waiting for ULPFEC and/or media packets.";
|
||||
}
|
||||
|
||||
std::unique_ptr<internal::TransportAdapter> transport_adapter_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user