dom/telephony/test/marionette/test_emergency_badNumber.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/telephony/test/marionette/test_emergency_badNumber.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +MARIONETTE_TIMEOUT = 60000;
     1.8 +MARIONETTE_HEAD_JS = 'head.js';
     1.9 +
    1.10 +let number = "not a valid emergency number";
    1.11 +
    1.12 +function dial() {
    1.13 +  log("Make an outgoing call to an invalid number.");
    1.14 +
    1.15 +  telephony.dialEmergency(number).then(null, cause => {
    1.16 +    log("Received promise 'reject'");
    1.17 +
    1.18 +    is(telephony.active, null);
    1.19 +    is(telephony.calls.length, 0);
    1.20 +    is(cause, "BadNumberError");
    1.21 +
    1.22 +    emulator.run("gsm list", function(result) {
    1.23 +      log("Initial call list: " + result);
    1.24 +      is(result[0], "OK");
    1.25 +      cleanUp();
    1.26 +    });
    1.27 +  });
    1.28 +}
    1.29 +
    1.30 +function cleanUp() {
    1.31 +  finish();
    1.32 +}
    1.33 +
    1.34 +startTest(function() {
    1.35 +  dial();
    1.36 +});

mercurial