2012-08-24 23:20:51 +00:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
2013-04-09 16:02:51 +00:00
|
|
|
MARIONETTE_TIMEOUT = 60000;
|
2013-10-02 06:27:52 +00:00
|
|
|
MARIONETTE_HEAD_JS = 'head.js';
|
2012-08-24 23:20:51 +00:00
|
|
|
|
2014-12-17 15:47:54 +00:00
|
|
|
const outNumber = "5555551111";
|
|
|
|
const outInfo = gOutCallStrPool(outNumber);
|
2015-09-15 18:19:45 +00:00
|
|
|
var outCall;
|
2012-08-24 23:20:51 +00:00
|
|
|
|
2014-12-17 15:47:54 +00:00
|
|
|
const inNumber = "5555552222";
|
|
|
|
const inInfo = gInCallStrPool(inNumber);
|
2015-09-15 18:19:45 +00:00
|
|
|
var inCall;
|
2012-08-24 23:20:51 +00:00
|
|
|
|
2013-10-02 06:27:52 +00:00
|
|
|
startTest(function() {
|
2014-12-17 15:47:54 +00:00
|
|
|
gRemoteDial(inNumber)
|
|
|
|
.then(call => inCall = call)
|
|
|
|
.then(() => gCheckAll(null, [inCall], "", [], [inInfo.incoming]))
|
|
|
|
.then(() => gAnswer(inCall))
|
|
|
|
.then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]))
|
|
|
|
.then(() => gHold(inCall))
|
|
|
|
.then(() => gCheckAll(null, [inCall], "", [], [inInfo.held]))
|
|
|
|
|
|
|
|
// With one call on hold, make outgoing call
|
|
|
|
.then(() => gDial(outNumber))
|
|
|
|
.then(call => outCall = call)
|
|
|
|
.then(() => gCheckAll(outCall, [inCall, outCall], "", [],
|
|
|
|
[inInfo.held, outInfo.ringing]))
|
|
|
|
.then(() => gRemoteAnswer(outCall))
|
|
|
|
.then(() => gCheckAll(outCall, [inCall, outCall], "", [],
|
|
|
|
[inInfo.held, outInfo.active]))
|
|
|
|
|
|
|
|
// Hang-up
|
|
|
|
.then(() => gHangUp(inCall))
|
|
|
|
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
|
|
|
|
.then(() => gHangUp(outCall))
|
|
|
|
.then(() => gCheckAll(null, [], "", [], []))
|
|
|
|
|
|
|
|
.catch(error => ok(false, "Promise reject: " + error))
|
|
|
|
.then(finish);
|
2013-10-02 06:27:52 +00:00
|
|
|
});
|