Chromium Code Reviews| Index: webrtc/api/webrtcsession_unittest.cc |
| diff --git a/webrtc/api/webrtcsession_unittest.cc b/webrtc/api/webrtcsession_unittest.cc |
| index b90daee5107c3e34519119943a816b225b300e4c..8a7b1619517046a741fe5e38a6235c25ca06bae6 100644 |
| --- a/webrtc/api/webrtcsession_unittest.cc |
| +++ b/webrtc/api/webrtcsession_unittest.cc |
| @@ -543,6 +543,8 @@ class WebRtcSessionTest |
| if (session_->data_channel_type() == cricket::DCT_SCTP && data_channel_) { |
| session_options->data_channel_type = cricket::DCT_SCTP; |
| + } else if (session_->data_channel_type() == cricket::DCT_QUIC) { |
| + session_options->data_channel_type = cricket::DCT_QUIC; |
| } |
| } |
| @@ -558,6 +560,8 @@ class WebRtcSessionTest |
| if (session_->data_channel_type() == cricket::DCT_SCTP) { |
| session_options->data_channel_type = cricket::DCT_SCTP; |
| + } else if (session_->data_channel_type() == cricket::DCT_QUIC) { |
| + session_options->data_channel_type = cricket::DCT_QUIC; |
|
pthatcher1
2016/07/22 17:57:57
Why not just do
session_options->data_channel_ty
Zhi Huang
2016/07/25 23:40:36
Oh, I should have noticed this.
|
| } |
| } |
| @@ -4147,6 +4151,41 @@ TEST_P(WebRtcSessionTest, TestRenegotiateNewMediaWithCandidatesSeparated) { |
| SetLocalDescriptionWithoutError(answer); |
| } |
| +#ifdef HAVE_QUIC |
| +TEST_P(WebRtcSessionTest, TestNegotiateQuic) { |
| + configuration_.enable_quic = true; |
| + InitWithDtls(GetParam()); |
| + EXPECT_TRUE(session_->data_channel_type() == cricket::DCT_QUIC); |
| + SessionDescriptionInterface* offer = CreateOffer(); |
| + ASSERT_TRUE(offer); |
| + ASSERT_TRUE(offer->description()); |
| + SetLocalDescriptionWithoutError(offer); |
| + cricket::MediaSessionOptions options; |
| + options.recv_audio = true; |
| + options.recv_video = true; |
| + SessionDescriptionInterface* answer = |
| + CreateRemoteAnswer(offer, options, cricket::SEC_DISABLED); |
| + ASSERT_TRUE(answer); |
| + ASSERT_TRUE(answer->description()); |
| + SetRemoteDescriptionWithoutError(answer); |
| +} |
| + |
| +// Verify the QuicDataTransport can set new transports. |
| +TEST_P(WebRtcSessionTest, TestQuicSetTransport) { |
| + configuration_.enable_quic = true; |
| + InitWithDtls(GetParam()); |
| + EXPECT_TRUE(session_->data_channel_type() == cricket::DCT_QUIC); |
| + SessionDescriptionInterface* offer = CreateOffer(); |
| + ASSERT_TRUE(offer); |
| + ASSERT_TRUE(offer->description()); |
| + SetLocalDescriptionWithoutError(offer); |
| + std::string transport_name = "new data channel"; |
| + EXPECT_NE(transport_name, session_->quic_data_transport()->transport_name()); |
| + session_->quic_data_transport()->SetTransport(transport_name); |
|
Taylor Brandstetter
2016/07/21 23:39:57
Again, is this something we can really support?
|
| + EXPECT_EQ(transport_name, session_->quic_data_transport()->transport_name()); |
| +} |
| +#endif // HAVE_QUIC |
| + |
| // Tests that RTX codec is removed from the answer when it isn't supported |
| // by local side. |
| TEST_F(WebRtcSessionTest, TestRtxRemovedByCreateAnswer) { |