mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1001343 - Part 2: A new testcase. r=aknow
This commit is contained in:
parent
e112631f26
commit
cee2915471
@ -44,6 +44,7 @@ qemu = true
|
||||
[test_outgoing_badNumber.js]
|
||||
[test_outgoing_basic_operations.js]
|
||||
[test_outgoing_busy.js]
|
||||
[test_outgoing_from_stk.js]
|
||||
[test_outgoing_onstatechange.js]
|
||||
[test_outgoing_radio_off.js]
|
||||
[test_outgoing_when_two_calls_on_line.js]
|
||||
|
65
dom/telephony/test/marionette/test_outgoing_from_stk.js
Normal file
65
dom/telephony/test/marionette/test_outgoing_from_stk.js
Normal file
@ -0,0 +1,65 @@
|
||||
/* 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 = "5555552222";
|
||||
const outInfo = gOutCallStrPool(outNumber);
|
||||
let outCall;
|
||||
|
||||
// Basic functions
|
||||
|
||||
function outgoing() {
|
||||
return gDialSTK(outNumber)
|
||||
.then(call => outCall = call)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]));
|
||||
}
|
||||
|
||||
function localHangUp() {
|
||||
return gHangUp(outCall)
|
||||
.then(() => gCheckAll(null, [], "", [], []));
|
||||
}
|
||||
|
||||
function remoteAnswer() {
|
||||
return gRemoteAnswer(outCall)
|
||||
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]));
|
||||
}
|
||||
|
||||
function remoteHangUp() {
|
||||
return gRemoteHangUp(outCall)
|
||||
.then(() => gCheckAll(null, [], "", [], []));
|
||||
}
|
||||
|
||||
// Sub tests
|
||||
|
||||
function testOutgoingLocalHangUp(){
|
||||
log("= testOutgoingLocalHangUp =");
|
||||
return outgoing()
|
||||
.then(() => localHangUp());
|
||||
}
|
||||
|
||||
function testOutgoingRemoteHangUp() {
|
||||
log("= testOutgoingRemoteHangUp =");
|
||||
return outgoing()
|
||||
.then(() => remoteHangUp());
|
||||
}
|
||||
|
||||
function testOutgoingRemoteAnswerRemoteHangUp() {
|
||||
log("= testOutgoingRemoreAnswerRemoteHangUp =");
|
||||
return outgoing()
|
||||
.then(() => remoteAnswer())
|
||||
.then(() => remoteHangUp());
|
||||
}
|
||||
|
||||
// Main test
|
||||
|
||||
startTest(function() {
|
||||
Promise.resolve()
|
||||
.then(() => testOutgoingLocalHangUp())
|
||||
.then(() => testOutgoingRemoteHangUp())
|
||||
.then(() => testOutgoingRemoteAnswerRemoteHangUp())
|
||||
|
||||
.catch(error => ok(false, "Promise reject: " + error))
|
||||
.then(finish);
|
||||
});
|
Loading…
Reference in New Issue
Block a user