dom/telephony/test/marionette/test_outgoing_badNumber.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2  * http://creativecommons.org/publicdomain/zero/1.0/ */
     4 MARIONETTE_TIMEOUT = 60000;
     5 MARIONETTE_HEAD_JS = 'head.js';
     7 let number = "****5555552368****";
     8 let outgoing;
    11 function dial() {
    12   log("Make an outgoing call to an invalid number.");
    14   // Note: The number is valid from the view of phone and the call could be
    15   // dialed out successfully. However, it will later receive the BadNumberError
    16   // from network side.
    17   telephony.dial(number).then(call => {
    18     outgoing = call;
    19     ok(outgoing);
    20     is(outgoing.number, number);
    21     is(outgoing.state, "dialing");
    23     is(outgoing, telephony.active);
    24     is(telephony.calls.length, 1);
    25     is(telephony.calls[0], outgoing);
    27     outgoing.onerror = function onerror(event) {
    28       log("Received 'error' event.");
    29       is(event.call, outgoing);
    30       ok(event.call.error);
    31       is(event.call.error.name, "BadNumberError");
    33       emulator.run("gsm list", function(result) {
    34         log("Initial call list: " + result);
    35         is(result[0], "OK");
    36         cleanUp();
    37       });
    38     };
    39   });
    40 }
    42 function cleanUp() {
    43   finish();
    44 }
    46 startTest(function() {
    47   dial();
    48 });

mercurial