Index: webrtc/api/peerconnection_unittest.cc |
diff --git a/webrtc/api/peerconnection_unittest.cc b/webrtc/api/peerconnection_unittest.cc |
index a43d075d57416231cbf5765baba5f516763d3b0a..1f0f61bbdb2e5a48a263c1d164c750be068e2d9f 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 { |
+ // If there is no incoming stream, return true always. |
phoglund
2016/03/08 12:52:18
Nit: I can see that from the code, so maybe "Only
hta-webrtc
2016/03/08 13:54:06
Done.
|
+ if (remote_streams()->count() == 0) { |
+ 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) { |
+ // If there is no incoming stream, return true always. |
+ 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) { |