Bug 1051715 - Part 1: Add temporary clir test. r=hsinyi

This commit is contained in:
Szu-Yu Chen [:aknow] 2014-08-12 23:50:00 -04:00
parent 07c5a3a821
commit 7fb6a60be9
2 changed files with 38 additions and 0 deletions

View File

@ -61,3 +61,4 @@ disabled = Bug 821958
[test_outgoing_when_two_calls_on_line.js]
[test_call_presentation.js]
[test_incomingcall_phonestate_speaker.js]
[test_temporary_clir.js]

View File

@ -0,0 +1,37 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = 'head.js';
const clirPrefix = "*31#";
const number = "0912345678";
startTest(function() {
let outCall;
telephony.dial(clirPrefix + number).then(call => {
outCall = call;
ok(call);
is(call.id.number, number);
is(call.state, "dialing");
let deferred = Promise.defer();
call.onalerting = function onalerting(event) {
call.onalerting = null;
log("Received 'onalerting' call event.");
is(call.id.number, number);
deferred.resolve(call);
};
return deferred.promise;
})
.then(() => gRemoteHangUp(outCall))
// End
.then(null, error => {
ok(false, 'promise rejects during test.');
})
.then(finish);
});