B2G/gecko/dom/telephony/test/marionette/test_outgoing_already_held.js
// With one call on hold, make outgoing call
With one call on hold, make outgoing call
With one call on hold make outgoing call
function dial() {
  log("Making an outgoing call (while have one call already held).");
  outgoingCall = telephony.dial(outNumber);
  ok(outgoingCall);
  is(outgoingCall.number, outNumber);
  is(outgoingCall.state, "dialing");
  is(outgoingCall, telephony.active);
  is(telephony.calls.length, 2);
  is(telephony.calls[0], incomingCall);
  is(telephony.calls[1], outgoingCall);
  outgoingCall.onalerting = function onalerting(event) {
    log("Received 'onalerting' call event.");
    is(outgoingCall, event.call);
    is(outgoingCall.state, "alerting");
    runEmulatorCmd("gsm list", function(result) {
      log("Call list is now: " + result);
      is(result[0], "inbound from " + inNumber + " : held");
      is(result[1], "outbound to  " + outNumber + " : ringing");
      is(result[2], "OK");
      answerOutgoing();
    });
  };
}
function dial ( ) { log ( "Making an outgoing call (while have one call already held)." ) ; outgoingCall = telephony . dial ( outNumber ) ; ok ( outgoingCall ) ; is ( outgoingCall . number , outNumber ) ; is ( outgoingCall . state , "dialing" ) ; is ( outgoingCall , telephony . active ) ; is ( telephony . calls . length , 2 ) ; is ( telephony . calls [ 0 ] , incomingCall ) ; is ( telephony . calls [ 1 ] , outgoingCall ) ; outgoingCall . onalerting = function onalerting ( event ) { log ( "Received 'onalerting' call event." ) ; is ( outgoingCall , event . call ) ; is ( outgoingCall . state , "alerting" ) ; runEmulatorCmd ( "gsm list" , function ( result ) { log ( "Call list is now: " + result ) ; is ( result [ 0 ] , "inbound from " + inNumber + " : held" ) ; is ( result [ 1 ] , "outbound to  " + outNumber + " : ringing" ) ; is ( result [ 2 ] , "OK" ) ; answerOutgoing ( ) ; } ) ; } ; }
With one call on hold, make outgoing call
With one call on hold make outgoing call