Index: webrtc/api/peerconnection_unittest.cc |
diff --git a/webrtc/api/peerconnection_unittest.cc b/webrtc/api/peerconnection_unittest.cc |
index 4f34cfa83e9fe95bd305dcd8beacbeb1c38d6a16..79e955195536880051b087e98156bf3bc9d0578f 100644 |
--- a/webrtc/api/peerconnection_unittest.cc |
+++ b/webrtc/api/peerconnection_unittest.cc |
@@ -717,9 +717,10 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver, |
dtmf_sender->UnregisterObserver(); |
} |
- // Verifies that the SessionDescription have rejected the appropriate media |
- // content. |
- void VerifyRejectedMediaInSessionDescription() { |
+ // Verifies that the direction attribute is set correctly in the local |
+ // description |
+ // according to the options set. |
+ void VerifyRecvDirectionInSessionDescription() { |
ASSERT_TRUE(peer_connection_->remote_description() != nullptr); |
ASSERT_TRUE(peer_connection_->local_description() != nullptr); |
const cricket::SessionDescription* remote_desc = |
@@ -731,14 +732,24 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver, |
if (remote_audio_content) { |
const ContentInfo* audio_content = |
GetFirstAudioContent(local_desc); |
- EXPECT_EQ(can_receive_audio(), !audio_content->rejected); |
+ EXPECT_EQ(can_receive_audio(), |
+ cricket::RtpTransceiverDirection::FromMediaContentDirection( |
+ static_cast<const MediaContentDescription*>( |
+ audio_content->description) |
+ ->direction()) |
+ .recv); |
} |
const ContentInfo* remote_video_content = GetFirstVideoContent(remote_desc); |
if (remote_video_content) { |
const ContentInfo* video_content = |
GetFirstVideoContent(local_desc); |
- EXPECT_EQ(can_receive_video(), !video_content->rejected); |
+ EXPECT_EQ(can_receive_video(), |
+ cricket::RtpTransceiverDirection::FromMediaContentDirection( |
+ static_cast<const MediaContentDescription*>( |
+ video_content->description) |
+ ->direction()) |
+ .recv); |
} |
} |
@@ -1324,8 +1335,8 @@ class P2PTestConductor : public testing::Test { |
} |
void VerifySessionDescriptions() { |
- initiating_client_->VerifyRejectedMediaInSessionDescription(); |
- receiving_client_->VerifyRejectedMediaInSessionDescription(); |
+ initiating_client_->VerifyRecvDirectionInSessionDescription(); |
+ receiving_client_->VerifyRecvDirectionInSessionDescription(); |
initiating_client_->VerifyLocalIceUfragAndPassword(); |
receiving_client_->VerifyLocalIceUfragAndPassword(); |
} |