mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Merge mozilla-central to b2g-inbound
This commit is contained in:
commit
1e5706a309
@ -1632,7 +1632,9 @@ WorkerMessenger.prototype = {
|
||||
libcutils.property_get("ro.moz.ril.send_stk_profile_dl", "false") == "true",
|
||||
dataRegistrationOnDemand: RILQUIRKS_DATA_REGISTRATION_ON_DEMAND,
|
||||
subscriptionControl: RILQUIRKS_SUBSCRIPTION_CONTROL
|
||||
}
|
||||
},
|
||||
rilEmergencyNumbers: libcutils.property_get("ril.ecclist") ||
|
||||
libcutils.property_get("ro.ril.ecclist")
|
||||
};
|
||||
|
||||
this.send(null, "setInitialOptions", options);
|
||||
|
@ -52,6 +52,9 @@ if (!this.debug) {
|
||||
};
|
||||
}
|
||||
|
||||
let RIL_EMERGENCY_NUMBERS;
|
||||
const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
|
||||
|
||||
// Timeout value for emergency callback mode.
|
||||
const EMERGENCY_CB_MODE_TIMEOUT_MS = 300000; // 5 mins = 300000 ms.
|
||||
|
||||
@ -1552,7 +1555,7 @@ RilObject.prototype = {
|
||||
cachedDialRequest : null,
|
||||
|
||||
/**
|
||||
* Dial a non-emergency number.
|
||||
* Dial the phone.
|
||||
*
|
||||
* @param number
|
||||
* String containing the number to dial.
|
||||
@ -1561,13 +1564,34 @@ RilObject.prototype = {
|
||||
* @param uusInfo
|
||||
* Integer doing something XXX TODO
|
||||
*/
|
||||
dialNonEmergencyNumber: function(options) {
|
||||
dial: function(options) {
|
||||
let onerror = (function onerror(options, errorMsg) {
|
||||
options.success = false;
|
||||
options.errorMsg = errorMsg;
|
||||
this.sendChromeMessage(options);
|
||||
}).bind(this, options);
|
||||
|
||||
if (this._isEmergencyNumber(options.number)) {
|
||||
this.dialEmergencyNumber(options, onerror);
|
||||
} else {
|
||||
if (!this._isCdma) {
|
||||
// TODO: Both dial() and sendMMI() functions should be unified at some
|
||||
// point in the future. In the mean time we handle temporary CLIR MMI
|
||||
// commands through the dial() function. Please see bug 889737.
|
||||
let mmi = this._parseMMI(options.number);
|
||||
if (mmi && this._isTemporaryModeCLIR(mmi)) {
|
||||
options.number = mmi.dialNumber;
|
||||
// In temporary mode, MMI_PROCEDURE_ACTIVATION means allowing CLI
|
||||
// presentation, i.e. CLIR_SUPPRESSION. See TS 22.030, Annex B.
|
||||
options.clirMode = mmi.procedure == MMI_PROCEDURE_ACTIVATION ?
|
||||
CLIR_SUPPRESSION : CLIR_INVOCATION;
|
||||
}
|
||||
}
|
||||
this.dialNonEmergencyNumber(options, onerror);
|
||||
}
|
||||
},
|
||||
|
||||
dialNonEmergencyNumber: function(options, onerror) {
|
||||
if (this.radioState == GECKO_RADIOSTATE_OFF) {
|
||||
// Notify error in establishing the call without radio.
|
||||
onerror(GECKO_ERROR_RADIO_NOT_AVAILABLE);
|
||||
@ -1585,41 +1609,17 @@ RilObject.prototype = {
|
||||
this.exitEmergencyCbMode();
|
||||
}
|
||||
|
||||
if (!this._isCdma) {
|
||||
// TODO: Both dial() and sendMMI() functions should be unified at some
|
||||
// point in the future. In the mean time we handle temporary CLIR MMI
|
||||
// commands through the dial() function. Please see bug 889737.
|
||||
let mmi = this._parseMMI(options.number);
|
||||
if (mmi && this._isTemporaryModeCLIR(mmi)) {
|
||||
options.number = mmi.dialNumber;
|
||||
// In temporary mode, MMI_PROCEDURE_ACTIVATION means allowing CLI
|
||||
// presentation, i.e. CLIR_SUPPRESSION. See TS 22.030, Annex B.
|
||||
options.clirMode = mmi.procedure == MMI_PROCEDURE_ACTIVATION ?
|
||||
CLIR_SUPPRESSION : CLIR_INVOCATION;
|
||||
}
|
||||
if (this._isCdma && Object.keys(this.currentCalls).length == 1) {
|
||||
// Make a Cdma 3way call.
|
||||
options.featureStr = options.number;
|
||||
this.sendCdmaFlashCommand(options);
|
||||
} else {
|
||||
options.request = REQUEST_DIAL;
|
||||
this.sendDialRequest(options);
|
||||
}
|
||||
|
||||
options.request = REQUEST_DIAL;
|
||||
this.sendDialRequest(options);
|
||||
},
|
||||
|
||||
/**
|
||||
* Dial an emergency number.
|
||||
*
|
||||
* @param number
|
||||
* String containing the number to dial.
|
||||
* @param clirMode
|
||||
* Integer for showing/hidding the caller Id to the called party.
|
||||
* @param uusInfo
|
||||
* Integer doing something XXX TODO
|
||||
*/
|
||||
dialEmergencyNumber: function(options) {
|
||||
let onerror = (function onerror(options, errorMsg) {
|
||||
options.success = false;
|
||||
options.errorMsg = errorMsg;
|
||||
this.sendChromeMessage(options);
|
||||
}).bind(this, options);
|
||||
|
||||
dialEmergencyNumber: function(options, onerror) {
|
||||
options.request = RILQUIRKS_REQUEST_USE_DIAL_EMERGENCY_CALL ?
|
||||
REQUEST_DIAL_EMERGENCY_CALL : REQUEST_DIAL;
|
||||
if (this.radioState == GECKO_RADIOSTATE_OFF) {
|
||||
@ -1636,20 +1636,20 @@ RilObject.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sendDialRequest(options);
|
||||
},
|
||||
|
||||
sendDialRequest: function(options) {
|
||||
if (this._isCdma && Object.keys(this.currentCalls).length == 1) {
|
||||
// Make a Cdma 3way call.
|
||||
options.featureStr = options.number;
|
||||
this.sendCdmaFlashCommand(options);
|
||||
} else {
|
||||
this.telephonyRequestQueue.push(options.request, this.sendRilRequestDial,
|
||||
options);
|
||||
this.sendDialRequest(options);
|
||||
}
|
||||
},
|
||||
|
||||
sendDialRequest: function(options) {
|
||||
this.telephonyRequestQueue.push(options.request, this.sendRilRequestDial,
|
||||
options);
|
||||
},
|
||||
|
||||
sendRilRequestDial: function(options) {
|
||||
let Buf = this.context.Buf;
|
||||
Buf.newParcel(options.request, options);
|
||||
@ -2417,8 +2417,9 @@ RilObject.prototype = {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Should take care of checking if the string is an emergency number
|
||||
// in Bug 889737. See Bug 1023141 for more background.
|
||||
if (this._isEmergencyNumber(mmiString)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// In a call case.
|
||||
if (Object.getOwnPropertyNames(this.currentCalls).length > 0) {
|
||||
@ -3308,18 +3309,38 @@ RilObject.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks whether to temporarily suppress caller id for the call.
|
||||
* Check a given number against the list of emergency numbers provided by the RIL.
|
||||
*
|
||||
* @param mmi
|
||||
* MMI full object.
|
||||
* @param number
|
||||
* The number to look up.
|
||||
*/
|
||||
_isTemporaryModeCLIR: function(mmi) {
|
||||
return (mmi &&
|
||||
mmi.serviceCode == MMI_SC_CLIR &&
|
||||
mmi.dialNumber &&
|
||||
(mmi.procedure == MMI_PROCEDURE_ACTIVATION ||
|
||||
mmi.procedure == MMI_PROCEDURE_DEACTIVATION));
|
||||
},
|
||||
_isEmergencyNumber: function(number) {
|
||||
// Check ril provided numbers first.
|
||||
let numbers = RIL_EMERGENCY_NUMBERS;
|
||||
|
||||
if (numbers) {
|
||||
numbers = numbers.split(",");
|
||||
} else {
|
||||
// No ecclist system property, so use our own list.
|
||||
numbers = DEFAULT_EMERGENCY_NUMBERS;
|
||||
}
|
||||
|
||||
return numbers.indexOf(number) != -1;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks whether to temporarily suppress caller id for the call.
|
||||
*
|
||||
* @param mmi
|
||||
* MMI full object.
|
||||
*/
|
||||
_isTemporaryModeCLIR: function(mmi) {
|
||||
return (mmi &&
|
||||
mmi.serviceCode == MMI_SC_CLIR &&
|
||||
mmi.dialNumber &&
|
||||
(mmi.procedure == MMI_PROCEDURE_ACTIVATION ||
|
||||
mmi.procedure == MMI_PROCEDURE_DEACTIVATION));
|
||||
},
|
||||
|
||||
/**
|
||||
* Report STK Service is running.
|
||||
@ -4034,7 +4055,6 @@ RilObject.prototype = {
|
||||
for (let i in newCalls) {
|
||||
if (newCalls[i].state !== CALL_STATE_INCOMING) {
|
||||
callIndex = newCalls[i].callIndex;
|
||||
newCalls[i].isEmergency = options.isEmergency;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4085,9 +4105,9 @@ RilObject.prototype = {
|
||||
newCall.isOutgoing = true;
|
||||
}
|
||||
|
||||
if (newCall.isEmergency === undefined) {
|
||||
newCall.isEmergency = false;
|
||||
}
|
||||
// Set flag for outgoing emergency call.
|
||||
newCall.isEmergency = newCall.isOutgoing &&
|
||||
this._isEmergencyNumber(newCall.number);
|
||||
|
||||
// Set flag for conference.
|
||||
newCall.isConference = newCall.isMpty ? true : false;
|
||||
|
@ -122,9 +122,8 @@ add_test(function test_request_exit_emergencyCbMode_when_dial() {
|
||||
};
|
||||
|
||||
// Dial non-emergency call.
|
||||
context.RIL.dialNonEmergencyNumber({number: "0912345678",
|
||||
isEmergency: false,
|
||||
isDialEmergency: false});
|
||||
context.RIL.dial({number: "0912345678",
|
||||
isDialEmergency: false});
|
||||
|
||||
// Should clear timeout event.
|
||||
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, null);
|
||||
|
@ -10,7 +10,6 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/systemlibs.js");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
|
||||
let obj = {};
|
||||
@ -51,8 +50,6 @@ const AUDIO_STATE_NAME = [
|
||||
"PHONE_STATE_IN_CALL"
|
||||
];
|
||||
|
||||
const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
|
||||
|
||||
let DEBUG;
|
||||
function debug(s) {
|
||||
dump("TelephonyService: " + s + "\n");
|
||||
@ -333,26 +330,6 @@ TelephonyService.prototype = {
|
||||
}).bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
* Check a given number against the list of emergency numbers provided by the
|
||||
* RIL.
|
||||
*
|
||||
* @param aNumber
|
||||
* The number to look up.
|
||||
*/
|
||||
_isEmergencyNumber: function(aNumber) {
|
||||
// Check ril provided numbers first.
|
||||
let numbers = libcutils.property_get("ril.ecclist") ||
|
||||
libcutils.property_get("ro.ril.ecclist");
|
||||
if (numbers) {
|
||||
numbers = numbers.split(",");
|
||||
} else {
|
||||
// No ecclist system property, so use our own list.
|
||||
numbers = DEFAULT_EMERGENCY_NUMBERS;
|
||||
}
|
||||
return numbers.indexOf(aNumber) != -1;
|
||||
},
|
||||
|
||||
/**
|
||||
* nsITelephonyService interface.
|
||||
*/
|
||||
@ -500,14 +477,9 @@ TelephonyService.prototype = {
|
||||
this.notifyCallStateChanged(aClientId, parentCall);
|
||||
};
|
||||
|
||||
let isEmergencyNumber = this._isEmergencyNumber(aNumber);
|
||||
let msg = isEmergencyNumber ?
|
||||
"dialEmergencyNumber" :
|
||||
"dialNonEmergencyNumber";
|
||||
this.isDialing = true;
|
||||
this._getClient(aClientId).sendWorkerMessage(msg, {
|
||||
this._getClient(aClientId).sendWorkerMessage("dial", {
|
||||
number: aNumber,
|
||||
isEmergency: isEmergencyNumber,
|
||||
isDialEmergency: aIsEmergency
|
||||
}, (function(response) {
|
||||
this.isDialing = false;
|
||||
|
@ -14,20 +14,12 @@ let emulator = (function() {
|
||||
let pendingCmdCount = 0;
|
||||
let originalRunEmulatorCmd = runEmulatorCmd;
|
||||
|
||||
let pendingShellCount = 0;
|
||||
let originalRunEmulatorShell = runEmulatorShell;
|
||||
|
||||
// Overwritten it so people could not call this function directly.
|
||||
runEmulatorCmd = function() {
|
||||
throw "Use emulator.runCmdWithCallback(cmd, callback) instead of runEmulatorCmd";
|
||||
throw "Use emulator.runWithCallback(cmd, callback) instead of runEmulatorCmd";
|
||||
};
|
||||
|
||||
// Overwritten it so people could not call this function directly.
|
||||
runEmulatorShell = function() {
|
||||
throw "Use emulator.runShellCmd(cmd, callback) instead of runEmulatorShell";
|
||||
};
|
||||
|
||||
function runCmd(cmd) {
|
||||
function run(cmd) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
pendingCmdCount++;
|
||||
@ -44,29 +36,14 @@ let emulator = (function() {
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function runCmdWithCallback(cmd, callback) {
|
||||
runCmd(cmd).then(result => {
|
||||
function runWithCallback(cmd, callback) {
|
||||
run(cmd).then(result => {
|
||||
if (callback && typeof callback === "function") {
|
||||
callback(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Promise
|
||||
*/
|
||||
function runShellCmd(aCommands) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
++pendingShellCount;
|
||||
originalRunEmulatorShell(aCommands, function(aResult) {
|
||||
--pendingShellCount;
|
||||
deferred.resolve(aResult);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Promise
|
||||
*/
|
||||
@ -76,16 +53,15 @@ let emulator = (function() {
|
||||
waitFor(function() {
|
||||
deferred.resolve();
|
||||
}, function() {
|
||||
return pendingCmdCount === 0 && pendingShellCount === 0;
|
||||
return pendingCmdCount === 0;
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
return {
|
||||
runCmd: runCmd,
|
||||
runCmdWithCallback: runCmdWithCallback,
|
||||
runShellCmd: runShellCmd,
|
||||
run: run,
|
||||
runWithCallback: runWithCallback,
|
||||
waitFinish: waitFinish
|
||||
};
|
||||
}());
|
||||
@ -147,7 +123,7 @@ let emulator = (function() {
|
||||
|
||||
return Promise.all(hangUpPromises)
|
||||
.then(() => {
|
||||
return emulator.runCmd("gsm clear").then(waitForNoCall);
|
||||
return emulator.run("gsm clear");
|
||||
})
|
||||
.then(waitForNoCall);
|
||||
}
|
||||
@ -385,7 +361,7 @@ let emulator = (function() {
|
||||
* @return A deferred promise.
|
||||
*/
|
||||
function checkEmulatorCallList(expectedCallList) {
|
||||
return emulator.runCmd("gsm list").then(result => {
|
||||
return emulator.run("gsm list").then(result => {
|
||||
log("Call list is now: " + result);
|
||||
for (let i = 0; i < expectedCallList.length; ++i) {
|
||||
is(result[i], expectedCallList[i], "emulator calllist");
|
||||
@ -635,7 +611,7 @@ let emulator = (function() {
|
||||
numberPresentation = numberPresentation || "";
|
||||
name = name || "";
|
||||
namePresentation = namePresentation || "";
|
||||
emulator.runCmd("gsm call " + number + "," + numberPresentation + "," + name +
|
||||
emulator.run("gsm call " + number + "," + numberPresentation + "," + name +
|
||||
"," + namePresentation);
|
||||
return deferred.promise;
|
||||
}
|
||||
@ -658,7 +634,7 @@ let emulator = (function() {
|
||||
checkEventCallState(event, call, "connected");
|
||||
deferred.resolve(call);
|
||||
};
|
||||
emulator.runCmd("gsm accept " + call.id.number);
|
||||
emulator.run("gsm accept " + call.id.number);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
@ -681,7 +657,7 @@ let emulator = (function() {
|
||||
checkEventCallState(event, call, "disconnected");
|
||||
deferred.resolve(call);
|
||||
};
|
||||
emulator.runCmd("gsm cancel " + call.id.number);
|
||||
emulator.run("gsm cancel " + call.id.number);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ function answer() {
|
||||
return(callDuration >= 2000);
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + outNumber);
|
||||
emulator.runWithCallback("gsm accept " + outNumber);
|
||||
}
|
||||
|
||||
function cleanUp(){
|
||||
|
@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js';
|
||||
function muxModem(id) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
emulator.runCmdWithCallback("mux modem " + id, function() {
|
||||
emulator.runWithCallback("mux modem " + id, function() {
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
|
@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js';
|
||||
function muxModem(id) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
emulator.runCmdWithCallback("mux modem " + id, function() {
|
||||
emulator.runWithCallback("mux modem " + id, function() {
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
|
@ -28,7 +28,7 @@ function dial() {
|
||||
is(outgoing.state, "alerting");
|
||||
is(outgoing.emergency, true);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : ringing");
|
||||
answer();
|
||||
@ -49,13 +49,13 @@ function answer() {
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : active");
|
||||
hangUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + number);
|
||||
emulator.runWithCallback("gsm accept " + number);
|
||||
}
|
||||
|
||||
function hangUp() {
|
||||
@ -71,12 +71,12 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm cancel " + number);
|
||||
emulator.runWithCallback("gsm cancel " + number);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -16,7 +16,7 @@ function dial() {
|
||||
is(telephony.calls.length, 0);
|
||||
is(cause, "BadNumberError");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Initial call list: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -4,43 +4,7 @@
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const DEFAULT_ECC_LIST = "112,911";
|
||||
|
||||
function setEccListProperty(list) {
|
||||
log("Set property ril.ecclist: " + list);
|
||||
|
||||
let deferred = Promise.defer();
|
||||
try {
|
||||
emulator.runShellCmd(["setprop","ril.ecclist", list]).then(function() {
|
||||
deferred.resolve(list);
|
||||
});
|
||||
} catch (e) {
|
||||
deferred.reject(e);
|
||||
}
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function getEccListProperty() {
|
||||
log("Get property ril.ecclist.");
|
||||
|
||||
let deferred = Promise.defer();
|
||||
try {
|
||||
emulator.runShellCmd(["getprop","ril.ecclist"]).then(function(aResult) {
|
||||
let list = !aResult.length ? "" : aResult[0];
|
||||
deferred.resolve(list);
|
||||
});
|
||||
} catch (e) {
|
||||
deferred.reject(e);
|
||||
}
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function testEmergencyLabel(number, list) {
|
||||
if (!list) {
|
||||
list = DEFAULT_ECC_LIST;
|
||||
}
|
||||
let index = list.split(",").indexOf(number);
|
||||
let emergency = index != -1;
|
||||
function testEmergencyLabel(number, emergency) {
|
||||
log("= testEmergencyLabel = " + number + " should be " +
|
||||
(emergency ? "emergency" : "normal") + " call");
|
||||
|
||||
@ -59,27 +23,12 @@ function testEmergencyLabel(number, list) {
|
||||
}
|
||||
|
||||
startTest(function() {
|
||||
let origEccList;
|
||||
let eccList;
|
||||
|
||||
getEccListProperty()
|
||||
.then(list => {
|
||||
origEccList = eccList = list;
|
||||
})
|
||||
.then(() => testEmergencyLabel("112", eccList))
|
||||
.then(() => testEmergencyLabel("911", eccList))
|
||||
.then(() => testEmergencyLabel("0912345678", eccList))
|
||||
.then(() => testEmergencyLabel("777", eccList))
|
||||
.then(() => {
|
||||
eccList = "777,119";
|
||||
return setEccListProperty(eccList);
|
||||
})
|
||||
.then(() => testEmergencyLabel("777", eccList))
|
||||
.then(() => testEmergencyLabel("119", eccList))
|
||||
.then(() => testEmergencyLabel("112", eccList))
|
||||
.then(() => setEccListProperty(origEccList))
|
||||
.then(null, error => {
|
||||
ok(false, 'promise rejects during test: ' + error);
|
||||
testEmergencyLabel("112", true)
|
||||
.then(() => testEmergencyLabel("911", true))
|
||||
.then(() => testEmergencyLabel("0912345678", false))
|
||||
.then(() => testEmergencyLabel("777", false))
|
||||
.then(null, () => {
|
||||
ok(false, 'promise rejects during test.');
|
||||
})
|
||||
.then(finish);
|
||||
});
|
||||
|
@ -27,7 +27,7 @@ function dial() {
|
||||
is(outgoingCall, event.call);
|
||||
is(outgoingCall.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : ringing");
|
||||
answer();
|
||||
@ -47,7 +47,7 @@ function answer() {
|
||||
is(outgoingCall.state, "connected");
|
||||
is(outgoingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
|
||||
@ -61,7 +61,7 @@ function answer() {
|
||||
}
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + outNumber);
|
||||
emulator.runWithCallback("gsm accept " + outNumber);
|
||||
}
|
||||
|
||||
// With one connected call already, simulate an incoming call
|
||||
@ -80,14 +80,14 @@ function simulateIncoming() {
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
is(telephony.calls[1], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
is(result[1], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
// Answer incoming call; original outgoing call should be held
|
||||
@ -111,7 +111,7 @@ function answerIncoming() {
|
||||
is(incomingCall, telephony.active);
|
||||
is(outgoingCall.state, "held");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
is(result[1], "inbound from " + inNumber + " : active");
|
||||
@ -143,7 +143,7 @@ function hangUpOutgoing() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(incomingCall.state, "connected");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
hangUpIncoming();
|
||||
@ -174,7 +174,7 @@ function hangUpIncoming() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -27,7 +27,7 @@ function dial() {
|
||||
is(outgoingCall, event.call);
|
||||
is(outgoingCall.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : ringing");
|
||||
answer();
|
||||
@ -47,7 +47,7 @@ function answer() {
|
||||
is(outgoingCall.state, "connected");
|
||||
is(outgoingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
|
||||
@ -61,7 +61,7 @@ function answer() {
|
||||
}
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + outNumber);
|
||||
emulator.runWithCallback("gsm accept " + outNumber);
|
||||
}
|
||||
|
||||
function holdCall() {
|
||||
@ -85,7 +85,7 @@ function holdCall() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
simulateIncoming();
|
||||
@ -110,14 +110,14 @@ function simulateIncoming() {
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
is(telephony.calls[1], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
is(result[1], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
// Answer incoming call; original outgoing call should be held
|
||||
@ -141,7 +141,7 @@ function answerIncoming() {
|
||||
is(incomingCall, telephony.active);
|
||||
is(outgoingCall.state, "held");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
is(result[1], "inbound from " + inNumber + " : active");
|
||||
@ -173,7 +173,7 @@ function hangUpOutgoing() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(incomingCall.state, "connected");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
hangUpIncoming();
|
||||
@ -204,7 +204,7 @@ function hangUpIncoming() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -22,13 +22,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incoming);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + number + " : incoming");
|
||||
answer();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + number);
|
||||
emulator.runWithCallback("gsm call " + number);
|
||||
}
|
||||
|
||||
function answer() {
|
||||
@ -50,7 +50,7 @@ function answer() {
|
||||
|
||||
is(incoming, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + number + " : active");
|
||||
hangUp();
|
||||
@ -79,7 +79,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -28,14 +28,14 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incoming);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + number + " : incoming");
|
||||
answer();
|
||||
});
|
||||
};
|
||||
|
||||
emulator.runCmdWithCallback("gsm call " + number);
|
||||
emulator.runWithCallback("gsm call " + number);
|
||||
}
|
||||
|
||||
function answer() {
|
||||
@ -60,7 +60,7 @@ function answer() {
|
||||
|
||||
is(incoming, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + number + " : active");
|
||||
hangUp();
|
||||
@ -109,7 +109,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -20,13 +20,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
function answerIncoming() {
|
||||
@ -48,7 +48,7 @@ function answerIncoming() {
|
||||
|
||||
is(incomingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
remoteHangUp();
|
||||
@ -70,12 +70,12 @@ function remoteHangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm cancel " + inNumber);
|
||||
emulator.runWithCallback("gsm cancel " + inNumber);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -20,13 +20,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
function answerIncoming() {
|
||||
@ -77,7 +77,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -20,13 +20,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
function answerIncoming() {
|
||||
@ -59,12 +59,12 @@ function remoteHangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm cancel " + inNumber);
|
||||
emulator.runWithCallback("gsm cancel " + inNumber);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -20,13 +20,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
function answerIncoming() {
|
||||
@ -48,7 +48,7 @@ function answerIncoming() {
|
||||
|
||||
is(incomingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
hold();
|
||||
@ -78,7 +78,7 @@ function hold() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
hangUp();
|
||||
@ -107,7 +107,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -21,13 +21,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + number + " : incoming");
|
||||
answer();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + number);
|
||||
emulator.runWithCallback("gsm call " + number);
|
||||
}
|
||||
|
||||
function answer() {
|
||||
@ -49,7 +49,7 @@ function answer() {
|
||||
|
||||
is(incomingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + number + " : active");
|
||||
hold();
|
||||
@ -79,7 +79,7 @@ function hold() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + number + " : held");
|
||||
// Wait on hold for a couple of seconds
|
||||
@ -111,7 +111,7 @@ function resume() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + number + " : active");
|
||||
hangUp();
|
||||
@ -140,7 +140,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -20,13 +20,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
function answerIncoming() {
|
||||
@ -45,7 +45,7 @@ function answerIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
hold();
|
||||
@ -71,7 +71,7 @@ function hold() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
resume();
|
||||
@ -97,7 +97,7 @@ function resume() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
hangUp();
|
||||
@ -122,7 +122,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -22,13 +22,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incoming);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + number + " : incoming");
|
||||
reject();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + number);
|
||||
emulator.runWithCallback("gsm call " + number);
|
||||
}
|
||||
|
||||
function reject() {
|
||||
@ -51,7 +51,7 @@ function reject() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -20,13 +20,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
cancelIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
function cancelIncoming(){
|
||||
@ -42,12 +42,12 @@ function cancelIncoming(){
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm cancel " + inNumber);
|
||||
emulator.runWithCallback("gsm cancel " + inNumber);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -20,13 +20,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
function answerIncoming() {
|
||||
@ -48,7 +48,7 @@ function answerIncoming() {
|
||||
|
||||
is(incomingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
hold();
|
||||
@ -78,7 +78,7 @@ function hold() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
hangUp();
|
||||
@ -100,12 +100,12 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm cancel " + inNumber);
|
||||
emulator.runWithCallback("gsm cancel " + inNumber);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -22,13 +22,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
function answerIncoming() {
|
||||
@ -49,7 +49,7 @@ function answerIncoming() {
|
||||
ok(gotConnecting);
|
||||
is(incomingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
holdCall();
|
||||
@ -80,7 +80,7 @@ function holdCall() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
dial();
|
||||
@ -108,7 +108,7 @@ function dial() {
|
||||
is(outgoingCall, event.call);
|
||||
is(outgoingCall.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
is(result[1], "outbound to " + outNumber + " : ringing");
|
||||
@ -129,14 +129,14 @@ function answerOutgoing() {
|
||||
is(outgoingCall.state, "connected");
|
||||
is(outgoingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
is(result[1], "outbound to " + outNumber + " : active");
|
||||
holdSecondCall();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + outNumber);
|
||||
emulator.runWithCallback("gsm accept " + outNumber);
|
||||
}
|
||||
|
||||
// With one held call and one active, hold the active one; expect the first
|
||||
@ -187,7 +187,7 @@ function verifyCalls() {
|
||||
is(telephony.calls[0], incomingCall);
|
||||
is(telephony.calls[1], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
is(result[1], "outbound to " + outNumber + " : held");
|
||||
@ -218,7 +218,7 @@ function hangUpIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
hangUpOutgoing();
|
||||
@ -249,7 +249,7 @@ function hangUpOutgoing() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -29,13 +29,13 @@ function simulateIncoming() {
|
||||
};
|
||||
|
||||
let rcvdEmulatorCallback = false;
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber, function(result) {
|
||||
emulator.runWithCallback("gsm call " + inNumber, function(result) {
|
||||
rcvdEmulatorCallback = true;
|
||||
});
|
||||
}
|
||||
|
||||
function verifyCallList(){
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
@ -61,7 +61,7 @@ function answerIncoming() {
|
||||
|
||||
is(incomingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
holdCall();
|
||||
@ -92,7 +92,7 @@ function holdCall(){
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
dial();
|
||||
@ -121,7 +121,7 @@ function dial() {
|
||||
is(outgoingCall, event.call);
|
||||
is(outgoingCall.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
is(result[1], "outbound to " + outNumber + " : ringing");
|
||||
@ -150,13 +150,13 @@ function answerOutgoing() {
|
||||
};
|
||||
|
||||
let rcvdEmulatorCallback = false;
|
||||
emulator.runCmdWithCallback("gsm accept " + outNumber, function(result) {
|
||||
emulator.runWithCallback("gsm accept " + outNumber, function(result) {
|
||||
rcvdEmulatorCallback = true;
|
||||
});
|
||||
}
|
||||
|
||||
function checkCallList(){
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
is(result[1], "outbound to " + outNumber + " : active");
|
||||
@ -187,7 +187,7 @@ function hangUpIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
hangUpOutgoing();
|
||||
@ -218,7 +218,7 @@ function hangUpOutgoing() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -27,7 +27,7 @@ function dial() {
|
||||
is(outgoing, event.call);
|
||||
is(outgoing.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : ringing");
|
||||
answer();
|
||||
@ -48,13 +48,13 @@ function answer() {
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : active");
|
||||
hangUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + number);
|
||||
emulator.runWithCallback("gsm accept " + number);
|
||||
}
|
||||
|
||||
function hangUp() {
|
||||
@ -70,12 +70,12 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm cancel " + number);
|
||||
emulator.runWithCallback("gsm cancel " + number);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -46,7 +46,7 @@ function dial() {
|
||||
}
|
||||
|
||||
function checkCallList() {
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
if (((result[0] == "outbound to " + number + " : unknown") ||
|
||||
(result[0] == "outbound to " + number + " : dialing"))) {
|
||||
@ -69,19 +69,19 @@ function answer() {
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list (after 'connected' event) is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : active");
|
||||
hangUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + number);
|
||||
emulator.runWithCallback("gsm accept " + number);
|
||||
}
|
||||
|
||||
function hangUp() {
|
||||
log("Hanging up the outgoing call.");
|
||||
|
||||
emulator.runCmdWithCallback("gsm cancel " + number);
|
||||
emulator.runWithCallback("gsm cancel " + number);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -26,7 +26,7 @@ function dial() {
|
||||
is(outgoingCall, event.call);
|
||||
is(outgoingCall.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : ringing");
|
||||
answer();
|
||||
@ -47,13 +47,13 @@ function answer() {
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
hangUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + outNumber);
|
||||
emulator.runWithCallback("gsm accept " + outNumber);
|
||||
}
|
||||
|
||||
function hangUp() {
|
||||
@ -76,7 +76,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -59,7 +59,7 @@ function remoteAnswer(call) {
|
||||
is(call.state, "connected");
|
||||
deferred.resolve(call);
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + call.id.number);
|
||||
emulator.runWithCallback("gsm accept " + call.id.number);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ function dial() {
|
||||
ok(event.call.error);
|
||||
is(event.call.error.name, "BadNumberError");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Initial call list: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -25,7 +25,7 @@ function dial() {
|
||||
is(outgoing, event.call);
|
||||
is(outgoing.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : ringing");
|
||||
busy();
|
||||
@ -42,13 +42,13 @@ function busy() {
|
||||
is(outgoing, event.call);
|
||||
is(event.call.error.name, "BusyError");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
};
|
||||
|
||||
emulator.runCmdWithCallback("gsm busy " + number);
|
||||
emulator.runWithCallback("gsm busy " + number);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -24,7 +24,7 @@ function dial() {
|
||||
|
||||
outgoing.onalerting = function onalerting(event) {
|
||||
log("Received 'alerting' call event.");
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : ringing");
|
||||
hangUp();
|
||||
@ -54,7 +54,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -26,7 +26,7 @@ function dial() {
|
||||
is(outgoing, event.call);
|
||||
is(outgoing.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : ringing");
|
||||
answer();
|
||||
@ -47,13 +47,13 @@ function answer() {
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : active");
|
||||
hold();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + number);
|
||||
emulator.runWithCallback("gsm accept " + number);
|
||||
}
|
||||
|
||||
function hold() {
|
||||
@ -75,7 +75,7 @@ function hold() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 1);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : held");
|
||||
hangUp();
|
||||
@ -104,7 +104,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -26,7 +26,7 @@ function dial() {
|
||||
is(outgoingCall, event.call);
|
||||
is(outgoingCall.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : ringing");
|
||||
answer();
|
||||
@ -47,13 +47,13 @@ function answer() {
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : active");
|
||||
hold();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + number);
|
||||
emulator.runWithCallback("gsm accept " + number);
|
||||
}
|
||||
|
||||
function hold() {
|
||||
@ -77,7 +77,7 @@ function hold() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : held");
|
||||
// Bug 781604: emulator assertion if outgoing call kept on hold
|
||||
@ -111,7 +111,7 @@ function resume() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : active");
|
||||
hangUp();
|
||||
@ -140,7 +140,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -28,7 +28,7 @@ function dial() {
|
||||
ok(expectedStates.indexOf(event.call.state) != -1);
|
||||
|
||||
if (event.call.state == "alerting") {
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : ringing");
|
||||
answer();
|
||||
@ -49,13 +49,13 @@ function answer() {
|
||||
is(outgoingCall.state, "connected");
|
||||
is(outgoingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
hold();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + outNumber);
|
||||
emulator.runWithCallback("gsm accept " + outNumber);
|
||||
}
|
||||
|
||||
function hold() {
|
||||
@ -74,7 +74,7 @@ function hold() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
resume();
|
||||
@ -100,7 +100,7 @@ function resume() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
hangUp();
|
||||
@ -125,7 +125,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -47,7 +47,7 @@ function dial(number) {
|
||||
is(telephony.calls.length, 0);
|
||||
is(cause, "RadioNotAvailable");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Initial call list: " + result);
|
||||
|
||||
setRadioEnabled(true, cleanUp);
|
||||
|
@ -25,7 +25,7 @@ function dial() {
|
||||
is(outgoing, event.call);
|
||||
is(outgoing.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + number + " : ringing");
|
||||
reject();
|
||||
@ -53,13 +53,13 @@ function reject() {
|
||||
};
|
||||
|
||||
let rcvdEmulatorCallback = false;
|
||||
emulator.runCmdWithCallback("gsm cancel " + number, function(result) {
|
||||
emulator.runWithCallback("gsm cancel " + number, function(result) {
|
||||
rcvdEmulatorCallback = true;
|
||||
});
|
||||
}
|
||||
|
||||
function verifyCallList(){
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
@ -25,7 +25,7 @@ function dial() {
|
||||
is(outgoingCall, event.call);
|
||||
is(outgoingCall.state, "alerting");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : ringing");
|
||||
answer();
|
||||
@ -46,13 +46,13 @@ function answer() {
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
hold();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + outNumber);
|
||||
emulator.runWithCallback("gsm accept " + outNumber);
|
||||
}
|
||||
|
||||
function hold() {
|
||||
@ -75,7 +75,7 @@ function hold() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
hangUp();
|
||||
@ -97,12 +97,12 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm cancel " + outNumber);
|
||||
emulator.runWithCallback("gsm cancel " + outNumber);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
|
@ -20,13 +20,13 @@ function simulateIncoming() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
function answerIncoming() {
|
||||
@ -48,7 +48,7 @@ function answerIncoming() {
|
||||
|
||||
is(incomingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
answerAlreadyConnected();
|
||||
@ -100,7 +100,7 @@ function hold() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
holdAlreadyHeld();
|
||||
@ -176,7 +176,7 @@ function resume() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : active");
|
||||
resumeNonHeld();
|
||||
@ -227,7 +227,7 @@ function hangUp() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
answerDisconnected();
|
||||
});
|
||||
|
@ -29,7 +29,7 @@ function dial() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : ringing");
|
||||
answer();
|
||||
@ -49,7 +49,7 @@ function answer() {
|
||||
is(outgoingCall.state, "connected");
|
||||
is(outgoingCall, telephony.active);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
|
||||
@ -63,7 +63,7 @@ function answer() {
|
||||
}
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm accept " + outNumber);
|
||||
emulator.runWithCallback("gsm accept " + outNumber);
|
||||
}
|
||||
|
||||
function holdCall() {
|
||||
@ -87,7 +87,7 @@ function holdCall() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
simulateIncoming();
|
||||
@ -112,14 +112,14 @@ function simulateIncoming() {
|
||||
is(telephony.calls[0], outgoingCall);
|
||||
is(telephony.calls[1], incomingCall);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
is(result[1], "inbound from " + inNumber + " : incoming");
|
||||
answerIncoming();
|
||||
});
|
||||
};
|
||||
emulator.runCmdWithCallback("gsm call " + inNumber);
|
||||
emulator.runWithCallback("gsm call " + inNumber);
|
||||
}
|
||||
|
||||
// Answer incoming call; original outgoing call should be held
|
||||
@ -145,7 +145,7 @@ function answerIncoming() {
|
||||
is(outgoingCall.state, "held");
|
||||
is(incomingCall.state, "connected");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : held");
|
||||
is(result[1], "inbound from " + inNumber + " : active");
|
||||
@ -198,7 +198,7 @@ function verifySwap() {
|
||||
is(outgoingCall.state, "connected");
|
||||
is(incomingCall.state, "held");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "outbound to " + outNumber + " : active");
|
||||
is(result[1], "inbound from " + inNumber + " : held");
|
||||
@ -230,7 +230,7 @@ function hangUpOutgoing() {
|
||||
is(telephony.calls.length, 1);
|
||||
is(incomingCall.state, "held");
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "inbound from " + inNumber + " : held");
|
||||
hangUpIncoming();
|
||||
@ -261,7 +261,7 @@ function hangUpIncoming() {
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.runCmdWithCallback("gsm list", function(result) {
|
||||
emulator.runWithCallback("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
cleanUp();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user