2012-05-29 17:39:46 -07:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
2013-04-09 09:02:51 -07:00
|
|
|
MARIONETTE_TIMEOUT = 60000;
|
2013-10-01 23:27:52 -07:00
|
|
|
MARIONETTE_HEAD_JS = 'head.js';
|
2012-05-29 17:39:46 -07:00
|
|
|
|
2013-02-18 00:59:02 -08:00
|
|
|
let number = "****5555552368****";
|
2012-05-29 17:39:46 -07:00
|
|
|
let outgoing;
|
|
|
|
|
|
|
|
function dial() {
|
|
|
|
log("Make an outgoing call to an invalid number.");
|
|
|
|
|
|
|
|
outgoing = telephony.dial(number);
|
|
|
|
ok(outgoing);
|
|
|
|
is(outgoing.number, number);
|
|
|
|
is(outgoing.state, "dialing");
|
|
|
|
|
2013-02-18 00:59:02 -08:00
|
|
|
is(outgoing, telephony.active);
|
|
|
|
is(telephony.calls.length, 1);
|
|
|
|
is(telephony.calls[0], outgoing);
|
2012-05-29 17:39:46 -07:00
|
|
|
|
|
|
|
outgoing.onerror = function onerror(event) {
|
|
|
|
log("Received 'error' event.");
|
|
|
|
is(event.call, outgoing);
|
2013-02-18 00:59:02 -08:00
|
|
|
ok(event.call.error);
|
|
|
|
is(event.call.error.name, "BadNumberError");
|
2012-05-29 17:39:46 -07:00
|
|
|
|
2013-10-01 23:27:52 -07:00
|
|
|
emulator.run("gsm list", function(result) {
|
2012-05-29 17:39:46 -07:00
|
|
|
log("Initial call list: " + result);
|
|
|
|
is(result[0], "OK");
|
|
|
|
cleanUp();
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
function cleanUp() {
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
|
2013-10-01 23:27:52 -07:00
|
|
|
startTest(function() {
|
2013-10-28 02:22:44 -07:00
|
|
|
dial();
|
2013-10-01 23:27:52 -07:00
|
|
|
});
|