Bug 1013798 - fix the timeout of the checkMediaTrack function. r=jesup

This commit is contained in:
Nils Ohlmeier [:drno] 2014-05-21 00:26:00 +02:00
parent 86908dfc08
commit c44575eaca

View File

@ -1728,7 +1728,7 @@ PeerConnectionWrapper.prototype = {
var addStreamTimeout = null;
function _checkMediaTracks(constraintsRemote, onSuccess) {
if (self.addStreamTimeout === null) {
if (self.addStreamTimeout !== null) {
clearTimeout(self.addStreamTimeout);
}
@ -1761,11 +1761,6 @@ PeerConnectionWrapper.prototype = {
onSuccess();
}
function __checkMediaTracksTimeout(onSuccess) {
ok(false, self + " checkMediaTracks() timed out waiting for onaddstream event to fire");
onSuccess();
}
// we have to do this check as the onaddstream never fires if the remote
// stream has no track at all!
var expectedRemoteTracks =
@ -1783,7 +1778,8 @@ PeerConnectionWrapper.prototype = {
_checkMediaTracks(constraintsRemote, onSuccess);
};
addStreamTimeout = setTimeout(function () {
self._checkMediaTracksTimeout(onSuccess);
ok(false, self + " checkMediaTracks() timed out waiting for onaddstream event to fire");
onSuccess();
}, 60000);
}
},