| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 // the answer as a local description. | 1094 // the answer as a local description. |
| 1095 TEST_F(PeerConnectionInterfaceTest, ReceiveFireFoxOffer) { | 1095 TEST_F(PeerConnectionInterfaceTest, ReceiveFireFoxOffer) { |
| 1096 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 1096 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
| 1097 FakeConstraints constraints; | 1097 FakeConstraints constraints; |
| 1098 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 1098 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
| 1099 true); | 1099 true); |
| 1100 CreatePeerConnection(&constraints); | 1100 CreatePeerConnection(&constraints); |
| 1101 AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label"); | 1101 AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label"); |
| 1102 SessionDescriptionInterface* desc = | 1102 SessionDescriptionInterface* desc = |
| 1103 webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, | 1103 webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, |
| 1104 webrtc::kFireFoxSdpOffer); | 1104 webrtc::kFireFoxSdpOffer, nullptr); |
| 1105 EXPECT_TRUE(DoSetSessionDescription(desc, false)); | 1105 EXPECT_TRUE(DoSetSessionDescription(desc, false)); |
| 1106 CreateAnswerAsLocalDescription(); | 1106 CreateAnswerAsLocalDescription(); |
| 1107 ASSERT_TRUE(pc_->local_description() != NULL); | 1107 ASSERT_TRUE(pc_->local_description() != NULL); |
| 1108 ASSERT_TRUE(pc_->remote_description() != NULL); | 1108 ASSERT_TRUE(pc_->remote_description() != NULL); |
| 1109 | 1109 |
| 1110 const cricket::ContentInfo* content = | 1110 const cricket::ContentInfo* content = |
| 1111 cricket::GetFirstAudioContent(pc_->local_description()->description()); | 1111 cricket::GetFirstAudioContent(pc_->local_description()->description()); |
| 1112 ASSERT_TRUE(content != NULL); | 1112 ASSERT_TRUE(content != NULL); |
| 1113 EXPECT_FALSE(content->rejected); | 1113 EXPECT_FALSE(content->rejected); |
| 1114 | 1114 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1127 // Test that we can create an audio only offer and receive an answer with a | 1127 // Test that we can create an audio only offer and receive an answer with a |
| 1128 // limited set of audio codecs and receive an updated offer with more audio | 1128 // limited set of audio codecs and receive an updated offer with more audio |
| 1129 // codecs, where the added codecs are not supported. | 1129 // codecs, where the added codecs are not supported. |
| 1130 TEST_F(PeerConnectionInterfaceTest, ReceiveUpdatedAudioOfferWithBadCodecs) { | 1130 TEST_F(PeerConnectionInterfaceTest, ReceiveUpdatedAudioOfferWithBadCodecs) { |
| 1131 CreatePeerConnection(); | 1131 CreatePeerConnection(); |
| 1132 AddVoiceStream("audio_label"); | 1132 AddVoiceStream("audio_label"); |
| 1133 CreateOfferAsLocalDescription(); | 1133 CreateOfferAsLocalDescription(); |
| 1134 | 1134 |
| 1135 SessionDescriptionInterface* answer = | 1135 SessionDescriptionInterface* answer = |
| 1136 webrtc::CreateSessionDescription(SessionDescriptionInterface::kAnswer, | 1136 webrtc::CreateSessionDescription(SessionDescriptionInterface::kAnswer, |
| 1137 webrtc::kAudioSdp); | 1137 webrtc::kAudioSdp, nullptr); |
| 1138 EXPECT_TRUE(DoSetSessionDescription(answer, false)); | 1138 EXPECT_TRUE(DoSetSessionDescription(answer, false)); |
| 1139 | 1139 |
| 1140 SessionDescriptionInterface* updated_offer = | 1140 SessionDescriptionInterface* updated_offer = |
| 1141 webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, | 1141 webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, |
| 1142 webrtc::kAudioSdpWithUnsupportedCodecs); | 1142 webrtc::kAudioSdpWithUnsupportedCodecs, |
| 1143 nullptr); |
| 1143 EXPECT_TRUE(DoSetSessionDescription(updated_offer, false)); | 1144 EXPECT_TRUE(DoSetSessionDescription(updated_offer, false)); |
| 1144 CreateAnswerAsLocalDescription(); | 1145 CreateAnswerAsLocalDescription(); |
| 1145 } | 1146 } |
| 1146 | 1147 |
| 1147 // Test that PeerConnection::Close changes the states to closed and all remote | 1148 // Test that PeerConnection::Close changes the states to closed and all remote |
| 1148 // tracks change state to ended. | 1149 // tracks change state to ended. |
| 1149 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { | 1150 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { |
| 1150 // Initialize a PeerConnection and negotiate local and remote session | 1151 // Initialize a PeerConnection and negotiate local and remote session |
| 1151 // description. | 1152 // description. |
| 1152 InitiateCall(); | 1153 InitiateCall(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 sdp, NULL); | 1218 sdp, NULL); |
| 1218 EXPECT_FALSE(DoSetLocalDescription(local_offer)); | 1219 EXPECT_FALSE(DoSetLocalDescription(local_offer)); |
| 1219 } | 1220 } |
| 1220 | 1221 |
| 1221 // Test that GetStats can still be called after PeerConnection::Close. | 1222 // Test that GetStats can still be called after PeerConnection::Close. |
| 1222 TEST_F(PeerConnectionInterfaceTest, CloseAndGetStats) { | 1223 TEST_F(PeerConnectionInterfaceTest, CloseAndGetStats) { |
| 1223 InitiateCall(); | 1224 InitiateCall(); |
| 1224 pc_->Close(); | 1225 pc_->Close(); |
| 1225 DoGetStats(NULL); | 1226 DoGetStats(NULL); |
| 1226 } | 1227 } |
| OLD | NEW |