Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: webrtc/api/peerconnection_unittest.cc

Issue 1772353002: Adds a test for an one-way media PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698