Index: webrtc/api/webrtcsession_unittest.cc |
diff --git a/webrtc/api/webrtcsession_unittest.cc b/webrtc/api/webrtcsession_unittest.cc |
index feb1518db0114b6591ec483b5ffecb152dba9b7d..45c7424410b4270fdbff26b7ab3532ea9d748af3 100644 |
--- a/webrtc/api/webrtcsession_unittest.cc |
+++ b/webrtc/api/webrtcsession_unittest.cc |
@@ -4284,15 +4284,9 @@ TEST_P(WebRtcSessionTest, TestRenegotiateNewMediaWithCandidatesSeparated) { |
SetLocalDescriptionWithoutError(answer); |
} |
-// Flaky on Win and Mac only. See webrtc:4943 |
-#if defined(WEBRTC_WIN) || defined(WEBRTC_MAC) |
-#define MAYBE_TestRtxRemovedByCreateAnswer DISABLED_TestRtxRemovedByCreateAnswer |
-#else |
-#define MAYBE_TestRtxRemovedByCreateAnswer TestRtxRemovedByCreateAnswer |
-#endif |
// Tests that RTX codec is removed from the answer when it isn't supported |
// by local side. |
-TEST_F(WebRtcSessionTest, MAYBE_TestRtxRemovedByCreateAnswer) { |
+TEST_F(WebRtcSessionTest, TestRtxRemovedByCreateAnswer) { |
Init(); |
SendAudioVideoStream1(); |
std::string offer_sdp(kSdpWithRtx); |
@@ -4306,11 +4300,19 @@ TEST_F(WebRtcSessionTest, MAYBE_TestRtxRemovedByCreateAnswer) { |
SetRemoteDescriptionWithoutError(offer); |
SessionDescriptionInterface* answer = CreateAnswer(); |
- std::string answer_sdp; |
- answer->ToString(&answer_sdp); |
- // Answer SDP removes the unsupported RTX codec. |
- EXPECT_TRUE(answer_sdp.find("rtx") == std::string::npos); |
SetLocalDescriptionWithoutError(answer); |
+ |
+ for (const auto& content : answer->description()->contents()) { |
+ if (static_cast<cricket::MediaContentDescription*>(content.description) |
+ ->type() == cricket::MEDIA_TYPE_VIDEO) { |
+ const auto* mdesc = |
+ static_cast<cricket::VideoContentDescription*>(content.description); |
+ for (auto iter = mdesc->codecs().begin(); iter != mdesc->codecs().end(); |
Taylor Brandstetter
2016/04/23 00:05:14
nit: We can use C++11 range-based for loops in new
Zhi Huang
2016/04/23 00:51:57
Done.
|
+ iter++) { |
+ EXPECT_TRUE(iter->ToString().find("rtx") == std::string::npos); |
Taylor Brandstetter
2016/04/23 00:05:14
I think you can just check that the codec's name i
Zhi Huang
2016/04/23 00:51:57
Acknowledged.
|
+ } |
+ } |
+ } |
} |
// This verifies that the voice channel after bundle has both options from video |