Bug 849714 - Fix intermittent failure in outgoing_answer_hangup_oncallschanged; r=jgriffin

This commit is contained in:
Rob Wood 2013-04-24 12:38:19 -04:00
parent 198d012d16
commit 76da970a99

View File

@ -46,16 +46,10 @@ function dial() {
is(outgoing.number, number);
is(outgoing, telephony.active);
//ok(telephony.calls === calls); // bug 717414
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoing);
runEmulatorCmd("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : unknown");
is(result[1], "OK");
answer();
});
checkCallList();
}
if (event.call.state == "disconnected") {
@ -69,6 +63,17 @@ function dial() {
telephony.dial(number);
}
function checkCallList() {
runEmulatorCmd("gsm list", function(result) {
log("Call list is now: " + result)
if ((result[0] == "outbound to " + number + " : unknown") && (result[1] == "OK")) {
answer();
} else {
window.setTimeout(checkCallList, 100);
}
});
}
function answer() {
log("Answering the outgoing call.");
@ -82,7 +87,7 @@ function answer() {
is(outgoing, telephony.active);
runEmulatorCmd("gsm list", function(result) {
log("Call list is now: " + result);
log("Call list (after 'connected' event) is now: " + result);
is(result[0], "outbound to " + number + " : active");
is(result[1], "OK");
hangUp();