B2G/gecko/dom/telephony/test/marionette/test_outgoing_already_held.js
// Hang-up the original incoming call, which is now held
Hang-up the original incoming call, which is now held
Hang - up the original incoming call which is now held
function hangUpIncoming() {
  log("Hanging up the original incoming (now held) call.");
  let gotDisconnecting = false;
  incomingCall.ondisconnecting = function ondisconnectingIn(event) {
    log("Received 'disconnecting' call event for original (incoming) call.");
    is(incomingCall, event.call);
    is(incomingCall.state, "disconnecting");
    gotDisconnecting = true;
  };
  incomingCall.ondisconnected = function ondisconnectedIn(event) {
    log("Received 'disconnected' call event for original (incoming) call.");
    is(incomingCall, event.call);
    is(incomingCall.state, "disconnected");
    ok(gotDisconnecting);
    is(telephony.active, outgoingCall);
    is(telephony.calls.length, 1);
    is(telephony.calls[0], outgoingCall);
    runEmulatorCmd("gsm list", function(result) {
      log("Call list is now: " + result);
      is(result[0], "outbound to  " + outNumber + " : active");
      is(result[1], "OK");
      hangUpOutgoing();
    });
  };
  incomingCall.hangUp();
}
function hangUpIncoming ( ) { log ( "Hanging up the original incoming (now held) call." ) ; let gotDisconnecting = false ; incomingCall . ondisconnecting = function ondisconnectingIn ( event ) { log ( "Received 'disconnecting' call event for original (incoming) call." ) ; is ( incomingCall , event . call ) ; is ( incomingCall . state , "disconnecting" ) ; gotDisconnecting = true ; } ; incomingCall . ondisconnected = function ondisconnectedIn ( event ) { log ( "Received 'disconnected' call event for original (incoming) call." ) ; is ( incomingCall , event . call ) ; is ( incomingCall . state , "disconnected" ) ; ok ( gotDisconnecting ) ; is ( telephony . active , outgoingCall ) ; is ( telephony . calls . length , 1 ) ; is ( telephony . calls [ 0 ] , outgoingCall ) ; runEmulatorCmd ( "gsm list" , function ( result ) { log ( "Call list is now: " + result ) ; is ( result [ 0 ] , "outbound to  " + outNumber + " : active" ) ; is ( result [ 1 ] , "OK" ) ; hangUpOutgoing ( ) ; } ) ; } ; incomingCall . hangUp ( ) ; }
Hang-up the original incoming call, which is now held
Hang - up the original incoming call which is now held
// Now back to one call