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

Unified Diff: content/test/data/media/peerconnection-call.html

Issue 1032953002: Refactored the test WebRtcBrowserTest.CanForwardRemoteStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « content/browser/media/webrtc_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/media/peerconnection-call.html
diff --git a/content/test/data/media/peerconnection-call.html b/content/test/data/media/peerconnection-call.html
index 2912cd41f8ceea302efe4b773f838a8577d711f8..f9aa9488cb6df30a4c17ab6e516cfc01f55c63b2 100644
--- a/content/test/data/media/peerconnection-call.html
+++ b/content/test/data/media/peerconnection-call.html
@@ -156,50 +156,29 @@
});
}
- // First makes a call between pc1 and pc2, and then makes a call between pc3
- // and pc4. The stream sent from pc3 to pc4 is the stream received on pc1.
- // The stream sent from pc4 to pc3 is cloned from the stream received on pc2
- // to test that cloning of remote video tracks works as intended.
+ // First makes a call between pc1 and pc2 where a stream is sent from pc1 to
+ // pc2.
+ // The stream sent from pc1 to pc2 is cloned from the stream received on pc2
phoglund_chromium 2015/03/26 09:59:15 Nit: pull up comment to previous line.
+ // to test that cloning of remote video tracks works as intended and is sent
+ // back to pc1.
function callAndForwardRemoteStream(constraints) {
createConnections(null);
navigator.webkitGetUserMedia(constraints,
- addStreamToBothConnectionsAndNegotiate,
+ addStreamToTheFirstConnectionAndNegotiate,
printGetUserMediaError);
- var gotRemoteStream1 = false;
- var gotRemoteStream2 = false;
-
- var onRemoteStream1 = function() {
- gotRemoteStream1 = true;
- maybeCallEstablished();
- }
-
var onRemoteStream2 = function() {
- gotRemoteStream2 = true;
- maybeCallEstablished();
- }
-
- var maybeCallEstablished = function() {
- if (gotRemoteStream1 && gotRemoteStream2) {
- onCallEstablished();
- }
- }
-
- var onCallEstablished = function() {
- thirdConnection = createConnection(null, 'remote-view-3');
- thirdConnection.addStream(gRemoteStreams['remote-view-1']);
-
- fourthConnection = createConnection(null, 'remote-view-4');
- fourthConnection.addStream(gRemoteStreams['remote-view-2'].clone());
-
- negotiateBetween(thirdConnection, fourthConnection);
-
- waitForVideo('remote-view-3');
- waitForVideo('remote-view-4');
+ // Video has been detected to be playing in pc2. Clone the received
+ // stream and send it back to pc1.
+ gSecondConnection.addStream(gRemoteStreams['remote-view-2'].clone());
+ negotiate();
}
- // Do the forwarding after we have received video.
- detectVideoPlaying('remote-view-1', onRemoteStream1);
+ // Wait for remove video to be playing in pc2. Once video is playing,
+ // forward the remove stream from pc2 to pc1.
detectVideoPlaying('remote-view-2', onRemoteStream2);
+
+ // Wait for video to be forwarded back to connection 1.
+ waitForVideo('remote-view-1');
}
// First makes a call between pc1 and pc2, and then construct a new media
« no previous file with comments | « content/browser/media/webrtc_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698