mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1018051 - Delay 1s in test_outgoing_emergency_in_airplane_mode.js. r=echen
This commit is contained in:
parent
75e34e20fb
commit
8e3266a3c8
@ -55,6 +55,23 @@ let emulator = (function() {
|
||||
* Telephony related helper functions.
|
||||
*/
|
||||
(function() {
|
||||
/**
|
||||
* @return Promise
|
||||
*/
|
||||
function delay(ms) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
let startTime = Date.now();
|
||||
waitFor(function() {
|
||||
deferred.resolve();
|
||||
},function() {
|
||||
let duration = Date.now() - startTime;
|
||||
return (duration >= ms);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Promise
|
||||
*/
|
||||
@ -1016,6 +1033,7 @@ let emulator = (function() {
|
||||
* Public members.
|
||||
*/
|
||||
|
||||
this.gDelay = delay;
|
||||
this.gCheckInitialState = checkInitialState;
|
||||
this.gClearCalls = clearCalls;
|
||||
this.gOutCallStrPool = outCallStrPool;
|
||||
|
@ -34,6 +34,7 @@ startTestWithPermissions(['mobileconnection'], function() {
|
||||
.then(() => gDial("112"))
|
||||
.then(call => { outCall = call; })
|
||||
.then(() => gRemoteAnswer(outCall))
|
||||
.then(() => gDelay(1000)) // See Bug 1018051 for the purpose of the delay.
|
||||
.then(() => gRemoteHangUp(outCall))
|
||||
.then(null, () => {
|
||||
ok(false, "promise rejects during test.");
|
||||
|
Loading…
Reference in New Issue
Block a user