Bug 1043165 - Part 4: Update test cases. r=hsinyi

This commit is contained in:
Szu-Yu Chen [:aknow] 2015-03-26 16:39:40 +08:00
parent db4f71d9c4
commit eeaf722057
4 changed files with 26 additions and 12 deletions

View File

@ -11,32 +11,38 @@ let inCall;
function incoming() {
return gRemoteDial(inNumber)
.then(call => inCall = call)
.then(() => gCheckAll(null, [inCall], "", [], [inInfo.incoming]));
.then(() => gCheckAll(null, [inCall], "", [], [inInfo.incoming]))
.then(() => is(inCall.disconnectedReason, null));
}
function answer() {
return gAnswer(inCall)
.then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]));
.then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]))
.then(() => is(inCall.disconnectedReason, null));
}
function hold() {
return gHold(inCall)
.then(() => gCheckAll(null, [inCall], "", [], [inInfo.held]));
.then(() => gCheckAll(null, [inCall], "", [], [inInfo.held]))
.then(() => is(inCall.disconnectedReason, null));
}
function resume() {
return gResume(inCall)
.then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]));
.then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]))
.then(() => is(inCall.disconnectedReason, null));
}
function hangUp() {
return gHangUp(inCall)
.then(() => gCheckAll(null, [], "", [], []));
.then(() => gCheckAll(null, [], "", [], []))
.then(() => is(inCall.disconnectedReason, "NormalCallClearing"));
}
function remoteHangUp() {
return gRemoteHangUp(inCall)
.then(() => gCheckAll(null, [], "", [], []));
.then(() => gCheckAll(null, [], "", [], []))
.then(() => is(inCall.disconnectedReason, "NormalCallClearing"));
}
// Test cases.

View File

@ -27,6 +27,7 @@ function testDialOutInvalidNumber() {
is(event.call, outCall);
ok(event.call.error);
is(event.call.error.name, "BadNumberError");
is(event.call.disconnectedReason, "BadNumber");
})
.then(() => gCheckAll(null, [], "", [], []));
});

View File

@ -11,32 +11,38 @@ let outCall;
function outgoing() {
return gDial(outNumber)
.then(call => outCall = call)
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]));
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
.then(() => is(outCall.disconnectedReason, null));
}
function answer() {
return gRemoteAnswer(outCall)
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
.then(() => is(outCall.disconnectedReason, null));
}
function hangUp() {
return gHangUp(outCall)
.then(() => gCheckAll(null, [], "", [], []));
.then(() => gCheckAll(null, [], "", [], []))
.then(() => is(outCall.disconnectedReason, "NormalCallClearing"));
}
function remoteHangUp() {
return gRemoteHangUp(outCall)
.then(() => gCheckAll(null, [], "", [], []));
.then(() => gCheckAll(null, [], "", [], []))
.then(() => is(outCall.disconnectedReason, "NormalCallClearing"));
}
function hold() {
return gHold(outCall)
.then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]));
.then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]))
.then(() => is(outCall.disconnectedReason, null));
}
function resume() {
return gResume(outCall)
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
.then(() => is(outCall.disconnectedReason, null));
}
// Test cases.

View File

@ -17,6 +17,7 @@ startTest(function() {
.then(event => {
is(event.call, outCall);
is(event.call.error.name, "BusyError");
is(event.call.disconnectedReason, "Busy");
});
let p2 = emulator.runCmd("gsm busy " + outNumber);
return Promise.all([p1, p2]);