Index: webrtc/pc/mediasession_unittest.cc |
diff --git a/webrtc/pc/mediasession_unittest.cc b/webrtc/pc/mediasession_unittest.cc |
index 6676240b0c4e8b258e5098b1e996d4b5a1559ac9..2665e582c6b2147f9e5ba4056b6e0c101c35d21d 100644 |
--- a/webrtc/pc/mediasession_unittest.cc |
+++ b/webrtc/pc/mediasession_unittest.cc |
@@ -969,6 +969,46 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateDataAnswerGcm) { |
EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), vcd->protocol()); |
} |
+TEST_F(MediaSessionDescriptionFactoryTest, TestCreateDataAnswerUsesSctpmap) { |
Taylor Brandstetter
2017/02/17 22:15:35
Could you leave a comment above these two tests de
Zach Stein
2017/02/17 22:55:28
Done.
|
+ MediaSessionOptions opts; |
+ opts.data_channel_type = cricket::DCT_SCTP; |
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL)); |
Taylor Brandstetter
2017/02/17 22:15:35
We use C++11 "nullptr" instead of "NULL". Though d
Zach Stein
2017/02/17 22:55:28
I'll match the rest of the file for now.
|
+ ASSERT_TRUE(offer.get() != NULL); |
+ ContentInfo* offer_dv = offer->GetContentByName("data"); |
Taylor Brandstetter
2017/02/17 22:15:35
What does "dv" stand for?
I'd suggest more descri
Zach Stein
2017/02/17 22:55:28
I meant for this to be dc for data content - I'll
|
+ ASSERT_TRUE(offer_dv != NULL); |
+ DataContentDescription* offer_dvd = |
+ static_cast<DataContentDescription*>(offer_dv->description); |
+ EXPECT_TRUE(offer_dvd->use_sctpmap()); |
+ |
+ std::unique_ptr<SessionDescription> answer( |
+ f2_.CreateAnswer(offer.get(), opts, NULL)); |
+ const ContentInfo* answer_dv = answer->GetContentByName("data"); |
+ ASSERT_TRUE(answer_dv != NULL); |
+ const DataContentDescription* answer_dvd = |
+ static_cast<const DataContentDescription*>(answer_dv->description); |
+ EXPECT_TRUE(answer_dvd->use_sctpmap()); |
+} |
+ |
+TEST_F(MediaSessionDescriptionFactoryTest, TestCreateDataAnswerWithoutSctpmap) { |
+ MediaSessionOptions opts; |
+ opts.data_channel_type = cricket::DCT_SCTP; |
+ std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL)); |
+ ASSERT_TRUE(offer.get() != NULL); |
+ ContentInfo* offer_dv = offer->GetContentByName("data"); |
+ ASSERT_TRUE(offer_dv != NULL); |
+ DataContentDescription* offer_dvd = |
+ static_cast<DataContentDescription*>(offer_dv->description); |
+ offer_dvd->set_use_sctpmap(false); |
+ |
+ std::unique_ptr<SessionDescription> answer( |
+ f2_.CreateAnswer(offer.get(), opts, NULL)); |
+ const ContentInfo* answer_dv = answer->GetContentByName("data"); |
+ ASSERT_TRUE(answer_dv != NULL); |
+ const DataContentDescription* answer_dvd = |
+ static_cast<const DataContentDescription*>(answer_dv->description); |
+ EXPECT_FALSE(answer_dvd->use_sctpmap()); |
+} |
+ |
// Verifies that the order of the media contents in the offer is preserved in |
// the answer. |
TEST_F(MediaSessionDescriptionFactoryTest, TestCreateAnswerContentOrder) { |