Bug 1193045 - Check selected attribute for all calls. r=bwc

--HG--
extra : transplant_source : %7D%1A%09%9E%AA%F7%11%0A%9A%15%D1%FF%8E%03%E1%9AE%D1%8Cy
This commit is contained in:
Nils Ohlmeier [:drno] 2015-08-11 14:55:51 -07:00
parent 4cb17f538e
commit 5423815a23
2 changed files with 14 additions and 8 deletions

View File

@ -1709,13 +1709,18 @@ PeerConnectionWrapper.prototype = {
rId = stats[name].remoteCandidateId;
}
});
info("checkStatsIceConnectionType verifying: local=" +
JSON.stringify(stats[lId]) + " remote=" + JSON.stringify(stats[rId]));
ok(typeof lId !== 'undefined', "Got local candidate ID " +
JSON.stringify(lId) + " for selected pair");
ok(typeof rId !== 'undefined', "Got remote candidate ID " +
JSON.stringify(rId) + " for selected pair");
if ((typeof stats[lId] === 'undefined') ||
(typeof stats[rId] === 'undefined')) {
info("checkStatsIceConnectionType failed to find candidatepair IDs");
ok(false, "failed to find candidatepair IDs or stats for local: " +
JSON.stringify(lId) + " remote: " + JSON.stringify(rId));
return;
}
info("checkStatsIceConnectionType verifying: local=" +
JSON.stringify(stats[lId]) + " remote=" + JSON.stringify(stats[rId]));
var lType = stats[lId].candidateType;
var rType = stats[rId].candidateType;
var lIp = stats[lId].ipAddress;
@ -1754,6 +1759,7 @@ PeerConnectionWrapper.prototype = {
}
});
info("ICE connections according to stats: " + numIceConnections);
isnot(numIceConnections, 0, "Number of ICE connections according to stats is not zero");
if (answer.sdp.includes('a=group:BUNDLE')) {
is(numIceConnections, 1, "stats reports exactly 1 ICE connection");
} else {

View File

@ -461,25 +461,25 @@ var commandsPeerConnectionOfferAnswer = [
},
function PC_REMOTE_CHECK_STATS(test) {
test.pcRemote.getStats().then(stats => {
return test.pcRemote.getStats().then(stats => {
test.pcRemote.checkStats(stats, test.steeplechase);
});
},
function PC_LOCAL_CHECK_ICE_CONNECTION_TYPE(test) {
test.pcLocal.getStats().then(stats => {
return test.pcLocal.getStats().then(stats => {
test.pcLocal.checkStatsIceConnectionType(stats);
});
},
function PC_REMOTE_CHECK_ICE_CONNECTION_TYPE(test) {
test.pcRemote.getStats().then(stats => {
return test.pcRemote.getStats().then(stats => {
test.pcRemote.checkStatsIceConnectionType(stats);
});
},
function PC_LOCAL_CHECK_ICE_CONNECTIONS(test) {
test.pcLocal.getStats().then(stats => {
return test.pcLocal.getStats().then(stats => {
test.pcLocal.checkStatsIceConnections(stats,
test._offer_constraints,
test._offer_options,
@ -488,7 +488,7 @@ var commandsPeerConnectionOfferAnswer = [
},
function PC_REMOTE_CHECK_ICE_CONNECTIONS(test) {
test.pcRemote.getStats().then(stats => {
return test.pcRemote.getStats().then(stats => {
test.pcRemote.checkStatsIceConnections(stats,
test._offer_constraints,
test._offer_options,