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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
885 bool remove_msid_ = false; // True if MSID should be removed in received SDP. | 885 bool remove_msid_ = false; // True if MSID should be removed in received SDP. |
886 bool remove_bundle_ = | 886 bool remove_bundle_ = |
887 false; // True if bundle should be removed in received SDP. | 887 false; // True if bundle should be removed in received SDP. |
888 bool remove_sdes_ = | 888 bool remove_sdes_ = |
889 false; // True if a=crypto should be removed in received SDP. | 889 false; // True if a=crypto should be removed in received SDP. |
890 | 890 |
891 rtc::scoped_refptr<DataChannelInterface> data_channel_; | 891 rtc::scoped_refptr<DataChannelInterface> data_channel_; |
892 rtc::scoped_ptr<MockDataChannelObserver> data_observer_; | 892 rtc::scoped_ptr<MockDataChannelObserver> data_observer_; |
893 }; | 893 }; |
894 | 894 |
895 // Flaky on Mac Debug bots. See webrtc:5231 | |
896 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | |
897 #define MAYBE_JsepPeerConnectionP2PTestClient \ | |
898 DISABLED_JsepPeerConnectionP2PTestClient | |
899 #else | |
900 #define MAYBE_JsepPeerConnectionP2PTestClient JsepPeerConnectionP2PTestClient | |
901 #endif | |
902 | |
895 // TODO(deadbeef): Rename this to P2PTestConductor once the Linux memcheck and | 903 // TODO(deadbeef): Rename this to P2PTestConductor once the Linux memcheck and |
896 // Windows DrMemory Full bots' blacklists are updated. | 904 // Windows DrMemory Full bots' blacklists are updated. |
897 class JsepPeerConnectionP2PTestClient : public testing::Test { | 905 class MAYBE_JsepPeerConnectionP2PTestClient : public testing::Test { |
898 public: | 906 public: |
899 JsepPeerConnectionP2PTestClient() | 907 MAYBE_JsepPeerConnectionP2PTestClient() |
900 : pss_(new rtc::PhysicalSocketServer), | 908 : pss_(new rtc::PhysicalSocketServer), |
901 ss_(new rtc::VirtualSocketServer(pss_.get())), | 909 ss_(new rtc::VirtualSocketServer(pss_.get())), |
902 ss_scope_(ss_.get()) {} | 910 ss_scope_(ss_.get()) {} |
903 | 911 |
904 bool SessionActive() { | 912 bool SessionActive() { |
905 return initiating_client_->SessionActive() && | 913 return initiating_client_->SessionActive() && |
906 receiving_client_->SessionActive(); | 914 receiving_client_->SessionActive(); |
907 } | 915 } |
908 | 916 |
909 // Return true if the number of frames provided have been received or it is | 917 // Return true if the number of frames provided have been received or it is |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
944 EXPECT_EQ(height, initializing_client()->rendered_height()); | 952 EXPECT_EQ(height, initializing_client()->rendered_height()); |
945 } | 953 } |
946 | 954 |
947 void VerifySessionDescriptions() { | 955 void VerifySessionDescriptions() { |
948 initiating_client_->VerifyRejectedMediaInSessionDescription(); | 956 initiating_client_->VerifyRejectedMediaInSessionDescription(); |
949 receiving_client_->VerifyRejectedMediaInSessionDescription(); | 957 receiving_client_->VerifyRejectedMediaInSessionDescription(); |
950 initiating_client_->VerifyLocalIceUfragAndPassword(); | 958 initiating_client_->VerifyLocalIceUfragAndPassword(); |
951 receiving_client_->VerifyLocalIceUfragAndPassword(); | 959 receiving_client_->VerifyLocalIceUfragAndPassword(); |
952 } | 960 } |
953 | 961 |
954 ~JsepPeerConnectionP2PTestClient() { | 962 ~MAYBE_JsepPeerConnectionP2PTestClient() { |
955 if (initiating_client_) { | 963 if (initiating_client_) { |
956 initiating_client_->set_signaling_message_receiver(nullptr); | 964 initiating_client_->set_signaling_message_receiver(nullptr); |
957 } | 965 } |
958 if (receiving_client_) { | 966 if (receiving_client_) { |
959 receiving_client_->set_signaling_message_receiver(nullptr); | 967 receiving_client_->set_signaling_message_receiver(nullptr); |
960 } | 968 } |
961 } | 969 } |
962 | 970 |
963 bool CreateTestClients() { return CreateTestClients(nullptr, nullptr); } | 971 bool CreateTestClients() { return CreateTestClients(nullptr, nullptr); } |
964 | 972 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1083 rtc::scoped_ptr<PeerConnectionTestClient> receiving_client_; | 1091 rtc::scoped_ptr<PeerConnectionTestClient> receiving_client_; |
1084 }; | 1092 }; |
1085 | 1093 |
1086 // Disable for TSan v2, see | 1094 // Disable for TSan v2, see |
1087 // https://code.google.com/p/webrtc/issues/detail?id=1205 for details. | 1095 // https://code.google.com/p/webrtc/issues/detail?id=1205 for details. |
1088 #if !defined(THREAD_SANITIZER) | 1096 #if !defined(THREAD_SANITIZER) |
1089 | 1097 |
1090 // This test sets up a Jsep call between two parties and test Dtmf. | 1098 // This test sets up a Jsep call between two parties and test Dtmf. |
1091 // TODO(holmer): Disabled due to sometimes crashing on buildbots. | 1099 // TODO(holmer): Disabled due to sometimes crashing on buildbots. |
1092 // See issue webrtc/2378. | 1100 // See issue webrtc/2378. |
1093 TEST_F(JsepPeerConnectionP2PTestClient, DISABLED_LocalP2PTestDtmf) { | 1101 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, DISABLED_LocalP2PTestDtmf) { |
1094 ASSERT_TRUE(CreateTestClients()); | 1102 ASSERT_TRUE(CreateTestClients()); |
1095 LocalP2PTest(); | 1103 LocalP2PTest(); |
1096 VerifyDtmf(); | 1104 VerifyDtmf(); |
1097 } | 1105 } |
1098 | 1106 |
1099 // This test sets up a Jsep call between two parties and test that we can get a | 1107 // This test sets up a Jsep call between two parties and test that we can get a |
1100 // video aspect ratio of 16:9. | 1108 // video aspect ratio of 16:9. |
1101 TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTest16To9) { | 1109 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTest16To9) { |
1102 ASSERT_TRUE(CreateTestClients()); | 1110 ASSERT_TRUE(CreateTestClients()); |
1103 FakeConstraints constraint; | 1111 FakeConstraints constraint; |
1104 double requested_ratio = 640.0/360; | 1112 double requested_ratio = 640.0/360; |
1105 constraint.SetMandatoryMinAspectRatio(requested_ratio); | 1113 constraint.SetMandatoryMinAspectRatio(requested_ratio); |
1106 SetVideoConstraints(constraint, constraint); | 1114 SetVideoConstraints(constraint, constraint); |
1107 LocalP2PTest(); | 1115 LocalP2PTest(); |
1108 | 1116 |
1109 ASSERT_LE(0, initializing_client()->rendered_height()); | 1117 ASSERT_LE(0, initializing_client()->rendered_height()); |
1110 double initiating_video_ratio = | 1118 double initiating_video_ratio = |
1111 static_cast<double>(initializing_client()->rendered_width()) / | 1119 static_cast<double>(initializing_client()->rendered_width()) / |
1112 initializing_client()->rendered_height(); | 1120 initializing_client()->rendered_height(); |
1113 EXPECT_LE(requested_ratio, initiating_video_ratio); | 1121 EXPECT_LE(requested_ratio, initiating_video_ratio); |
1114 | 1122 |
1115 ASSERT_LE(0, receiving_client()->rendered_height()); | 1123 ASSERT_LE(0, receiving_client()->rendered_height()); |
1116 double receiving_video_ratio = | 1124 double receiving_video_ratio = |
1117 static_cast<double>(receiving_client()->rendered_width()) / | 1125 static_cast<double>(receiving_client()->rendered_width()) / |
1118 receiving_client()->rendered_height(); | 1126 receiving_client()->rendered_height(); |
1119 EXPECT_LE(requested_ratio, receiving_video_ratio); | 1127 EXPECT_LE(requested_ratio, receiving_video_ratio); |
1120 } | 1128 } |
1121 | 1129 |
1122 // This test sets up a Jsep call between two parties and test that the | 1130 // This test sets up a Jsep call between two parties and test that the |
1123 // received video has a resolution of 1280*720. | 1131 // received video has a resolution of 1280*720. |
1124 // TODO(mallinath): Enable when | 1132 // TODO(mallinath): Enable when |
1125 // http://code.google.com/p/webrtc/issues/detail?id=981 is fixed. | 1133 // http://code.google.com/p/webrtc/issues/detail?id=981 is fixed. |
1126 TEST_F(JsepPeerConnectionP2PTestClient, DISABLED_LocalP2PTest1280By720) { | 1134 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, DISABLED_LocalP2PTest1280By720) { |
1127 ASSERT_TRUE(CreateTestClients()); | 1135 ASSERT_TRUE(CreateTestClients()); |
1128 FakeConstraints constraint; | 1136 FakeConstraints constraint; |
1129 constraint.SetMandatoryMinWidth(1280); | 1137 constraint.SetMandatoryMinWidth(1280); |
1130 constraint.SetMandatoryMinHeight(720); | 1138 constraint.SetMandatoryMinHeight(720); |
1131 SetVideoConstraints(constraint, constraint); | 1139 SetVideoConstraints(constraint, constraint); |
1132 LocalP2PTest(); | 1140 LocalP2PTest(); |
1133 VerifyRenderedSize(1280, 720); | 1141 VerifyRenderedSize(1280, 720); |
1134 } | 1142 } |
1135 | 1143 |
1136 // This test sets up a call between two endpoints that are configured to use | 1144 // This test sets up a call between two endpoints that are configured to use |
1137 // DTLS key agreement. As a result, DTLS is negotiated and used for transport. | 1145 // DTLS key agreement. As a result, DTLS is negotiated and used for transport. |
1138 TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestDtls) { | 1146 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestDtls) { |
1139 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 1147 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
1140 FakeConstraints setup_constraints; | 1148 FakeConstraints setup_constraints; |
1141 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, | 1149 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, |
1142 true); | 1150 true); |
1143 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); | 1151 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); |
1144 LocalP2PTest(); | 1152 LocalP2PTest(); |
1145 VerifyRenderedSize(640, 480); | 1153 VerifyRenderedSize(640, 480); |
1146 } | 1154 } |
1147 | 1155 |
1148 // This test sets up a audio call initially and then upgrades to audio/video, | 1156 // This test sets up a audio call initially and then upgrades to audio/video, |
1149 // using DTLS. | 1157 // using DTLS. |
1150 TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestDtlsRenegotiate) { | 1158 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestDtlsRenegotiate) { |
1151 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 1159 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
1152 FakeConstraints setup_constraints; | 1160 FakeConstraints setup_constraints; |
1153 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, | 1161 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, |
1154 true); | 1162 true); |
1155 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); | 1163 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); |
1156 receiving_client()->SetReceiveAudioVideo(true, false); | 1164 receiving_client()->SetReceiveAudioVideo(true, false); |
1157 LocalP2PTest(); | 1165 LocalP2PTest(); |
1158 receiving_client()->SetReceiveAudioVideo(true, true); | 1166 receiving_client()->SetReceiveAudioVideo(true, true); |
1159 receiving_client()->Negotiate(); | 1167 receiving_client()->Negotiate(); |
1160 } | 1168 } |
1161 | 1169 |
1162 // Flaky on Mac Debug bots. See webrtc:5231 | |
1163 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | |
1164 #define MAYBE_LocalP2PTestOfferDtlsButNotSdes \ | |
1165 DISABLED_LocalP2PTestOfferDtlsButNotSdes | |
1166 #else | |
1167 #define MAYBE_LocalP2PTestOfferDtlsButNotSdes LocalP2PTestOfferDtlsButNotSdes | |
1168 #endif | |
1169 | |
1170 // This test sets up a call between two endpoints that are configured to use | 1170 // This test sets up a call between two endpoints that are configured to use |
1171 // DTLS key agreement. The offerer don't support SDES. As a result, DTLS is | 1171 // DTLS key agreement. The offerer don't support SDES. As a result, DTLS is |
1172 // negotiated and used for transport. | 1172 // negotiated and used for transport. |
1173 TEST_F(JsepPeerConnectionP2PTestClient, MAYBE_LocalP2PTestOfferDtlsButNotSdes) { | 1173 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, |
1174 MAYBE_LocalP2PTestOfferDtlsButNotSdes) { | |
kjellander_webrtc
2015/12/02 12:16:38
Please remove MAYBE_ from the test case name in a
| |
1174 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 1175 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
1175 FakeConstraints setup_constraints; | 1176 FakeConstraints setup_constraints; |
1176 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, | 1177 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, |
1177 true); | 1178 true); |
1178 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); | 1179 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); |
1179 receiving_client()->RemoveSdesCryptoFromReceivedSdp(true); | 1180 receiving_client()->RemoveSdesCryptoFromReceivedSdp(true); |
1180 LocalP2PTest(); | 1181 LocalP2PTest(); |
1181 VerifyRenderedSize(640, 480); | 1182 VerifyRenderedSize(640, 480); |
1182 } | 1183 } |
1183 | 1184 |
1184 // This test sets up a Jsep call between two parties, and the callee only | 1185 // This test sets up a Jsep call between two parties, and the callee only |
1185 // accept to receive video. | 1186 // accept to receive video. |
1186 TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestAnswerVideo) { | 1187 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestAnswerVideo) { |
1187 ASSERT_TRUE(CreateTestClients()); | 1188 ASSERT_TRUE(CreateTestClients()); |
1188 receiving_client()->SetReceiveAudioVideo(false, true); | 1189 receiving_client()->SetReceiveAudioVideo(false, true); |
1189 LocalP2PTest(); | 1190 LocalP2PTest(); |
1190 } | 1191 } |
1191 | 1192 |
1192 // This test sets up a Jsep call between two parties, and the callee only | 1193 // This test sets up a Jsep call between two parties, and the callee only |
1193 // accept to receive audio. | 1194 // accept to receive audio. |
1194 TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestAnswerAudio) { | 1195 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestAnswerAudio) { |
1195 ASSERT_TRUE(CreateTestClients()); | 1196 ASSERT_TRUE(CreateTestClients()); |
1196 receiving_client()->SetReceiveAudioVideo(true, false); | 1197 receiving_client()->SetReceiveAudioVideo(true, false); |
1197 LocalP2PTest(); | 1198 LocalP2PTest(); |
1198 } | 1199 } |
1199 | 1200 |
1200 // This test sets up a Jsep call between two parties, and the callee reject both | 1201 // This test sets up a Jsep call between two parties, and the callee reject both |
1201 // audio and video. | 1202 // audio and video. |
1202 TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestAnswerNone) { | 1203 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestAnswerNone) { |
1203 ASSERT_TRUE(CreateTestClients()); | 1204 ASSERT_TRUE(CreateTestClients()); |
1204 receiving_client()->SetReceiveAudioVideo(false, false); | 1205 receiving_client()->SetReceiveAudioVideo(false, false); |
1205 LocalP2PTest(); | 1206 LocalP2PTest(); |
1206 } | 1207 } |
1207 | 1208 |
1208 // This test sets up an audio and video call between two parties. After the call | 1209 // This test sets up an audio and video call between two parties. After the call |
1209 // runs for a while (10 frames), the caller sends an update offer with video | 1210 // runs for a while (10 frames), the caller sends an update offer with video |
1210 // being rejected. Once the re-negotiation is done, the video flow should stop | 1211 // being rejected. Once the re-negotiation is done, the video flow should stop |
1211 // and the audio flow should continue. | 1212 // and the audio flow should continue. |
1212 // Disabled due to b/14955157. | 1213 // Disabled due to b/14955157. |
1213 TEST_F(JsepPeerConnectionP2PTestClient, | 1214 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, |
1214 DISABLED_UpdateOfferWithRejectedContent) { | 1215 DISABLED_UpdateOfferWithRejectedContent) { |
1215 ASSERT_TRUE(CreateTestClients()); | 1216 ASSERT_TRUE(CreateTestClients()); |
1216 LocalP2PTest(); | 1217 LocalP2PTest(); |
1217 TestUpdateOfferWithRejectedContent(); | 1218 TestUpdateOfferWithRejectedContent(); |
1218 } | 1219 } |
1219 | 1220 |
1220 // This test sets up a Jsep call between two parties. The MSID is removed from | 1221 // This test sets up a Jsep call between two parties. The MSID is removed from |
1221 // the SDP strings from the caller. | 1222 // the SDP strings from the caller. |
1222 // Disabled due to b/14955157. | 1223 // Disabled due to b/14955157. |
1223 TEST_F(JsepPeerConnectionP2PTestClient, DISABLED_LocalP2PTestWithoutMsid) { | 1224 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, |
1225 DISABLED_LocalP2PTestWithoutMsid) { | |
1224 ASSERT_TRUE(CreateTestClients()); | 1226 ASSERT_TRUE(CreateTestClients()); |
1225 receiving_client()->RemoveMsidFromReceivedSdp(true); | 1227 receiving_client()->RemoveMsidFromReceivedSdp(true); |
1226 // TODO(perkj): Currently there is a bug that cause audio to stop playing if | 1228 // TODO(perkj): Currently there is a bug that cause audio to stop playing if |
1227 // audio and video is muxed when MSID is disabled. Remove | 1229 // audio and video is muxed when MSID is disabled. Remove |
1228 // SetRemoveBundleFromSdp once | 1230 // SetRemoveBundleFromSdp once |
1229 // https://code.google.com/p/webrtc/issues/detail?id=1193 is fixed. | 1231 // https://code.google.com/p/webrtc/issues/detail?id=1193 is fixed. |
1230 receiving_client()->RemoveBundleFromReceivedSdp(true); | 1232 receiving_client()->RemoveBundleFromReceivedSdp(true); |
1231 LocalP2PTest(); | 1233 LocalP2PTest(); |
1232 } | 1234 } |
1233 | 1235 |
1234 // This test sets up a Jsep call between two parties and the initiating peer | 1236 // This test sets up a Jsep call between two parties and the initiating peer |
1235 // sends two steams. | 1237 // sends two steams. |
1236 // TODO(perkj): Disabled due to | 1238 // TODO(perkj): Disabled due to |
1237 // https://code.google.com/p/webrtc/issues/detail?id=1454 | 1239 // https://code.google.com/p/webrtc/issues/detail?id=1454 |
1238 TEST_F(JsepPeerConnectionP2PTestClient, DISABLED_LocalP2PTestTwoStreams) { | 1240 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, DISABLED_LocalP2PTestTwoStreams) { |
1239 ASSERT_TRUE(CreateTestClients()); | 1241 ASSERT_TRUE(CreateTestClients()); |
1240 // Set optional video constraint to max 320pixels to decrease CPU usage. | 1242 // Set optional video constraint to max 320pixels to decrease CPU usage. |
1241 FakeConstraints constraint; | 1243 FakeConstraints constraint; |
1242 constraint.SetOptionalMaxWidth(320); | 1244 constraint.SetOptionalMaxWidth(320); |
1243 SetVideoConstraints(constraint, constraint); | 1245 SetVideoConstraints(constraint, constraint); |
1244 initializing_client()->AddMediaStream(true, true); | 1246 initializing_client()->AddMediaStream(true, true); |
1245 initializing_client()->AddMediaStream(false, true); | 1247 initializing_client()->AddMediaStream(false, true); |
1246 ASSERT_EQ(2u, initializing_client()->NumberOfLocalMediaStreams()); | 1248 ASSERT_EQ(2u, initializing_client()->NumberOfLocalMediaStreams()); |
1247 LocalP2PTest(); | 1249 LocalP2PTest(); |
1248 EXPECT_EQ(2u, receiving_client()->number_of_remote_streams()); | 1250 EXPECT_EQ(2u, receiving_client()->number_of_remote_streams()); |
1249 } | 1251 } |
1250 | 1252 |
1251 // Flaky on Mac Debug bots. See webrtc:5231 | |
1252 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | |
1253 #define MAYBE_GetAudioOutputLevelStats DISABLED_GetAudioOutputLevelStats | |
1254 #else | |
1255 #define MAYBE_GetAudioOutputLevelStats GetAudioOutputLevelStats | |
1256 #endif | |
1257 | |
1258 // Test that we can receive the audio output level from a remote audio track. | 1253 // Test that we can receive the audio output level from a remote audio track. |
1259 TEST_F(JsepPeerConnectionP2PTestClient, MAYBE_GetAudioOutputLevelStats) { | 1254 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, MAYBE_GetAudioOutputLevelStats) { |
kjellander_webrtc
2015/12/02 12:16:38
Please remove MAYBE_ from the test case name in a
| |
1260 ASSERT_TRUE(CreateTestClients()); | 1255 ASSERT_TRUE(CreateTestClients()); |
1261 LocalP2PTest(); | 1256 LocalP2PTest(); |
1262 | 1257 |
1263 StreamCollectionInterface* remote_streams = | 1258 StreamCollectionInterface* remote_streams = |
1264 initializing_client()->remote_streams(); | 1259 initializing_client()->remote_streams(); |
1265 ASSERT_GT(remote_streams->count(), 0u); | 1260 ASSERT_GT(remote_streams->count(), 0u); |
1266 ASSERT_GT(remote_streams->at(0)->GetAudioTracks().size(), 0u); | 1261 ASSERT_GT(remote_streams->at(0)->GetAudioTracks().size(), 0u); |
1267 MediaStreamTrackInterface* remote_audio_track = | 1262 MediaStreamTrackInterface* remote_audio_track = |
1268 remote_streams->at(0)->GetAudioTracks()[0]; | 1263 remote_streams->at(0)->GetAudioTracks()[0]; |
1269 | 1264 |
1270 // Get the audio output level stats. Note that the level is not available | 1265 // Get the audio output level stats. Note that the level is not available |
1271 // until a RTCP packet has been received. | 1266 // until a RTCP packet has been received. |
1272 EXPECT_TRUE_WAIT( | 1267 EXPECT_TRUE_WAIT( |
1273 initializing_client()->GetAudioOutputLevelStats(remote_audio_track) > 0, | 1268 initializing_client()->GetAudioOutputLevelStats(remote_audio_track) > 0, |
1274 kMaxWaitForStatsMs); | 1269 kMaxWaitForStatsMs); |
1275 } | 1270 } |
1276 | 1271 |
1277 // Flaky on Mac Debug bots. See webrtc:5231 | |
1278 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | |
1279 #define MAYBE_GetAudioInputLevelStats DISABLED_GetAudioInputLevelStats | |
1280 #else | |
1281 #define MAYBE_GetAudioInputLevelStats GetAudioInputLevelStats | |
1282 #endif | |
1283 | |
1284 // Test that an audio input level is reported. | 1272 // Test that an audio input level is reported. |
1285 TEST_F(JsepPeerConnectionP2PTestClient, MAYBE_GetAudioInputLevelStats) { | 1273 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, MAYBE_GetAudioInputLevelStats) { |
kjellander_webrtc
2015/12/02 12:16:38
Please remove MAYBE_ from the test case name in a
| |
1286 ASSERT_TRUE(CreateTestClients()); | 1274 ASSERT_TRUE(CreateTestClients()); |
1287 LocalP2PTest(); | 1275 LocalP2PTest(); |
1288 | 1276 |
1289 // Get the audio input level stats. The level should be available very | 1277 // Get the audio input level stats. The level should be available very |
1290 // soon after the test starts. | 1278 // soon after the test starts. |
1291 EXPECT_TRUE_WAIT(initializing_client()->GetAudioInputLevelStats() > 0, | 1279 EXPECT_TRUE_WAIT(initializing_client()->GetAudioInputLevelStats() > 0, |
1292 kMaxWaitForStatsMs); | 1280 kMaxWaitForStatsMs); |
1293 } | 1281 } |
1294 | 1282 |
1295 // Flaky on Mac Debug bots. See webrtc:5231 | |
1296 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | |
1297 #define MAYBE_GetBytesReceivedStats DISABLED_GetBytesReceivedStats | |
1298 #else | |
1299 #define MAYBE_GetBytesReceivedStats GetBytesReceivedStats | |
1300 #endif | |
1301 | |
1302 // Test that we can get incoming byte counts from both audio and video tracks. | 1283 // Test that we can get incoming byte counts from both audio and video tracks. |
1303 TEST_F(JsepPeerConnectionP2PTestClient, MAYBE_GetBytesReceivedStats) { | 1284 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, MAYBE_GetBytesReceivedStats) { |
kjellander_webrtc
2015/12/02 12:16:38
Please remove MAYBE_ from the test case name in a
| |
1304 ASSERT_TRUE(CreateTestClients()); | 1285 ASSERT_TRUE(CreateTestClients()); |
1305 LocalP2PTest(); | 1286 LocalP2PTest(); |
1306 | 1287 |
1307 StreamCollectionInterface* remote_streams = | 1288 StreamCollectionInterface* remote_streams = |
1308 initializing_client()->remote_streams(); | 1289 initializing_client()->remote_streams(); |
1309 ASSERT_GT(remote_streams->count(), 0u); | 1290 ASSERT_GT(remote_streams->count(), 0u); |
1310 ASSERT_GT(remote_streams->at(0)->GetAudioTracks().size(), 0u); | 1291 ASSERT_GT(remote_streams->at(0)->GetAudioTracks().size(), 0u); |
1311 MediaStreamTrackInterface* remote_audio_track = | 1292 MediaStreamTrackInterface* remote_audio_track = |
1312 remote_streams->at(0)->GetAudioTracks()[0]; | 1293 remote_streams->at(0)->GetAudioTracks()[0]; |
1313 EXPECT_TRUE_WAIT( | 1294 EXPECT_TRUE_WAIT( |
1314 initializing_client()->GetBytesReceivedStats(remote_audio_track) > 0, | 1295 initializing_client()->GetBytesReceivedStats(remote_audio_track) > 0, |
1315 kMaxWaitForStatsMs); | 1296 kMaxWaitForStatsMs); |
1316 | 1297 |
1317 MediaStreamTrackInterface* remote_video_track = | 1298 MediaStreamTrackInterface* remote_video_track = |
1318 remote_streams->at(0)->GetVideoTracks()[0]; | 1299 remote_streams->at(0)->GetVideoTracks()[0]; |
1319 EXPECT_TRUE_WAIT( | 1300 EXPECT_TRUE_WAIT( |
1320 initializing_client()->GetBytesReceivedStats(remote_video_track) > 0, | 1301 initializing_client()->GetBytesReceivedStats(remote_video_track) > 0, |
1321 kMaxWaitForStatsMs); | 1302 kMaxWaitForStatsMs); |
1322 } | 1303 } |
1323 | 1304 |
1324 // Flaky on Mac Debug bots. See webrtc:5231 | |
1325 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | |
1326 #define MAYBE_GetBytesSentStats DISABLED_GetBytesSentStats | |
1327 #else | |
1328 #define MAYBE_GetBytesSentStats GetBytesSentStats | |
1329 #endif | |
1330 | |
1331 // Test that we can get outgoing byte counts from both audio and video tracks. | 1305 // Test that we can get outgoing byte counts from both audio and video tracks. |
1332 TEST_F(JsepPeerConnectionP2PTestClient, MAYBE_GetBytesSentStats) { | 1306 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, MAYBE_GetBytesSentStats) { |
kjellander_webrtc
2015/12/02 12:16:38
Please remove MAYBE_ from the test case name in a
| |
1333 ASSERT_TRUE(CreateTestClients()); | 1307 ASSERT_TRUE(CreateTestClients()); |
1334 LocalP2PTest(); | 1308 LocalP2PTest(); |
1335 | 1309 |
1336 StreamCollectionInterface* local_streams = | 1310 StreamCollectionInterface* local_streams = |
1337 initializing_client()->local_streams(); | 1311 initializing_client()->local_streams(); |
1338 ASSERT_GT(local_streams->count(), 0u); | 1312 ASSERT_GT(local_streams->count(), 0u); |
1339 ASSERT_GT(local_streams->at(0)->GetAudioTracks().size(), 0u); | 1313 ASSERT_GT(local_streams->at(0)->GetAudioTracks().size(), 0u); |
1340 MediaStreamTrackInterface* local_audio_track = | 1314 MediaStreamTrackInterface* local_audio_track = |
1341 local_streams->at(0)->GetAudioTracks()[0]; | 1315 local_streams->at(0)->GetAudioTracks()[0]; |
1342 EXPECT_TRUE_WAIT( | 1316 EXPECT_TRUE_WAIT( |
1343 initializing_client()->GetBytesSentStats(local_audio_track) > 0, | 1317 initializing_client()->GetBytesSentStats(local_audio_track) > 0, |
1344 kMaxWaitForStatsMs); | 1318 kMaxWaitForStatsMs); |
1345 | 1319 |
1346 MediaStreamTrackInterface* local_video_track = | 1320 MediaStreamTrackInterface* local_video_track = |
1347 local_streams->at(0)->GetVideoTracks()[0]; | 1321 local_streams->at(0)->GetVideoTracks()[0]; |
1348 EXPECT_TRUE_WAIT( | 1322 EXPECT_TRUE_WAIT( |
1349 initializing_client()->GetBytesSentStats(local_video_track) > 0, | 1323 initializing_client()->GetBytesSentStats(local_video_track) > 0, |
1350 kMaxWaitForStatsMs); | 1324 kMaxWaitForStatsMs); |
1351 } | 1325 } |
1352 | 1326 |
1353 // Test that DTLS 1.0 is used if both sides only support DTLS 1.0. | 1327 // Test that DTLS 1.0 is used if both sides only support DTLS 1.0. |
1354 TEST_F(JsepPeerConnectionP2PTestClient, GetDtls12None) { | 1328 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, GetDtls12None) { |
1355 PeerConnectionFactory::Options init_options; | 1329 PeerConnectionFactory::Options init_options; |
1356 init_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10; | 1330 init_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10; |
1357 PeerConnectionFactory::Options recv_options; | 1331 PeerConnectionFactory::Options recv_options; |
1358 recv_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10; | 1332 recv_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10; |
1359 ASSERT_TRUE( | 1333 ASSERT_TRUE( |
1360 CreateTestClients(nullptr, &init_options, nullptr, &recv_options)); | 1334 CreateTestClients(nullptr, &init_options, nullptr, &recv_options)); |
1361 rtc::scoped_refptr<webrtc::FakeMetricsObserver> | 1335 rtc::scoped_refptr<webrtc::FakeMetricsObserver> |
1362 init_observer = new rtc::RefCountedObject<webrtc::FakeMetricsObserver>(); | 1336 init_observer = new rtc::RefCountedObject<webrtc::FakeMetricsObserver>(); |
1363 initializing_client()->pc()->RegisterUMAObserver(init_observer); | 1337 initializing_client()->pc()->RegisterUMAObserver(init_observer); |
1364 LocalP2PTest(); | 1338 LocalP2PTest(); |
1365 | 1339 |
1366 EXPECT_EQ_WAIT(rtc::SSLStreamAdapter::SslCipherSuiteToName( | 1340 EXPECT_EQ_WAIT(rtc::SSLStreamAdapter::SslCipherSuiteToName( |
1367 rtc::SSLStreamAdapter::GetDefaultSslCipherForTest( | 1341 rtc::SSLStreamAdapter::GetDefaultSslCipherForTest( |
1368 rtc::SSL_PROTOCOL_DTLS_10, rtc::KT_DEFAULT)), | 1342 rtc::SSL_PROTOCOL_DTLS_10, rtc::KT_DEFAULT)), |
1369 initializing_client()->GetDtlsCipherStats(), | 1343 initializing_client()->GetDtlsCipherStats(), |
1370 kMaxWaitForStatsMs); | 1344 kMaxWaitForStatsMs); |
1371 EXPECT_EQ(1, init_observer->GetEnumCounter( | 1345 EXPECT_EQ(1, init_observer->GetEnumCounter( |
1372 webrtc::kEnumCounterAudioSslCipher, | 1346 webrtc::kEnumCounterAudioSslCipher, |
1373 rtc::SSLStreamAdapter::GetDefaultSslCipherForTest( | 1347 rtc::SSLStreamAdapter::GetDefaultSslCipherForTest( |
1374 rtc::SSL_PROTOCOL_DTLS_10, rtc::KT_DEFAULT))); | 1348 rtc::SSL_PROTOCOL_DTLS_10, rtc::KT_DEFAULT))); |
1375 | 1349 |
1376 EXPECT_EQ_WAIT(rtc::SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite), | 1350 EXPECT_EQ_WAIT(rtc::SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite), |
1377 initializing_client()->GetSrtpCipherStats(), | 1351 initializing_client()->GetSrtpCipherStats(), |
1378 kMaxWaitForStatsMs); | 1352 kMaxWaitForStatsMs); |
1379 EXPECT_EQ(1, | 1353 EXPECT_EQ(1, |
1380 init_observer->GetEnumCounter(webrtc::kEnumCounterAudioSrtpCipher, | 1354 init_observer->GetEnumCounter(webrtc::kEnumCounterAudioSrtpCipher, |
1381 kDefaultSrtpCryptoSuite)); | 1355 kDefaultSrtpCryptoSuite)); |
1382 } | 1356 } |
1383 | 1357 |
1384 // Flaky on Mac Debug bots. See webrtc:5231 | |
1385 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | |
1386 #define MAYBE_GetDtls12Both DISABLED_GetDtls12Both | |
1387 #else | |
1388 #define MAYBE_GetDtls12Both GetDtls12Both | |
1389 #endif | |
1390 | |
1391 // Test that DTLS 1.2 is used if both ends support it. | 1358 // Test that DTLS 1.2 is used if both ends support it. |
1392 TEST_F(JsepPeerConnectionP2PTestClient, MAYBE_GetDtls12Both) { | 1359 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, MAYBE_GetDtls12Both) { |
kjellander_webrtc
2015/12/02 12:16:38
Please remove MAYBE_ from the test case name in a
| |
1393 PeerConnectionFactory::Options init_options; | 1360 PeerConnectionFactory::Options init_options; |
1394 init_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; | 1361 init_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; |
1395 PeerConnectionFactory::Options recv_options; | 1362 PeerConnectionFactory::Options recv_options; |
1396 recv_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; | 1363 recv_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; |
1397 ASSERT_TRUE( | 1364 ASSERT_TRUE( |
1398 CreateTestClients(nullptr, &init_options, nullptr, &recv_options)); | 1365 CreateTestClients(nullptr, &init_options, nullptr, &recv_options)); |
1399 rtc::scoped_refptr<webrtc::FakeMetricsObserver> | 1366 rtc::scoped_refptr<webrtc::FakeMetricsObserver> |
1400 init_observer = new rtc::RefCountedObject<webrtc::FakeMetricsObserver>(); | 1367 init_observer = new rtc::RefCountedObject<webrtc::FakeMetricsObserver>(); |
1401 initializing_client()->pc()->RegisterUMAObserver(init_observer); | 1368 initializing_client()->pc()->RegisterUMAObserver(init_observer); |
1402 LocalP2PTest(); | 1369 LocalP2PTest(); |
(...skipping 11 matching lines...) Expand all Loading... | |
1414 EXPECT_EQ_WAIT(rtc::SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite), | 1381 EXPECT_EQ_WAIT(rtc::SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite), |
1415 initializing_client()->GetSrtpCipherStats(), | 1382 initializing_client()->GetSrtpCipherStats(), |
1416 kMaxWaitForStatsMs); | 1383 kMaxWaitForStatsMs); |
1417 EXPECT_EQ(1, | 1384 EXPECT_EQ(1, |
1418 init_observer->GetEnumCounter(webrtc::kEnumCounterAudioSrtpCipher, | 1385 init_observer->GetEnumCounter(webrtc::kEnumCounterAudioSrtpCipher, |
1419 kDefaultSrtpCryptoSuite)); | 1386 kDefaultSrtpCryptoSuite)); |
1420 } | 1387 } |
1421 | 1388 |
1422 // Test that DTLS 1.0 is used if the initator supports DTLS 1.2 and the | 1389 // Test that DTLS 1.0 is used if the initator supports DTLS 1.2 and the |
1423 // received supports 1.0. | 1390 // received supports 1.0. |
1424 TEST_F(JsepPeerConnectionP2PTestClient, GetDtls12Init) { | 1391 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, GetDtls12Init) { |
1425 PeerConnectionFactory::Options init_options; | 1392 PeerConnectionFactory::Options init_options; |
1426 init_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; | 1393 init_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; |
1427 PeerConnectionFactory::Options recv_options; | 1394 PeerConnectionFactory::Options recv_options; |
1428 recv_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10; | 1395 recv_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10; |
1429 ASSERT_TRUE( | 1396 ASSERT_TRUE( |
1430 CreateTestClients(nullptr, &init_options, nullptr, &recv_options)); | 1397 CreateTestClients(nullptr, &init_options, nullptr, &recv_options)); |
1431 rtc::scoped_refptr<webrtc::FakeMetricsObserver> | 1398 rtc::scoped_refptr<webrtc::FakeMetricsObserver> |
1432 init_observer = new rtc::RefCountedObject<webrtc::FakeMetricsObserver>(); | 1399 init_observer = new rtc::RefCountedObject<webrtc::FakeMetricsObserver>(); |
1433 initializing_client()->pc()->RegisterUMAObserver(init_observer); | 1400 initializing_client()->pc()->RegisterUMAObserver(init_observer); |
1434 LocalP2PTest(); | 1401 LocalP2PTest(); |
(...skipping 11 matching lines...) Expand all Loading... | |
1446 EXPECT_EQ_WAIT(rtc::SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite), | 1413 EXPECT_EQ_WAIT(rtc::SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite), |
1447 initializing_client()->GetSrtpCipherStats(), | 1414 initializing_client()->GetSrtpCipherStats(), |
1448 kMaxWaitForStatsMs); | 1415 kMaxWaitForStatsMs); |
1449 EXPECT_EQ(1, | 1416 EXPECT_EQ(1, |
1450 init_observer->GetEnumCounter(webrtc::kEnumCounterAudioSrtpCipher, | 1417 init_observer->GetEnumCounter(webrtc::kEnumCounterAudioSrtpCipher, |
1451 kDefaultSrtpCryptoSuite)); | 1418 kDefaultSrtpCryptoSuite)); |
1452 } | 1419 } |
1453 | 1420 |
1454 // Test that DTLS 1.0 is used if the initator supports DTLS 1.0 and the | 1421 // Test that DTLS 1.0 is used if the initator supports DTLS 1.0 and the |
1455 // received supports 1.2. | 1422 // received supports 1.2. |
1456 TEST_F(JsepPeerConnectionP2PTestClient, GetDtls12Recv) { | 1423 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, GetDtls12Recv) { |
1457 PeerConnectionFactory::Options init_options; | 1424 PeerConnectionFactory::Options init_options; |
1458 init_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10; | 1425 init_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10; |
1459 PeerConnectionFactory::Options recv_options; | 1426 PeerConnectionFactory::Options recv_options; |
1460 recv_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; | 1427 recv_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; |
1461 ASSERT_TRUE( | 1428 ASSERT_TRUE( |
1462 CreateTestClients(nullptr, &init_options, nullptr, &recv_options)); | 1429 CreateTestClients(nullptr, &init_options, nullptr, &recv_options)); |
1463 rtc::scoped_refptr<webrtc::FakeMetricsObserver> | 1430 rtc::scoped_refptr<webrtc::FakeMetricsObserver> |
1464 init_observer = new rtc::RefCountedObject<webrtc::FakeMetricsObserver>(); | 1431 init_observer = new rtc::RefCountedObject<webrtc::FakeMetricsObserver>(); |
1465 initializing_client()->pc()->RegisterUMAObserver(init_observer); | 1432 initializing_client()->pc()->RegisterUMAObserver(init_observer); |
1466 LocalP2PTest(); | 1433 LocalP2PTest(); |
(...skipping 10 matching lines...) Expand all Loading... | |
1477 | 1444 |
1478 EXPECT_EQ_WAIT(rtc::SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite), | 1445 EXPECT_EQ_WAIT(rtc::SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite), |
1479 initializing_client()->GetSrtpCipherStats(), | 1446 initializing_client()->GetSrtpCipherStats(), |
1480 kMaxWaitForStatsMs); | 1447 kMaxWaitForStatsMs); |
1481 EXPECT_EQ(1, | 1448 EXPECT_EQ(1, |
1482 init_observer->GetEnumCounter(webrtc::kEnumCounterAudioSrtpCipher, | 1449 init_observer->GetEnumCounter(webrtc::kEnumCounterAudioSrtpCipher, |
1483 kDefaultSrtpCryptoSuite)); | 1450 kDefaultSrtpCryptoSuite)); |
1484 } | 1451 } |
1485 | 1452 |
1486 // This test sets up a call between two parties with audio, video and data. | 1453 // This test sets up a call between two parties with audio, video and data. |
1487 TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestDataChannel) { | 1454 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestDataChannel) { |
1488 FakeConstraints setup_constraints; | 1455 FakeConstraints setup_constraints; |
1489 setup_constraints.SetAllowRtpDataChannels(); | 1456 setup_constraints.SetAllowRtpDataChannels(); |
1490 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); | 1457 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); |
1491 initializing_client()->CreateDataChannel(); | 1458 initializing_client()->CreateDataChannel(); |
1492 LocalP2PTest(); | 1459 LocalP2PTest(); |
1493 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); | 1460 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); |
1494 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); | 1461 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); |
1495 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), | 1462 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), |
1496 kMaxWaitMs); | 1463 kMaxWaitMs); |
1497 EXPECT_TRUE_WAIT(receiving_client()->data_observer()->IsOpen(), | 1464 EXPECT_TRUE_WAIT(receiving_client()->data_observer()->IsOpen(), |
(...skipping 16 matching lines...) Expand all Loading... | |
1514 EXPECT_FALSE(receiving_client()->data_observer()->IsOpen()); | 1481 EXPECT_FALSE(receiving_client()->data_observer()->IsOpen()); |
1515 } | 1482 } |
1516 | 1483 |
1517 // This test sets up a call between two parties and creates a data channel. | 1484 // This test sets up a call between two parties and creates a data channel. |
1518 // The test tests that received data is buffered unless an observer has been | 1485 // The test tests that received data is buffered unless an observer has been |
1519 // registered. | 1486 // registered. |
1520 // Rtp data channels can receive data before the underlying | 1487 // Rtp data channels can receive data before the underlying |
1521 // transport has detected that a channel is writable and thus data can be | 1488 // transport has detected that a channel is writable and thus data can be |
1522 // received before the data channel state changes to open. That is hard to test | 1489 // received before the data channel state changes to open. That is hard to test |
1523 // but the same buffering is used in that case. | 1490 // but the same buffering is used in that case. |
1524 TEST_F(JsepPeerConnectionP2PTestClient, RegisterDataChannelObserver) { | 1491 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, RegisterDataChannelObserver) { |
1525 FakeConstraints setup_constraints; | 1492 FakeConstraints setup_constraints; |
1526 setup_constraints.SetAllowRtpDataChannels(); | 1493 setup_constraints.SetAllowRtpDataChannels(); |
1527 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); | 1494 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); |
1528 initializing_client()->CreateDataChannel(); | 1495 initializing_client()->CreateDataChannel(); |
1529 initializing_client()->Negotiate(); | 1496 initializing_client()->Negotiate(); |
1530 | 1497 |
1531 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); | 1498 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); |
1532 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); | 1499 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); |
1533 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), | 1500 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), |
1534 kMaxWaitMs); | 1501 kMaxWaitMs); |
1535 EXPECT_EQ_WAIT(DataChannelInterface::kOpen, | 1502 EXPECT_EQ_WAIT(DataChannelInterface::kOpen, |
1536 receiving_client()->data_channel()->state(), kMaxWaitMs); | 1503 receiving_client()->data_channel()->state(), kMaxWaitMs); |
1537 | 1504 |
1538 // Unregister the existing observer. | 1505 // Unregister the existing observer. |
1539 receiving_client()->data_channel()->UnregisterObserver(); | 1506 receiving_client()->data_channel()->UnregisterObserver(); |
1540 | 1507 |
1541 std::string data = "hello world"; | 1508 std::string data = "hello world"; |
1542 SendRtpData(initializing_client()->data_channel(), data); | 1509 SendRtpData(initializing_client()->data_channel(), data); |
1543 | 1510 |
1544 // Wait a while to allow the sent data to arrive before an observer is | 1511 // Wait a while to allow the sent data to arrive before an observer is |
1545 // registered.. | 1512 // registered.. |
1546 rtc::Thread::Current()->ProcessMessages(100); | 1513 rtc::Thread::Current()->ProcessMessages(100); |
1547 | 1514 |
1548 MockDataChannelObserver new_observer(receiving_client()->data_channel()); | 1515 MockDataChannelObserver new_observer(receiving_client()->data_channel()); |
1549 EXPECT_EQ_WAIT(data, new_observer.last_message(), kMaxWaitMs); | 1516 EXPECT_EQ_WAIT(data, new_observer.last_message(), kMaxWaitMs); |
1550 } | 1517 } |
1551 | 1518 |
1552 // This test sets up a call between two parties with audio, video and but only | 1519 // This test sets up a call between two parties with audio, video and but only |
1553 // the initiating client support data. | 1520 // the initiating client support data. |
1554 TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestReceiverDoesntSupportData) { | 1521 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, |
1522 LocalP2PTestReceiverDoesntSupportData) { | |
1555 FakeConstraints setup_constraints_1; | 1523 FakeConstraints setup_constraints_1; |
1556 setup_constraints_1.SetAllowRtpDataChannels(); | 1524 setup_constraints_1.SetAllowRtpDataChannels(); |
1557 // Must disable DTLS to make negotiation succeed. | 1525 // Must disable DTLS to make negotiation succeed. |
1558 setup_constraints_1.SetMandatory( | 1526 setup_constraints_1.SetMandatory( |
1559 MediaConstraintsInterface::kEnableDtlsSrtp, false); | 1527 MediaConstraintsInterface::kEnableDtlsSrtp, false); |
1560 FakeConstraints setup_constraints_2; | 1528 FakeConstraints setup_constraints_2; |
1561 setup_constraints_2.SetMandatory( | 1529 setup_constraints_2.SetMandatory( |
1562 MediaConstraintsInterface::kEnableDtlsSrtp, false); | 1530 MediaConstraintsInterface::kEnableDtlsSrtp, false); |
1563 ASSERT_TRUE(CreateTestClients(&setup_constraints_1, &setup_constraints_2)); | 1531 ASSERT_TRUE(CreateTestClients(&setup_constraints_1, &setup_constraints_2)); |
1564 initializing_client()->CreateDataChannel(); | 1532 initializing_client()->CreateDataChannel(); |
1565 LocalP2PTest(); | 1533 LocalP2PTest(); |
1566 EXPECT_TRUE(initializing_client()->data_channel() != nullptr); | 1534 EXPECT_TRUE(initializing_client()->data_channel() != nullptr); |
1567 EXPECT_FALSE(receiving_client()->data_channel()); | 1535 EXPECT_FALSE(receiving_client()->data_channel()); |
1568 EXPECT_FALSE(initializing_client()->data_observer()->IsOpen()); | 1536 EXPECT_FALSE(initializing_client()->data_observer()->IsOpen()); |
1569 } | 1537 } |
1570 | 1538 |
1571 // This test sets up a call between two parties with audio, video. When audio | 1539 // This test sets up a call between two parties with audio, video. When audio |
1572 // and video is setup and flowing and data channel is negotiated. | 1540 // and video is setup and flowing and data channel is negotiated. |
1573 TEST_F(JsepPeerConnectionP2PTestClient, AddDataChannelAfterRenegotiation) { | 1541 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, |
1542 AddDataChannelAfterRenegotiation) { | |
1574 FakeConstraints setup_constraints; | 1543 FakeConstraints setup_constraints; |
1575 setup_constraints.SetAllowRtpDataChannels(); | 1544 setup_constraints.SetAllowRtpDataChannels(); |
1576 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); | 1545 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); |
1577 LocalP2PTest(); | 1546 LocalP2PTest(); |
1578 initializing_client()->CreateDataChannel(); | 1547 initializing_client()->CreateDataChannel(); |
1579 // Send new offer and answer. | 1548 // Send new offer and answer. |
1580 initializing_client()->Negotiate(); | 1549 initializing_client()->Negotiate(); |
1581 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); | 1550 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); |
1582 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); | 1551 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); |
1583 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), | 1552 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), |
1584 kMaxWaitMs); | 1553 kMaxWaitMs); |
1585 EXPECT_TRUE_WAIT(receiving_client()->data_observer()->IsOpen(), | 1554 EXPECT_TRUE_WAIT(receiving_client()->data_observer()->IsOpen(), |
1586 kMaxWaitMs); | 1555 kMaxWaitMs); |
1587 } | 1556 } |
1588 | 1557 |
1589 // This test sets up a Jsep call with SCTP DataChannel and verifies the | 1558 // This test sets up a Jsep call with SCTP DataChannel and verifies the |
1590 // negotiation is completed without error. | 1559 // negotiation is completed without error. |
1591 #ifdef HAVE_SCTP | 1560 #ifdef HAVE_SCTP |
1592 TEST_F(JsepPeerConnectionP2PTestClient, CreateOfferWithSctpDataChannel) { | 1561 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, CreateOfferWithSctpDataChannel) { |
1593 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 1562 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
1594 FakeConstraints constraints; | 1563 FakeConstraints constraints; |
1595 constraints.SetMandatory( | 1564 constraints.SetMandatory( |
1596 MediaConstraintsInterface::kEnableDtlsSrtp, true); | 1565 MediaConstraintsInterface::kEnableDtlsSrtp, true); |
1597 ASSERT_TRUE(CreateTestClients(&constraints, &constraints)); | 1566 ASSERT_TRUE(CreateTestClients(&constraints, &constraints)); |
1598 initializing_client()->CreateDataChannel(); | 1567 initializing_client()->CreateDataChannel(); |
1599 initializing_client()->Negotiate(false, false); | 1568 initializing_client()->Negotiate(false, false); |
1600 } | 1569 } |
1601 #endif | 1570 #endif |
1602 | 1571 |
1603 // Flaky on Mac Debug bots. See webrtc:5231 | |
1604 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) | |
1605 #define MAYBE_IceRestart DISABLED_IceRestart | |
1606 #else | |
1607 #define MAYBE_IceRestart IceRestart | |
1608 #endif | |
1609 | |
1610 // This test sets up a call between two parties with audio, and video. | 1572 // This test sets up a call between two parties with audio, and video. |
1611 // During the call, the initializing side restart ice and the test verifies that | 1573 // During the call, the initializing side restart ice and the test verifies that |
1612 // new ice candidates are generated and audio and video still can flow. | 1574 // new ice candidates are generated and audio and video still can flow. |
1613 TEST_F(JsepPeerConnectionP2PTestClient, MAYBE_IceRestart) { | 1575 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, MAYBE_IceRestart) { |
kjellander_webrtc
2015/12/02 12:16:38
Please remove MAYBE_ from the test case name in a
| |
1614 ASSERT_TRUE(CreateTestClients()); | 1576 ASSERT_TRUE(CreateTestClients()); |
1615 | 1577 |
1616 // Negotiate and wait for ice completion and make sure audio and video plays. | 1578 // Negotiate and wait for ice completion and make sure audio and video plays. |
1617 LocalP2PTest(); | 1579 LocalP2PTest(); |
1618 | 1580 |
1619 // Create a SDP string of the first audio candidate for both clients. | 1581 // Create a SDP string of the first audio candidate for both clients. |
1620 const webrtc::IceCandidateCollection* audio_candidates_initiator = | 1582 const webrtc::IceCandidateCollection* audio_candidates_initiator = |
1621 initializing_client()->pc()->local_description()->candidates(0); | 1583 initializing_client()->pc()->local_description()->candidates(0); |
1622 const webrtc::IceCandidateCollection* audio_candidates_receiver = | 1584 const webrtc::IceCandidateCollection* audio_candidates_receiver = |
1623 receiving_client()->pc()->local_description()->candidates(0); | 1585 receiving_client()->pc()->local_description()->candidates(0); |
(...skipping 29 matching lines...) Expand all Loading... | |
1653 | 1615 |
1654 // Verify that the first candidates in the local session descriptions has | 1616 // Verify that the first candidates in the local session descriptions has |
1655 // changed. | 1617 // changed. |
1656 EXPECT_NE(initiator_candidate, initiator_candidate_restart); | 1618 EXPECT_NE(initiator_candidate, initiator_candidate_restart); |
1657 EXPECT_NE(receiver_candidate, receiver_candidate_restart); | 1619 EXPECT_NE(receiver_candidate, receiver_candidate_restart); |
1658 } | 1620 } |
1659 | 1621 |
1660 // This test sets up a call between two parties with audio, and video. | 1622 // This test sets up a call between two parties with audio, and video. |
1661 // It then renegotiates setting the video m-line to "port 0", then later | 1623 // It then renegotiates setting the video m-line to "port 0", then later |
1662 // renegotiates again, enabling video. | 1624 // renegotiates again, enabling video. |
1663 TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestVideoDisableEnable) { | 1625 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestVideoDisableEnable) { |
1664 ASSERT_TRUE(CreateTestClients()); | 1626 ASSERT_TRUE(CreateTestClients()); |
1665 | 1627 |
1666 // Do initial negotiation. Will result in video and audio sendonly m-lines. | 1628 // Do initial negotiation. Will result in video and audio sendonly m-lines. |
1667 receiving_client()->set_auto_add_stream(false); | 1629 receiving_client()->set_auto_add_stream(false); |
1668 initializing_client()->AddMediaStream(true, true); | 1630 initializing_client()->AddMediaStream(true, true); |
1669 initializing_client()->Negotiate(); | 1631 initializing_client()->Negotiate(); |
1670 | 1632 |
1671 // Negotiate again, disabling the video m-line (receiving client will | 1633 // Negotiate again, disabling the video m-line (receiving client will |
1672 // set port to 0 due to mandatory "OfferToReceiveVideo: false" constraint). | 1634 // set port to 0 due to mandatory "OfferToReceiveVideo: false" constraint). |
1673 receiving_client()->SetReceiveVideo(false); | 1635 receiving_client()->SetReceiveVideo(false); |
1674 initializing_client()->Negotiate(); | 1636 initializing_client()->Negotiate(); |
1675 | 1637 |
1676 // Enable video and do negotiation again, making sure video is received | 1638 // Enable video and do negotiation again, making sure video is received |
1677 // end-to-end. | 1639 // end-to-end. |
1678 receiving_client()->SetReceiveVideo(true); | 1640 receiving_client()->SetReceiveVideo(true); |
1679 receiving_client()->AddMediaStream(true, true); | 1641 receiving_client()->AddMediaStream(true, true); |
1680 LocalP2PTest(); | 1642 LocalP2PTest(); |
1681 } | 1643 } |
1682 | 1644 |
1683 // This test sets up a Jsep call between two parties with external | 1645 // This test sets up a Jsep call between two parties with external |
1684 // VideoDecoderFactory. | 1646 // VideoDecoderFactory. |
1685 // TODO(holmer): Disabled due to sometimes crashing on buildbots. | 1647 // TODO(holmer): Disabled due to sometimes crashing on buildbots. |
1686 // See issue webrtc/2378. | 1648 // See issue webrtc/2378. |
1687 TEST_F(JsepPeerConnectionP2PTestClient, | 1649 TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, |
1688 DISABLED_LocalP2PTestWithVideoDecoderFactory) { | 1650 DISABLED_LocalP2PTestWithVideoDecoderFactory) { |
1689 ASSERT_TRUE(CreateTestClients()); | 1651 ASSERT_TRUE(CreateTestClients()); |
1690 EnableVideoDecoderFactory(); | 1652 EnableVideoDecoderFactory(); |
1691 LocalP2PTest(); | 1653 LocalP2PTest(); |
1692 } | 1654 } |
1693 | 1655 |
1694 class IceServerParsingTest : public testing::Test { | 1656 class IceServerParsingTest : public testing::Test { |
1695 public: | 1657 public: |
1696 // Convenience for parsing a single URL. | 1658 // Convenience for parsing a single URL. |
1697 bool ParseUrl(const std::string& url) { | 1659 bool ParseUrl(const std::string& url) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1861 server.urls.push_back("stun:hostname"); | 1823 server.urls.push_back("stun:hostname"); |
1862 server.urls.push_back("turn:hostname"); | 1824 server.urls.push_back("turn:hostname"); |
1863 servers.push_back(server); | 1825 servers.push_back(server); |
1864 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_configurations_, | 1826 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_configurations_, |
1865 &turn_configurations_)); | 1827 &turn_configurations_)); |
1866 EXPECT_EQ(1U, stun_configurations_.size()); | 1828 EXPECT_EQ(1U, stun_configurations_.size()); |
1867 EXPECT_EQ(1U, turn_configurations_.size()); | 1829 EXPECT_EQ(1U, turn_configurations_.size()); |
1868 } | 1830 } |
1869 | 1831 |
1870 #endif // if !defined(THREAD_SANITIZER) | 1832 #endif // if !defined(THREAD_SANITIZER) |
OLD | NEW |