Bug 1023141 - query ril.ecclist per dial request - part 0 - rename. r=aknow

This commit is contained in:
Hsin-Yi Tsai 2014-06-24 18:36:59 +08:00
parent 1ca1b3fbc5
commit 79fa19386b
36 changed files with 169 additions and 169 deletions

View File

@ -16,10 +16,10 @@ let emulator = (function() {
// Overwritten it so people could not call this function directly.
runEmulatorCmd = function() {
throw "Use emulator.runWithCallback(cmd, callback) instead of runEmulatorCmd";
throw "Use emulator.runCmdWithCallback(cmd, callback) instead of runEmulatorCmd";
};
function run(cmd) {
function runCmd(cmd) {
let deferred = Promise.defer();
pendingCmdCount++;
@ -36,8 +36,8 @@ let emulator = (function() {
return deferred.promise;
}
function runWithCallback(cmd, callback) {
run(cmd).then(result => {
function runCmdWithCallback(cmd, callback) {
runCmd(cmd).then(result => {
if (callback && typeof callback === "function") {
callback(result);
}
@ -60,8 +60,8 @@ let emulator = (function() {
}
return {
run: run,
runWithCallback: runWithCallback,
runCmd: runCmd,
runCmdWithCallback: runCmdWithCallback,
waitFinish: waitFinish
};
}());
@ -123,7 +123,7 @@ let emulator = (function() {
return Promise.all(hangUpPromises)
.then(() => {
return emulator.run("gsm clear");
return emulator.runCmd("gsm clear").then(waitForNoCall);
})
.then(waitForNoCall);
}
@ -361,7 +361,7 @@ let emulator = (function() {
* @return A deferred promise.
*/
function checkEmulatorCallList(expectedCallList) {
return emulator.run("gsm list").then(result => {
return emulator.runCmd("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");
@ -611,7 +611,7 @@ let emulator = (function() {
numberPresentation = numberPresentation || "";
name = name || "";
namePresentation = namePresentation || "";
emulator.run("gsm call " + number + "," + numberPresentation + "," + name +
emulator.runCmd("gsm call " + number + "," + numberPresentation + "," + name +
"," + namePresentation);
return deferred.promise;
}
@ -634,7 +634,7 @@ let emulator = (function() {
checkEventCallState(event, call, "connected");
deferred.resolve(call);
};
emulator.run("gsm accept " + call.id.number);
emulator.runCmd("gsm accept " + call.id.number);
return deferred.promise;
}
@ -657,7 +657,7 @@ let emulator = (function() {
checkEventCallState(event, call, "disconnected");
deferred.resolve(call);
};
emulator.run("gsm cancel " + call.id.number);
emulator.runCmd("gsm cancel " + call.id.number);
return deferred.promise;
}

View File

@ -31,7 +31,7 @@ function answer() {
return(callDuration >= 2000);
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function cleanUp(){

View File

@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js';
function muxModem(id) {
let deferred = Promise.defer();
emulator.runWithCallback("mux modem " + id, function() {
emulator.runCmdWithCallback("mux modem " + id, function() {
deferred.resolve();
});

View File

@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js';
function muxModem(id) {
let deferred = Promise.defer();
emulator.runWithCallback("mux modem " + id, function() {
emulator.runCmdWithCallback("mux modem " + id, function() {
deferred.resolve();
});

View File

@ -28,7 +28,7 @@ function dial() {
is(outgoing.state, "alerting");
is(outgoing.emergency, true);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hangUp() {
@ -71,12 +71,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + number);
emulator.runCmdWithCallback("gsm cancel " + number);
}
function cleanUp() {

View File

@ -16,7 +16,7 @@ function dial() {
is(telephony.calls.length, 0);
is(cause, "BadNumberError");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Initial call list: " + result);
cleanUp();
});

View File

@ -27,7 +27,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
@ -61,7 +61,7 @@ function answer() {
}
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -27,7 +27,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
@ -61,7 +61,7 @@ function answer() {
}
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function holdCall() {
@ -85,7 +85,7 @@ function holdCall() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -22,13 +22,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incoming);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
answer();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function answer() {
@ -50,7 +50,7 @@ function answer() {
is(incoming, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -28,14 +28,14 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incoming);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
answer();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function answer() {
@ -60,7 +60,7 @@ function answer() {
is(incoming, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -77,7 +77,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -59,12 +59,12 @@ function remoteHangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -21,13 +21,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
answer();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function answer() {
@ -49,7 +49,7 @@ function answer() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -45,7 +45,7 @@ function answerIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -22,13 +22,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incoming);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
reject();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function reject() {
@ -51,7 +51,7 @@ function reject() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
cancelIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function cancelIncoming(){
@ -42,12 +42,12 @@ function cancelIncoming(){
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -22,13 +22,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -49,7 +49,7 @@ function answerIncoming() {
ok(gotConnecting);
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -29,13 +29,13 @@ function simulateIncoming() {
};
let rcvdEmulatorCallback = false;
emulator.runWithCallback("gsm call " + inNumber, function(result) {
emulator.runCmdWithCallback("gsm call " + inNumber, function(result) {
rcvdEmulatorCallback = true;
});
}
function verifyCallList(){
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm accept " + outNumber, function(result) {
emulator.runCmdWithCallback("gsm accept " + outNumber, function(result) {
rcvdEmulatorCallback = true;
});
}
function checkCallList(){
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -27,7 +27,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hangUp() {
@ -70,12 +70,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + number);
emulator.runCmdWithCallback("gsm cancel " + number);
}
function cleanUp() {

View File

@ -46,7 +46,7 @@ function dial() {
}
function checkCallList() {
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list (after 'connected' event) is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hangUp() {
log("Hanging up the outgoing call.");
emulator.runWithCallback("gsm cancel " + number);
emulator.runCmdWithCallback("gsm cancel " + number);
}
function cleanUp() {

View File

@ -26,7 +26,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function hangUp() {
@ -76,7 +76,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -59,7 +59,7 @@ function remoteAnswer(call) {
is(call.state, "connected");
deferred.resolve(call);
};
emulator.runWithCallback("gsm accept " + call.id.number);
emulator.runCmdWithCallback("gsm accept " + call.id.number);
return deferred.promise;
}

View File

@ -30,7 +30,7 @@ function dial() {
ok(event.call.error);
is(event.call.error.name, "BadNumberError");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Initial call list: " + result);
cleanUp();
});

View File

@ -25,7 +25,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm busy " + number);
emulator.runCmdWithCallback("gsm busy " + number);
}
function cleanUp() {

View File

@ -24,7 +24,7 @@ function dial() {
outgoing.onalerting = function onalerting(event) {
log("Received 'alerting' call event.");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -26,7 +26,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hold() {
@ -75,7 +75,7 @@ function hold() {
is(telephony.active, null);
is(telephony.calls.length, 1);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -26,7 +26,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hold() {
@ -77,7 +77,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -28,7 +28,7 @@ function dial() {
ok(expectedStates.indexOf(event.call.state) != -1);
if (event.call.state == "alerting") {
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function hold() {
@ -74,7 +74,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -47,7 +47,7 @@ function dial(number) {
is(telephony.calls.length, 0);
is(cause, "RadioNotAvailable");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Initial call list: " + result);
setRadioEnabled(true, cleanUp);

View File

@ -25,7 +25,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm cancel " + number, function(result) {
emulator.runCmdWithCallback("gsm cancel " + number, function(result) {
rcvdEmulatorCallback = true;
});
}
function verifyCallList(){
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -25,7 +25,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function hold() {
@ -75,7 +75,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + outNumber);
emulator.runCmdWithCallback("gsm cancel " + outNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
answerDisconnected();
});

View File

@ -29,7 +29,7 @@ function dial() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
@ -63,7 +63,7 @@ function answer() {
}
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function holdCall() {
@ -87,7 +87,7 @@ function holdCall() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("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.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});