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:
Mark Banner 2015-10-02 14:24:09 +01:00
Родитель f9f09d33fd
Коммит 6778068f21
2 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -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());