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

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

Issue 15688006: Made sure empty-call-then-add-one-stream test doesn't do simultaneous negotiations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Will now not allow simultaneous negotiations. Created 7 years, 7 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') | content/test/data/media/webrtc_test_utilities.js » ('j') | 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 814f5f18c9cfaa3c42d824a9b13638f0f2c551b5..6a9219d980097c0674d2607a88cb17db923eceb4 100644
--- a/content/test/data/media/peerconnection-call.html
+++ b/content/test/data/media/peerconnection-call.html
@@ -27,10 +27,13 @@
}
// First calls without streams on any connections, and then adds a stream
- // to peer connection 1 which gets sent to peer connection 2.
- function makeEmptyCallThenAddOneStreamAndRenegotiate(constraints) {
+ // to peer connection 1 which gets sent to peer connection 2. We must wait
+ // for the first negotiation to complete before starting the second one, which
+ // is why we wait until the connection is stable before re-negotiating.
+ function callEmptyThenAddOneStreamAndRenegotiate(constraints) {
createConnections(null);
negotiate();
+ waitForConnectionToStabilize(gFirstConnection);
navigator.webkitGetUserMedia(constraints,
addStreamToTheFirstConnectionAndNegotiate, printGetUserMediaError);
// Only the first connection is sending here.
@@ -52,7 +55,7 @@
function callWithDataOnly() {
createConnections({optional:[{RtpDataChannels: true}]});
setupDataChannel();
- gFirstConnection.createOffer(onOfferCreated);
+ negotiate();
}
// Test call with audio, video and a data channel.
@@ -70,7 +73,7 @@
function callWithDataAndLaterAddMedia() {
createConnections({optional:[{RtpDataChannels: true}]});
setupDataChannel();
- gFirstConnection.createOffer(onOfferCreated);
+ negotiate();
// Set an event handler for when the data channel has been closed.
setAllEventsOccuredHandler(function() {
@@ -208,7 +211,7 @@
firstDataChannel.onmessage = function(event) {
expectEquals(event.data, sendDataString);
firstDataChannel.close();
- gFirstConnection.createOffer(onOfferCreated);
+ negotiate();
}
// When |firstDataChannel| transition to closed state, the test pass.
@@ -291,6 +294,11 @@
}
function negotiate() {
phoglund_chromium 2013/05/28 08:04:34 This should catch future negotiation races, such a
+ // Not stable = negotiation is ongoing. The behavior of re-negotiating while
+ // a negotiation is ongoing is more or less undefined, so avoid this.
+ if (gFirstConnection.signalingState != 'stable')
+ throw 'You can only negotiate when the connection is stable!';
+
gFirstConnection.createOffer(onOfferCreated);
}
« no previous file with comments | « content/browser/media/webrtc_browsertest.cc ('k') | content/test/data/media/webrtc_test_utilities.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698