зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1100200 - Part 4: Merge test cases into test_outgoing_basic_operations.js. r=hsinyi
This commit is contained in:
Родитель
b264cd0a9d
Коммит
79380f89c8
|
@ -38,22 +38,16 @@ qemu = true
|
|||
[test_mmi_unlock_puk.js]
|
||||
[test_multiple_hold.js]
|
||||
[test_outgoing_already_held.js]
|
||||
[test_outgoing_answer_hangup.js]
|
||||
[test_outgoing_answer_hangup_oncallschanged.js]
|
||||
[test_outgoing_answer_local_hangup.js]
|
||||
[test_outgoing_answer_radio_off.js]
|
||||
[test_outgoing_auto_hold.js]
|
||||
[test_outgoing_badNumber.js]
|
||||
[test_outgoing_basic_operations.js]
|
||||
[test_outgoing_busy.js]
|
||||
[test_outgoing_emergency_in_airplane_mode.js]
|
||||
[test_outgoing_error_state.js]
|
||||
[test_outgoing_hangup_alerting.js]
|
||||
[test_outgoing_hangup_held.js]
|
||||
[test_outgoing_hold_resume.js]
|
||||
[test_outgoing_onstatechange.js]
|
||||
[test_outgoing_radio_off.js]
|
||||
[test_outgoing_reject.js]
|
||||
[test_outgoing_remote_hangup_held.js]
|
||||
[test_outgoing_when_two_calls_on_line.js]
|
||||
[test_ready.js]
|
||||
[test_redundant_operations.js]
|
||||
|
|
|
@ -19,16 +19,6 @@ function answer() {
|
|||
.then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]));
|
||||
}
|
||||
|
||||
function hangUp() {
|
||||
return gHangUp(inCall)
|
||||
.then(() => gCheckAll(null, [], "", [], []));
|
||||
}
|
||||
|
||||
function remoteHangUp() {
|
||||
return gRemoteHangUp(inCall)
|
||||
.then(() => gCheckAll(null, [], "", [], []));
|
||||
}
|
||||
|
||||
function hold() {
|
||||
return gHold(inCall)
|
||||
.then(() => gCheckAll(null, [inCall], "", [], [inInfo.held]));
|
||||
|
@ -39,6 +29,16 @@ function resume() {
|
|||
.then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]));
|
||||
}
|
||||
|
||||
function hangUp() {
|
||||
return gHangUp(inCall)
|
||||
.then(() => gCheckAll(null, [], "", [], []));
|
||||
}
|
||||
|
||||
function remoteHangUp() {
|
||||
return gRemoteHangUp(inCall)
|
||||
.then(() => gCheckAll(null, [], "", [], []));
|
||||
}
|
||||
|
||||
// Test cases.
|
||||
|
||||
function testIncomingReject() {
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const outNumber = "5555551111";
|
||||
const outInfo = gOutCallStrPool(outNumber);
|
||||
let outCall;
|
||||
|
||||
startTest(function() {
|
||||
gDial(outNumber)
|
||||
.then(call => outCall = call)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
|
||||
.then(() => gRemoteAnswer(outCall))
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
|
||||
|
||||
// Hang-up
|
||||
.then(() => gRemoteHangUp(outCall))
|
||||
.then(() => gCheckAll(null, [], "", [], []))
|
||||
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.then(finish);
|
||||
});
|
|
@ -1,24 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const outNumber = "5555551111";
|
||||
const outInfo = gOutCallStrPool(outNumber);
|
||||
let outCall;
|
||||
|
||||
startTest(function() {
|
||||
gDial(outNumber)
|
||||
.then(call => outCall = call)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
|
||||
.then(() => gRemoteAnswer(outCall))
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
|
||||
|
||||
// Hang-up
|
||||
.then(() => gHangUp(outCall))
|
||||
.then(() => gCheckAll(null, [], "", [], []))
|
||||
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.then(finish);
|
||||
});
|
|
@ -0,0 +1,117 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 90000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const outNumber = "5555551111";
|
||||
const outInfo = gOutCallStrPool(outNumber);
|
||||
let outCall;
|
||||
|
||||
function outgoing() {
|
||||
return gDial(outNumber)
|
||||
.then(call => outCall = call)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]));
|
||||
}
|
||||
|
||||
function answer() {
|
||||
return gRemoteAnswer(outCall)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
|
||||
}
|
||||
|
||||
function hangUp() {
|
||||
return gHangUp(outCall)
|
||||
.then(() => gCheckAll(null, [], "", [], []));
|
||||
}
|
||||
|
||||
function remoteHangUp() {
|
||||
return gRemoteHangUp(outCall)
|
||||
.then(() => gCheckAll(null, [], "", [], []));
|
||||
}
|
||||
|
||||
function hold() {
|
||||
return gHold(outCall)
|
||||
.then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]));
|
||||
}
|
||||
|
||||
function resume() {
|
||||
return gResume(outCall)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
|
||||
}
|
||||
|
||||
// Test cases.
|
||||
|
||||
function testOutgoingReject() {
|
||||
log("= testOutgoingReject =");
|
||||
return outgoing()
|
||||
.then(() => remoteHangUp());
|
||||
}
|
||||
|
||||
function testOutgoingCancel() {
|
||||
log("= testOutgoingCancel =");
|
||||
return outgoing()
|
||||
.then(() => hangUp());
|
||||
}
|
||||
|
||||
function testOutgoingAnswerHangUp() {
|
||||
log("= testOutgoingAnswerHangUp =");
|
||||
return outgoing()
|
||||
.then(() => answer())
|
||||
.then(() => hangUp());
|
||||
}
|
||||
|
||||
function testOutgoingAnswerRemoteHangUp() {
|
||||
log("= testOutgoingAnswerRemoteHangUp =");
|
||||
return outgoing()
|
||||
.then(() => answer())
|
||||
.then(() => remoteHangUp());
|
||||
}
|
||||
|
||||
function testOutgoingAnswerHoldHangUp() {
|
||||
log("= testOutgoingAnswerHoldHangUp =");
|
||||
return outgoing()
|
||||
.then(() => answer())
|
||||
.then(() => hold())
|
||||
.then(() => hangUp());
|
||||
}
|
||||
|
||||
function testOutgoingAnswerHoldRemoteHangUp() {
|
||||
log("= testOutgoingAnswerHoldRemoteHangUp =");
|
||||
return outgoing()
|
||||
.then(() => answer())
|
||||
.then(() => hold())
|
||||
.then(() => remoteHangUp());
|
||||
}
|
||||
|
||||
function testOutgoingAnswerHoldResumeHangUp() {
|
||||
log("= testOutgoingAnswerHoldResumeHangUp =");
|
||||
return outgoing()
|
||||
.then(() => answer())
|
||||
.then(() => hold())
|
||||
.then(() => resume())
|
||||
.then(() => hangUp());
|
||||
}
|
||||
|
||||
function testOutgoingAnswerHoldResumeRemoteHangUp() {
|
||||
log("= testOutgoingAnswerHoldResumeRemoteHangUp =");
|
||||
return outgoing()
|
||||
.then(() => answer())
|
||||
.then(() => hold())
|
||||
.then(() => resume())
|
||||
.then(() => remoteHangUp());
|
||||
}
|
||||
|
||||
startTest(function() {
|
||||
Promise.resolve()
|
||||
.then(() => testOutgoingReject())
|
||||
.then(() => testOutgoingCancel())
|
||||
.then(() => testOutgoingAnswerHangUp())
|
||||
.then(() => testOutgoingAnswerRemoteHangUp())
|
||||
.then(() => testOutgoingAnswerHoldHangUp())
|
||||
.then(() => testOutgoingAnswerHoldRemoteHangUp())
|
||||
.then(() => testOutgoingAnswerHoldResumeHangUp())
|
||||
.then(() => testOutgoingAnswerHoldResumeRemoteHangUp())
|
||||
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.then(finish);
|
||||
});
|
|
@ -1,22 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const outNumber = "5555551111";
|
||||
const outInfo = gOutCallStrPool(outNumber);
|
||||
let outCall;
|
||||
|
||||
startTest(function() {
|
||||
gDial(outNumber)
|
||||
.then(call => outCall = call)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
|
||||
|
||||
// Hang-up
|
||||
.then(() => gRemoteHangUp(outCall))
|
||||
.then(() => gCheckAll(null, [], "", [], []))
|
||||
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.then(finish);
|
||||
});
|
|
@ -1,26 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const outNumber = "5555551111";
|
||||
const outInfo = gOutCallStrPool(outNumber);
|
||||
let outCall;
|
||||
|
||||
startTest(function() {
|
||||
gDial(outNumber)
|
||||
.then(call => outCall = call)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
|
||||
.then(() => gRemoteAnswer(outCall))
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
|
||||
.then(() => gHold(outCall))
|
||||
.then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]))
|
||||
|
||||
// Hang-up
|
||||
.then(() => gHangUp(outCall))
|
||||
.then(() => gCheckAll(null, [], "", [], []))
|
||||
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.then(finish);
|
||||
});
|
|
@ -1,28 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const outNumber = "5555551111";
|
||||
const outInfo = gOutCallStrPool(outNumber);
|
||||
let outCall;
|
||||
|
||||
startTest(function() {
|
||||
gDial(outNumber)
|
||||
.then(call => outCall = call)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
|
||||
.then(() => gRemoteAnswer(outCall))
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
|
||||
.then(() => gHold(outCall))
|
||||
.then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]))
|
||||
.then(() => gResume(outCall))
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
|
||||
|
||||
// Hang-up
|
||||
.then(() => gRemoteHangUp(outCall))
|
||||
.then(() => gCheckAll(null, [], "", [], []))
|
||||
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.then(finish);
|
||||
});
|
|
@ -1,22 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const outNumber = "5555551111";
|
||||
const outInfo = gOutCallStrPool(outNumber);
|
||||
let outCall;
|
||||
|
||||
startTest(function() {
|
||||
gDial(outNumber)
|
||||
.then(call => outCall = call)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
|
||||
|
||||
// Hang-up
|
||||
.then(() => gRemoteHangUp(outCall))
|
||||
.then(() => gCheckAll(null, [], "", [], []))
|
||||
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.then(finish);
|
||||
});
|
|
@ -1,26 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const outNumber = "5555551111";
|
||||
const outInfo = gOutCallStrPool(outNumber);
|
||||
let outCall;
|
||||
|
||||
startTest(function() {
|
||||
gDial(outNumber)
|
||||
.then(call => outCall = call)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
|
||||
.then(() => gRemoteAnswer(outCall))
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
|
||||
.then(() => gHold(outCall))
|
||||
.then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]))
|
||||
|
||||
// Hang-up
|
||||
.then(() => gRemoteHangUp(outCall))
|
||||
.then(() => gCheckAll(null, [], "", [], []))
|
||||
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.then(finish);
|
||||
});
|
Загрузка…
Ссылка в новой задаче