зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset b51678e8e5e8 (bug 1077075)
This commit is contained in:
Родитель
12ff28b3bd
Коммит
ec73e93189
|
@ -520,8 +520,7 @@ let emulator = (function() {
|
||||||
promises.push(promise);
|
promises.push(promise);
|
||||||
}
|
}
|
||||||
|
|
||||||
promise = call.answer();
|
call.answer();
|
||||||
promises.push(promise);
|
|
||||||
|
|
||||||
return Promise.all(promises).then(() => call);
|
return Promise.all(promises).then(() => call);
|
||||||
}
|
}
|
||||||
|
@ -536,16 +535,12 @@ let emulator = (function() {
|
||||||
function hold(call) {
|
function hold(call) {
|
||||||
log("Putting the call on hold.");
|
log("Putting the call on hold.");
|
||||||
|
|
||||||
let promises = [];
|
|
||||||
|
|
||||||
let promise = waitForNamedStateEvent(call, "holding")
|
let promise = waitForNamedStateEvent(call, "holding")
|
||||||
.then(() => waitForNamedStateEvent(call, "held"));
|
.then(() => waitForNamedStateEvent(call, "held"));
|
||||||
promises.push(promise);
|
|
||||||
|
|
||||||
promise = call.hold();
|
call.hold();
|
||||||
promises.push(promise);
|
|
||||||
|
|
||||||
return Promise.all(promises).then(() => call);
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -558,16 +553,12 @@ let emulator = (function() {
|
||||||
function resume(call) {
|
function resume(call) {
|
||||||
log("Resuming the held call.");
|
log("Resuming the held call.");
|
||||||
|
|
||||||
let promises = [];
|
|
||||||
|
|
||||||
let promise = waitForNamedStateEvent(call, "resuming")
|
let promise = waitForNamedStateEvent(call, "resuming")
|
||||||
.then(() => waitForNamedStateEvent(call, "connected"));
|
.then(() => waitForNamedStateEvent(call, "connected"));
|
||||||
promises.push(promise);
|
|
||||||
|
|
||||||
promise = call.resume();
|
call.resume();
|
||||||
promises.push(promise);
|
|
||||||
|
|
||||||
return Promise.all(promises).then(() => call);
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -580,16 +571,12 @@ let emulator = (function() {
|
||||||
function hangUp(call) {
|
function hangUp(call) {
|
||||||
log("Local hanging up the call: " + call.id.number);
|
log("Local hanging up the call: " + call.id.number);
|
||||||
|
|
||||||
let promises = [];
|
|
||||||
|
|
||||||
let promise = waitForNamedStateEvent(call, "disconnecting")
|
let promise = waitForNamedStateEvent(call, "disconnecting")
|
||||||
.then(() => waitForNamedStateEvent(call, "disconnected"));
|
.then(() => waitForNamedStateEvent(call, "disconnected"));
|
||||||
promises.push(promise);
|
|
||||||
|
|
||||||
promise = call.hangUp();
|
call.hangUp();
|
||||||
promises.push(promise);
|
|
||||||
|
|
||||||
return Promise.all(promises).then(() => call);
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,11 +15,9 @@ function incoming() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function connecting() {
|
function connecting() {
|
||||||
let promises = [
|
let promise = gWaitForNamedStateEvent(inCall, "connecting");
|
||||||
gWaitForNamedStateEvent(inCall, "connecting"),
|
inCall.answer();
|
||||||
inCall.answer()
|
return promise;
|
||||||
];
|
|
||||||
return Promise.all(promises).then(() => inCall);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function hangUp() {
|
function hangUp() {
|
||||||
|
|
|
@ -18,13 +18,12 @@ function checkUnexpected(msg, call, event1, event2, actionCallback) {
|
||||||
|
|
||||||
call.addEventListener(event1, error1);
|
call.addEventListener(event1, error1);
|
||||||
call.addEventListener(event2, error2);
|
call.addEventListener(event2, error2);
|
||||||
|
actionCallback();
|
||||||
|
|
||||||
return actionCallback().then(
|
return gDelay(2000).then(() => {
|
||||||
() => ok(false, msg + "should be rejected."),
|
|
||||||
() => gDelay(2000).then(() => {
|
|
||||||
call.removeEventListener(event1, error1);
|
call.removeEventListener(event1, error1);
|
||||||
call.removeEventListener(event2, error2);
|
call.removeEventListener(event2, error2);
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
startTest(function() {
|
startTest(function() {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче