Fix and disable test for corruption header negotiation in integrationtest.
The test currently fails and therefore is disabled. But the logic in
test is updated such that it should pass when the bug in webrtc:383078466 has been fixed.
Bug: webrtc:425336456
Change-Id: Ie213bb4cd6e4991491a14f0ede5c7afa859fbe4d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/399200
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45129}
diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc
index 5ffed1f..bd3a473 100644
--- a/pc/peer_connection_integrationtest.cc
+++ b/pc/peer_connection_integrationtest.cc
@@ -4623,8 +4623,10 @@
PeerConnectionInterface::kStable);
}
+// TODO: issues.webrtc.org/425336456 - figure out correct behavior and reenable.
+// TODO: issues.webrtc.org/383078466 - should pass when this bug is fixed.
TEST_F(PeerConnectionIntegrationTestUnifiedPlan,
- OnlyOnePairWantsCorruptionScorePlumbing) {
+ DISABLED_OnlyOnePairWantsCorruptionScorePlumbingShouldFailToGetIt) {
// In order for corruption score to be logged, encryption of RTP header
// extensions must be allowed.
CryptoOptions crypto_options;
@@ -4636,23 +4638,23 @@
ConnectFakeSignaling();
// Do normal offer/answer and wait for some frames to be received in each
- // direction, and `corruption_score` to be aggregated.
+ // direction.
caller()->AddAudioVideoTracks();
callee()->AddAudioVideoTracks();
- // Negotiate the corruption detection header extension in SDP.
- // If caller adds corruption detection header extension to its SDP offer, it
- // will receive it from the callee.
+
+ // Negotiate the corruption detection header extension in SDP only in one
+ // direction.
caller()->NegotiateCorruptionDetectionHeader();
caller()->CreateAndSetAndSignalOffer();
ASSERT_THAT(
WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()),
IsRtcOk());
- ASSERT_THAT(WaitUntil([&] { return caller()->GetCorruptionScoreCount(); },
- ::testing::Gt(0), {.timeout = kMaxWaitForStats}),
+ ASSERT_THAT(WaitUntil([&] { return caller()->GetReceivedFrameCount(); },
+ ::testing::Eq(3), {.timeout = kMaxWaitForStats}),
IsRtcOk());
- ASSERT_THAT(WaitUntil([&] { return callee()->GetCorruptionScoreCount(); },
- ::testing::Eq(0), {.timeout = kMaxWaitForStats}),
+ ASSERT_THAT(WaitUntil([&] { return callee()->GetReceivedFrameCount(); },
+ ::testing::Eq(3), {.timeout = kMaxWaitForStats}),
IsRtcOk());
for (const auto& pair : {caller(), callee()}) {
@@ -4662,22 +4664,8 @@
report->GetStatsOfType<RTCInboundRtpStreamStats>();
for (const auto& stat : inbound_stream_stats) {
if (*stat->kind == "video") {
- if (pair == caller()) {
- EXPECT_TRUE(stat->total_corruption_probability.has_value());
- EXPECT_TRUE(stat->total_squared_corruption_probability.has_value());
-
- double average_corruption_score =
- (*stat->total_corruption_probability) /
- static_cast<int32_t>(*stat->corruption_measurements);
- EXPECT_GE(average_corruption_score, 0.0);
- EXPECT_LE(average_corruption_score, 1.0);
- }
- if (pair == callee()) {
- // Since only `caller` requests corruption score calculation the
- // callee should not aggregate it.
EXPECT_FALSE(stat->total_corruption_probability.has_value());
EXPECT_FALSE(stat->total_squared_corruption_probability.has_value());
- }
}
}
}
diff --git a/pc/test/integration_test_helpers.h b/pc/test/integration_test_helpers.h
index 73f2304..15831a7 100644
--- a/pc/test/integration_test_helpers.h
+++ b/pc/test/integration_test_helpers.h
@@ -734,6 +734,18 @@
return 0;
}
+ uint32_t GetReceivedFrameCount() {
+ scoped_refptr<const RTCStatsReport> report = NewGetStats();
+ auto inbound_stream_stats =
+ report->GetStatsOfType<RTCInboundRtpStreamStats>();
+ for (const auto& stat : inbound_stream_stats) {
+ if (*stat->kind == "video") {
+ return stat->frames_received.value_or(0);
+ }
+ }
+ return 0;
+ }
+
void set_connection_change_callback(
std::function<void(PeerConnectionInterface::PeerConnectionState)> func) {
connection_change_callback_ = std::move(func);