зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1210513 - Loop's direct calls don't cancel properly if you click the hangup button on the toolbar. r=mikedeboer
This commit is contained in:
Родитель
f9f09d33fd
Коммит
6778068f21
|
@ -338,7 +338,10 @@ loop.store = loop.store || {};
|
|||
}
|
||||
|
||||
this._endSession();
|
||||
this.setStoreState({callState: CALL_STATES.FINISHED});
|
||||
this.setStoreState({
|
||||
callState: this._storeState.callState === CALL_STATES.ONGOING ?
|
||||
CALL_STATES.FINISHED : CALL_STATES.CLOSE
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -777,12 +777,22 @@ describe("loop.store.ConversationStore", function () {
|
|||
sinon.assert.calledOnce(wsHangupSpy);
|
||||
});
|
||||
|
||||
it("should set the callState to finished", function() {
|
||||
it("should set the callState to finished for ongoing call state", function() {
|
||||
store.hangupCall(new sharedActions.HangupCall());
|
||||
|
||||
expect(store.getStoreState("callState")).eql(CALL_STATES.FINISHED);
|
||||
});
|
||||
|
||||
it("should set the callState to CLOSE for non-ongoing call state", function() {
|
||||
store.setStoreState({
|
||||
callState: CALL_STATES.CONNECTING
|
||||
});
|
||||
|
||||
store.hangupCall(new sharedActions.HangupCall());
|
||||
|
||||
expect(store.getStoreState("callState")).eql(CALL_STATES.CLOSE);
|
||||
});
|
||||
|
||||
it("should release mozLoop callsData", function() {
|
||||
store.hangupCall(new sharedActions.HangupCall());
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче