From ca6481d37f83fcce9a4f8f681f6a4e9aae76c6d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Bostr=C3=B6m?= Date: Fri, 3 Mar 2023 11:28:57 +0100 Subject: [PATCH] Make scalability mode expectations more explicit in tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to recent confusion about when to use L1T1, L1T2 or L1T3 and different paths triggering different configurations for these, let's make the simulcast tests more explicit about which scalability mode we are getting for each setup. Bug: webrtc:14884 Change-Id: I6ac20768a1fa9db08fdef032d07b4794a3e66d81 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295873 Commit-Queue: Henrik Boström Reviewed-by: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/main@{#39465} --- pc/peer_connection_simulcast_unittest.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pc/peer_connection_simulcast_unittest.cc b/pc/peer_connection_simulcast_unittest.cc index c1ac00a5a9..ad90171105 100644 --- a/pc/peer_connection_simulcast_unittest.cc +++ b/pc/peer_connection_simulcast_unittest.cc @@ -78,6 +78,7 @@ using ::testing::Property; using ::testing::SizeIs; using ::testing::StartsWith; using ::testing::StrCaseEq; +using ::testing::StrEq; using cricket::MediaContentDescription; using cricket::RidDescription; @@ -1107,9 +1108,9 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, StrCaseEq("video/VP8")); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[2]), StrCaseEq("video/VP8")); - EXPECT_THAT(*outbound_rtps[0]->scalability_mode, StartsWith("L1T")); - EXPECT_THAT(*outbound_rtps[1]->scalability_mode, StartsWith("L1T")); - EXPECT_THAT(*outbound_rtps[2]->scalability_mode, StartsWith("L1T")); + EXPECT_THAT(*outbound_rtps[0]->scalability_mode, StrEq("L1T3")); + EXPECT_THAT(*outbound_rtps[1]->scalability_mode, StrEq("L1T3")); + EXPECT_THAT(*outbound_rtps[2]->scalability_mode, StrEq("L1T3")); } #if defined(WEBRTC_USE_H264) @@ -1155,9 +1156,9 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, StrCaseEq("video/H264")); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[2]), StrCaseEq("video/H264")); - EXPECT_THAT(*outbound_rtps[0]->scalability_mode, StartsWith("L1T")); - EXPECT_THAT(*outbound_rtps[1]->scalability_mode, StartsWith("L1T")); - EXPECT_THAT(*outbound_rtps[2]->scalability_mode, StartsWith("L1T")); + EXPECT_THAT(*outbound_rtps[0]->scalability_mode, StrEq("L1T3")); + EXPECT_THAT(*outbound_rtps[1]->scalability_mode, StrEq("L1T3")); + EXPECT_THAT(*outbound_rtps[2]->scalability_mode, StrEq("L1T3")); } #endif // defined(WEBRTC_USE_H264) @@ -1203,7 +1204,7 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, ASSERT_THAT(outbound_rtps, SizeIs(1u)); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[0]), StrCaseEq("video/VP9")); - EXPECT_THAT(*outbound_rtps[0]->scalability_mode, StartsWith("L3T3_KEY")); + EXPECT_THAT(*outbound_rtps[0]->scalability_mode, StrEq("L3T3_KEY")); // Despite SVC being used on a single RTP stream, GetParameters() returns the // three encodings that we configured earlier (this is not spec-compliant but