Bug 759521 - WebTelephony: investigate test failures for outgoing calls. r=philikon

This commit is contained in:
Hsinyi Tsai 2012-06-08 18:51:38 +08:00
Родитель 0bf5d7aef6
Коммит ef1443bf24
2 изменённых файлов: 21 добавлений и 9 удалений

Просмотреть файл

@ -8,10 +8,9 @@ qemu = true
[test_outgoing_answer_hangup.js]
[test_incoming_answer_hangup_oncallschanged.js]
[test_outgoing_answer_hangup_oncallschanged.js]
# Bug 759521
# Bug 761533
#[test_outgoing_badNumber.js]
#expectedfailure = true
#[test_outgoing_busy.js]
#expectedfailure = true
#[test_outgoing_reject.js]
#expectedfailure = true
[test_outgoing_reject.js]

Просмотреть файл

@ -34,10 +34,10 @@ function dial() {
is(outgoing.number, number);
is(outgoing.state, "dialing");
//is(outgoing, telephony.active); // bug 757587
//ok(telephony.calls === calls); // bug 757587
//is(calls.length, 1); // bug 757587
//is(calls[0], outgoing); // bug 757587
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);
@ -57,7 +57,7 @@ function reject() {
is(outgoing, event.call);
is(outgoing.state, "disconnected");
//is(telephony.active, null); // bug 757587
is(telephony.active, null);
is(telephony.calls.length, 0);
runEmulatorCmd("gsm list", function(result) {
@ -66,9 +66,22 @@ function reject() {
cleanUp();
});
};
runEmulatorCmd("gsm cancel " + number);
runEmulatorCmd("gsm list", cmdCallback);
};
function cmdCallback(result) {
let state = "outbound to " + number + " : unknown";
log("Call list is now: " + result);
// The outgoing call cannot be canceled when call state is unknown.
// Wait until the call connection is established.
if (result[0] == state) {
runEmulatorCmd("gsm list", cmdCallback);
} else {
runEmulatorCmd("gsm cancel " + number);
}
}
function cleanUp() {
SpecialPowers.clearUserPref(WHITELIST_PREF);
finish();