Index: webrtc/api/peerconnection_unittest.cc |
diff --git a/webrtc/api/peerconnection_unittest.cc b/webrtc/api/peerconnection_unittest.cc |
index a43d075d57416231cbf5765baba5f516763d3b0a..a7d490c0a2563f2dd9aa18ddcbeb374acd47f1da 100644 |
--- a/webrtc/api/peerconnection_unittest.cc |
+++ b/webrtc/api/peerconnection_unittest.cc |
@@ -415,7 +415,7 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver, |
return data_observer_.get(); |
} |
- webrtc::PeerConnectionInterface* pc() { return peer_connection_.get(); } |
+ webrtc::PeerConnectionInterface* pc() const { return peer_connection_.get(); } |
void StopVideoCapturers() { |
for (std::vector<cricket::VideoCapturer*>::iterator it = |
@@ -426,6 +426,10 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver, |
} |
bool AudioFramesReceivedCheck(int number_of_frames) const { |
+ // Only check frames if the incoming stream exists. |
+ if (remote_streams()->count() == 0) { |
perkj_webrtc
2016/03/08 23:07:50
can you please refactor LocalP2PTest instead? Ther
hta-webrtc
2016/03/09 04:09:53
I'd like not to, because I've got another CL in fl
hta-webrtc
2016/03/09 09:40:17
Only took an hour to restructure the counting. Loo
|
+ return true; |
+ } |
return number_of_frames <= fake_audio_capture_module_->frames_received(); |
} |
@@ -434,6 +438,10 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver, |
} |
bool VideoFramesReceivedCheck(int number_of_frames) { |
+ // Only check frames if the incoming stream exists. |
+ if (remote_streams()->count() == 0) { |
+ return true; |
+ } |
if (video_decoder_factory_enabled_) { |
const std::vector<FakeWebRtcVideoDecoder*>& decoders |
= fake_video_decoder_factory_->decoders(); |
@@ -660,7 +668,7 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver, |
return pc()->remote_streams()->count(); |
} |
- StreamCollectionInterface* remote_streams() { |
+ StreamCollectionInterface* remote_streams() const { |
if (!pc()) { |
ADD_FAILURE(); |
return nullptr; |
@@ -1213,6 +1221,14 @@ TEST_F(P2PTestConductor, LocalP2PTestDtls) { |
SetupAndVerifyDtlsCall(); |
} |
+// This test sets up an one-way call, with media only from initiator to |
+// responder. |
+TEST_F(P2PTestConductor, OneWayMediaCall) { |
+ ASSERT_TRUE(CreateTestClients()); |
+ receiving_client()->set_auto_add_stream(false); |
+ LocalP2PTest(); |
+} |
+ |
// This test sets up a audio call initially and then upgrades to audio/video, |
// using DTLS. |
TEST_F(P2PTestConductor, LocalP2PTestDtlsRenegotiate) { |