Bug 1084228 Replace 'callId' with 'windowId' in a Loop conversation window so that it represents what it is and is distinct from the real 'callId'. r=mikedeboer a=loop-only
authorMark Banner <standard8@mozilla.com>
Wed, 29 Oct 2014 14:21:27 +0000
changeset 233780 72bcb9582e285928aaaf33369b96aa56339a77fc
parent 233779 88c62ec930b790553b611e33805d0d02f5583101
child 233781 b74d6c49038dfeeb3234aad6f9dedb353290c974
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, loop-only
bugs1084228
milestone35.0a2
Bug 1084228 Replace 'callId' with 'windowId' in a Loop conversation window so that it represents what it is and is distinct from the real 'callId'. r=mikedeboer a=loop-only
browser/components/loop/LoopCalls.jsm
browser/components/loop/MozLoopAPI.jsm
browser/components/loop/content/js/conversation.js
browser/components/loop/content/js/conversation.jsx
browser/components/loop/content/shared/js/actions.js
browser/components/loop/content/shared/js/conversationStore.js
browser/components/loop/content/shared/js/models.js
browser/components/loop/test/desktop-local/conversation_test.js
browser/components/loop/test/shared/conversationStore_test.js
browser/components/loop/test/shared/dispatcher_test.js
--- a/browser/components/loop/LoopCalls.jsm
+++ b/browser/components/loop/LoopCalls.jsm
@@ -245,16 +245,18 @@ let LoopCallsInternal = {
 
   _processCalls: function(response, sessionType) {
     try {
       let respData = JSON.parse(response.body);
       if (respData.calls && Array.isArray(respData.calls)) {
         respData.calls.forEach((callData) => {
           if (!this.callsData.inUse) {
             callData.sessionType = sessionType;
+            // XXX Bug 1090209 will transiton into a better window id.
+            callData.windowId = callData.callId;
             this._startCall(callData, "incoming");
           } else {
             this._returnBusy(callData);
           }
         });
       } else {
         MozLoopService.logwarn("Error: missing calls[] in response");
       }
@@ -272,34 +274,34 @@ let LoopCallsInternal = {
    */
   _startCall: function(callData, conversationType) {
     this.callsData.inUse = true;
     this.callsData.data = callData;
     MozLoopService.openChatWindow(
       null,
       // No title, let the page set that, to avoid flickering.
       "",
-      "about:loopconversation#" + conversationType + "/" + callData.callId);
+      "about:loopconversation#" + conversationType + "/" + callData.windowId);
   },
 
   /**
    * Starts a direct call to the contact addresses.
    *
    * @param {Object} contact The contact to call
    * @param {String} callType The type of call, e.g. "audio-video" or "audio-only"
    * @return true if the call is opened, false if it is not opened (i.e. busy)
    */
   startDirectCall: function(contact, callType) {
     if (this.callsData.inUse)
       return false;
 
     var callData = {
       contact: contact,
       callType: callType,
-      callId: Math.floor((Math.random() * 10))
+      windowId: Math.floor((Math.random() * 100000000))
     };
 
     this._startCall(callData, "outgoing");
     return true;
   },
 
    /**
    * Open call progress websocket and terminate with a reason of busy
@@ -333,43 +335,43 @@ this.LoopCalls = {
    *
    * @param {String} version The version information from the server.
    */
   onNotification: function(version, channelID) {
     LoopCallsInternal.onNotification(version, channelID);
   },
 
   /**
-   * Returns the callData for a specific loopCallId
+   * Returns the callData for a specific conversation window id.
    *
    * The data was retrieved from the LoopServer via a GET/calls/<version> request
    * triggered by an incoming message from the LoopPushServer.
    *
-   * @param {int} loopCallId
+   * @param {Number} conversationWindowId
    * @return {callData} The callData or undefined if error.
    */
-  getCallData: function(loopCallId) {
+  getCallData: function(conversationWindowId) {
     if (LoopCallsInternal.callsData.data &&
-        LoopCallsInternal.callsData.data.callId == loopCallId) {
+        LoopCallsInternal.callsData.data.windowId == conversationWindowId) {
       return LoopCallsInternal.callsData.data;
     } else {
       return undefined;
     }
   },
 
   /**
-   * Releases the callData for a specific loopCallId
+   * Releases the callData for a specific conversation window id.
    *
    * The result of this call will be a free call session slot.
    *
-   * @param {int} loopCallId
+   * @param {Number} conversationWindowId
    */
-  releaseCallData: function(loopCallId) {
+  releaseCallData: function(conversationWindowId) {
     if (LoopCallsInternal.callsData.data &&
-        LoopCallsInternal.callsData.data.callId == loopCallId) {
+        LoopCallsInternal.callsData.data.windowId == conversationWindowId) {
       LoopCallsInternal.callsData.data = undefined;
       LoopCallsInternal.callsData.inUse = false;
     }
   },
 
     /**
      * Starts a direct call to the contact addresses.
      *
--- a/browser/components/loop/MozLoopAPI.jsm
+++ b/browser/components/loop/MozLoopAPI.jsm
@@ -191,44 +191,44 @@ function injectLoopAPI(targetWindow) {
     locale: {
       enumerable: true,
       get: function() {
         return MozLoopService.locale;
       }
     },
 
     /**
-     * Returns the callData for a specific callDataId
+     * Returns the callData for a specific conversation window id.
      *
      * The data was retrieved from the LoopServer via a GET/calls/<version> request
      * triggered by an incoming message from the LoopPushServer.
      *
-     * @param {int} loopCallId
+     * @param {Number} conversationWindowId
      * @returns {callData} The callData or undefined if error.
      */
     getCallData: {
       enumerable: true,
       writable: true,
-      value: function(loopCallId) {
-        return Cu.cloneInto(LoopCalls.getCallData(loopCallId), targetWindow);
+      value: function(conversationWindowId) {
+        return Cu.cloneInto(LoopCalls.getCallData(conversationWindowId), targetWindow);
       }
     },
 
     /**
-     * Releases the callData for a specific loopCallId
+     * Releases the callData for a specific conversation window id.
      *
      * The result of this call will be a free call session slot.
      *
-     * @param {int} loopCallId
+     * @param {Number} conversationWindowId
      */
     releaseCallData: {
       enumerable: true,
       writable: true,
-      value: function(loopCallId) {
-        LoopCalls.releaseCallData(loopCallId);
+      value: function(conversationWindowId) {
+        LoopCalls.releaseCallData(conversationWindowId);
       }
     },
 
     /**
      * Returns the contacts API.
      *
      * @returns {Object} The contacts API object
      */
--- a/browser/components/loop/content/js/conversation.js
+++ b/browser/components/loop/content/js/conversation.js
@@ -347,17 +347,17 @@ loop.conversation = (function(mozL10n) {
     },
 
     /**
      * Incoming call route.
      */
     setupIncomingCall: function() {
       navigator.mozLoop.startAlerting();
 
-      var callData = navigator.mozLoop.getCallData(this.props.conversation.get("callId"));
+      var callData = navigator.mozLoop.getCallData(this.props.conversation.get("windowId"));
       if (!callData) {
         // XXX Not the ideal response, but bug 1047410 will be replacing
         // this by better "call failed" UI.
         console.error("Failed to get the call data");
         return;
       }
       this.props.conversation.setIncomingSessionData(callData);
       this._setupWebSocket();
@@ -369,17 +369,17 @@ loop.conversation = (function(mozL10n) {
     accepted: function() {
       this.setState({callStatus: "connected"});
     },
 
     /**
      * Moves the call to the end state
      */
     endCall: function() {
-      navigator.mozLoop.releaseCallData(this.props.conversation.get("callId"));
+      navigator.mozLoop.releaseCallData(this.props.conversation.get("windowId"));
       this.setState({callStatus: "end"});
     },
 
     /**
      * Used to set up the web socket connection and navigate to the
      * call view if appropriate.
      */
     _setupWebSocket: function() {
@@ -470,17 +470,17 @@ loop.conversation = (function(mozL10n) {
       this.props.conversation.accepted();
     },
 
     /**
      * Declines a call and handles closing of the window.
      */
     _declineCall: function() {
       this._websocket.decline();
-      navigator.mozLoop.releaseCallData(this.props.conversation.get("callId"));
+      navigator.mozLoop.releaseCallData(this.props.conversation.get("windowId"));
       this._websocket.close();
       // Having a timeout here lets the logging for the websocket complete and be
       // displayed on the console if both are on.
       setTimeout(this.closeWindow, 0);
     },
 
     /**
      * Declines an incoming call.
@@ -615,51 +615,51 @@ loop.conversation = (function(mozL10n) {
 
     // XXX Old class creation for the incoming conversation view, whilst
     // we transition across (bug 1072323).
     var conversation = new sharedModels.ConversationModel(
       {},                // Model attributes
       {sdk: window.OT}   // Model dependencies
     );
 
-    // Obtain the callId and pass it through
+    // Obtain the windowId and pass it through
     var helper = new loop.shared.utils.Helper();
     var locationHash = helper.locationData().hash;
-    var callId;
+    var windowId;
     var outgoing;
     var localRoomStore;
 
     // XXX removeMe, along with noisy comment at the beginning of
     // conversation_test.js "when locationHash begins with #room".
     if (navigator.mozLoop.getLoopBoolPref("test.alwaysUseRooms")) {
       locationHash = "#room/32";
     }
 
     var hash = locationHash.match(/#incoming\/(.*)/);
     if (hash) {
-      callId = hash[1];
+      windowId = hash[1];
       outgoing = false;
     } else if (hash = locationHash.match(/#room\/(.*)/)) {
       localRoomStore = new loop.store.LocalRoomStore({
         dispatcher: dispatcher,
         mozLoop: navigator.mozLoop
       });
     } else {
       hash = locationHash.match(/#outgoing\/(.*)/);
       if (hash) {
-        callId = hash[1];
+        windowId = hash[1];
         outgoing = true;
       }
     }
 
-    conversation.set({callId: callId});
+    conversation.set({windowId: windowId});
 
     window.addEventListener("unload", function(event) {
       // Handle direct close of dialog box via [x] control.
-      navigator.mozLoop.releaseCallData(callId);
+      navigator.mozLoop.releaseCallData(windowId);
     });
 
     React.renderComponent(AppControllerView({
       localRoomStore: localRoomStore, 
       store: conversationStore, 
       client: client, 
       conversation: conversation, 
       dispatcher: dispatcher, 
@@ -668,17 +668,17 @@ loop.conversation = (function(mozL10n) {
 
    if (localRoomStore) {
       dispatcher.dispatch(
         new sharedActions.SetupEmptyRoom({localRoomId: hash[1]}));
       return;
     }
 
     dispatcher.dispatch(new loop.shared.actions.GatherCallData({
-      callId: callId,
+      windowId: windowId,
       outgoing: outgoing
     }));
   }
 
   return {
     AppControllerView: AppControllerView,
     IncomingConversationView: IncomingConversationView,
     IncomingCallView: IncomingCallView,
--- a/browser/components/loop/content/js/conversation.jsx
+++ b/browser/components/loop/content/js/conversation.jsx
@@ -347,17 +347,17 @@ loop.conversation = (function(mozL10n) {
     },
 
     /**
      * Incoming call route.
      */
     setupIncomingCall: function() {
       navigator.mozLoop.startAlerting();
 
-      var callData = navigator.mozLoop.getCallData(this.props.conversation.get("callId"));
+      var callData = navigator.mozLoop.getCallData(this.props.conversation.get("windowId"));
       if (!callData) {
         // XXX Not the ideal response, but bug 1047410 will be replacing
         // this by better "call failed" UI.
         console.error("Failed to get the call data");
         return;
       }
       this.props.conversation.setIncomingSessionData(callData);
       this._setupWebSocket();
@@ -369,17 +369,17 @@ loop.conversation = (function(mozL10n) {
     accepted: function() {
       this.setState({callStatus: "connected"});
     },
 
     /**
      * Moves the call to the end state
      */
     endCall: function() {
-      navigator.mozLoop.releaseCallData(this.props.conversation.get("callId"));
+      navigator.mozLoop.releaseCallData(this.props.conversation.get("windowId"));
       this.setState({callStatus: "end"});
     },
 
     /**
      * Used to set up the web socket connection and navigate to the
      * call view if appropriate.
      */
     _setupWebSocket: function() {
@@ -470,17 +470,17 @@ loop.conversation = (function(mozL10n) {
       this.props.conversation.accepted();
     },
 
     /**
      * Declines a call and handles closing of the window.
      */
     _declineCall: function() {
       this._websocket.decline();
-      navigator.mozLoop.releaseCallData(this.props.conversation.get("callId"));
+      navigator.mozLoop.releaseCallData(this.props.conversation.get("windowId"));
       this._websocket.close();
       // Having a timeout here lets the logging for the websocket complete and be
       // displayed on the console if both are on.
       setTimeout(this.closeWindow, 0);
     },
 
     /**
      * Declines an incoming call.
@@ -615,51 +615,51 @@ loop.conversation = (function(mozL10n) {
 
     // XXX Old class creation for the incoming conversation view, whilst
     // we transition across (bug 1072323).
     var conversation = new sharedModels.ConversationModel(
       {},                // Model attributes
       {sdk: window.OT}   // Model dependencies
     );
 
-    // Obtain the callId and pass it through
+    // Obtain the windowId and pass it through
     var helper = new loop.shared.utils.Helper();
     var locationHash = helper.locationData().hash;
-    var callId;
+    var windowId;
     var outgoing;
     var localRoomStore;
 
     // XXX removeMe, along with noisy comment at the beginning of
     // conversation_test.js "when locationHash begins with #room".
     if (navigator.mozLoop.getLoopBoolPref("test.alwaysUseRooms")) {
       locationHash = "#room/32";
     }
 
     var hash = locationHash.match(/#incoming\/(.*)/);
     if (hash) {
-      callId = hash[1];
+      windowId = hash[1];
       outgoing = false;
     } else if (hash = locationHash.match(/#room\/(.*)/)) {
       localRoomStore = new loop.store.LocalRoomStore({
         dispatcher: dispatcher,
         mozLoop: navigator.mozLoop
       });
     } else {
       hash = locationHash.match(/#outgoing\/(.*)/);
       if (hash) {
-        callId = hash[1];
+        windowId = hash[1];
         outgoing = true;
       }
     }
 
-    conversation.set({callId: callId});
+    conversation.set({windowId: windowId});
 
     window.addEventListener("unload", function(event) {
       // Handle direct close of dialog box via [x] control.
-      navigator.mozLoop.releaseCallData(callId);
+      navigator.mozLoop.releaseCallData(windowId);
     });
 
     React.renderComponent(<AppControllerView
       localRoomStore={localRoomStore}
       store={conversationStore}
       client={client}
       conversation={conversation}
       dispatcher={dispatcher}
@@ -668,17 +668,17 @@ loop.conversation = (function(mozL10n) {
 
    if (localRoomStore) {
       dispatcher.dispatch(
         new sharedActions.SetupEmptyRoom({localRoomId: hash[1]}));
       return;
     }
 
     dispatcher.dispatch(new loop.shared.actions.GatherCallData({
-      callId: callId,
+      windowId: windowId,
       outgoing: outgoing
     }));
   }
 
   return {
     AppControllerView: AppControllerView,
     IncomingConversationView: IncomingConversationView,
     IncomingCallView: IncomingCallView,
--- a/browser/components/loop/content/shared/js/actions.js
+++ b/browser/components/loop/content/shared/js/actions.js
@@ -37,17 +37,17 @@ loop.shared.actions = (function() {
     FetchEmailLink: Action.define("fetchEmailLink", {
     }),
 
     /**
      * Used to trigger gathering of initial call data.
      */
     GatherCallData: Action.define("gatherCallData", {
       // Specify the callId for an incoming call.
-      callId: [String, null],
+      windowId: [String, null],
       outgoing: Boolean
     }),
 
     /**
      * Used to cancel call setup.
      */
     CancelCall: Action.define("cancelCall", {
     }),
--- a/browser/components/loop/content/shared/js/conversationStore.js
+++ b/browser/components/loop/content/shared/js/conversationStore.js
@@ -50,16 +50,18 @@ loop.store.ConversationStore = (function
     // The user has finished with the window.
     CLOSE: "cs-close",
     // The call was terminated due to an issue during connection.
     TERMINATED: "cs-terminated"
   };
 
   var ConversationStore = Backbone.Model.extend({
     defaults: {
+      // The id of the window. Currently used for getting the window id.
+      windowId: undefined,
       // The current state of the call
       callState: CALL_STATES.INIT,
       // The reason if a call was terminated
       callStateReason: undefined,
       // The error information, if there was a failure
       error: undefined,
       // True if the call is outgoing, false if not, undefined if unknown
       outgoing: undefined,
@@ -195,27 +197,27 @@ loop.store.ConversationStore = (function
     gatherCallData: function(actionData) {
       if (!actionData.outgoing) {
         // XXX Other types aren't supported yet, but set the state for the
         // view selection.
         this.set({outgoing: false});
         return;
       }
 
-      var callData = navigator.mozLoop.getCallData(actionData.callId);
+      var callData = navigator.mozLoop.getCallData(actionData.windowId);
       if (!callData) {
         console.error("Failed to get the call data");
         this.set({callState: CALL_STATES.TERMINATED});
         return;
       }
 
       this.set({
         contact: callData.contact,
         outgoing: actionData.outgoing,
-        callId: actionData.callId,
+        windowId: actionData.windowId,
         callType: callData.callType,
         callState: CALL_STATES.GATHER
       });
 
       this.set({videoMuted: this.get("callType") === CALL_TYPES.AUDIO_ONLY});
 
       if (this.get("outgoing")) {
         this._setupOutgoingCall();
@@ -402,21 +404,17 @@ loop.store.ConversationStore = (function
       if (this._websocket) {
         this.stopListening(this._websocket);
 
         // Now close the websocket.
         this._websocket.close();
         delete this._websocket;
       }
 
-      // XXX: The internal callId is different from
-      // this.get("callId"), see bug 1084228 for more info.
-      var locationHash = new loop.shared.utils.Helper().locationData().hash;
-      var callId = locationHash.match(/\#outgoing\/(.*)/)[1];
-      navigator.mozLoop.releaseCallData(callId);
+      navigator.mozLoop.releaseCallData(this.get("windowId"));
     },
 
     /**
      * Used to handle any progressed received from the websocket. This will
      * dispatch new actions so that the data can be handled appropriately.
      */
     _handleWebSocketProgress: function(progressData) {
       var action;
--- a/browser/components/loop/content/shared/js/models.js
+++ b/browser/components/loop/content/shared/js/models.js
@@ -17,16 +17,17 @@ loop.shared.models = (function(l10n) {
       connected:    false,         // Session connected flag
       ongoing:      false,         // Ongoing call flag
       callerId:     undefined,     // Loop caller id
       loopToken:    undefined,     // Loop conversation token
       sessionId:    undefined,     // OT session id
       sessionToken: undefined,     // OT session token
       sessionType:  undefined,     // Hawk session type
       apiKey:       undefined,     // OT api key
+      windowId:     undefined,     // The window id
       callId:       undefined,     // The callId on the server
       progressURL:  undefined,     // The websocket url to use for progress
       websocketToken: undefined,   // The token to use for websocket auth, this is
                                    // stored as a hex string which is what the server
                                    // requires.
       callType:     undefined,     // The type of incoming call selected by
                                    // other peer ("audio" or "audio-video")
       selectedCallType: "audio-video", // The selected type for the call that was
--- a/browser/components/loop/test/desktop-local/conversation_test.js
+++ b/browser/components/loop/test/desktop-local/conversation_test.js
@@ -153,34 +153,34 @@ describe("loop.conversation", function()
     });
 
     it("should trigger a gatherCallData action", function() {
       loop.conversation.init();
 
       sinon.assert.calledOnce(loop.Dispatcher.prototype.dispatch);
       sinon.assert.calledWithExactly(loop.Dispatcher.prototype.dispatch,
         new loop.shared.actions.GatherCallData({
-          callId: "42",
+          windowId: "42",
           outgoing: false
         }));
     });
 
     it("should trigger an outgoing gatherCallData action for outgoing calls",
       function() {
         loop.shared.utils.Helper.prototype.locationData.returns({
           hash: "#outgoing/24",
           pathname: "/"
         });
 
         loop.conversation.init();
 
         sinon.assert.calledOnce(loop.Dispatcher.prototype.dispatch);
         sinon.assert.calledWithExactly(loop.Dispatcher.prototype.dispatch,
           new loop.shared.actions.GatherCallData({
-            callId: "24",
+            windowId: "24",
             outgoing: true
           }));
       });
   });
 
   describe("ConversationControllerView", function() {
     var store, conversation, client, ccView, oldTitle, dispatcher;
 
@@ -271,17 +271,17 @@ describe("loop.conversation", function()
     }
 
     beforeEach(function() {
       oldTitle = document.title;
       client = new loop.Client();
       conversation = new loop.shared.models.ConversationModel({}, {
         sdk: {}
       });
-      conversation.set({callId: 42});
+      conversation.set({windowId: 42});
       sandbox.stub(conversation, "setOutgoingSessionData");
     });
 
     afterEach(function() {
       icView = undefined;
       document.title = oldTitle;
     });
 
@@ -542,18 +542,20 @@ describe("loop.conversation", function()
         beforeEach(function() {
           icView = mountTestComponent();
 
           sandbox.stub(window, "close");
           icView._websocket = {
             decline: sinon.stub(),
             close: sinon.stub()
           };
+          conversation.set({
+            windowId: "8699"
+          });
           conversation.setIncomingSessionData({
-            callId:         8699,
             websocketToken: 123
           });
         });
 
         it("should close the window", function() {
           icView.decline();
 
           sandbox.clock.tick(1);
@@ -566,17 +568,17 @@ describe("loop.conversation", function()
 
           sinon.assert.calledOnce(navigator.mozLoop.stopAlerting);
         });
 
         it("should release callData", function() {
           icView.decline();
 
           sinon.assert.calledOnce(navigator.mozLoop.releaseCallData);
-          sinon.assert.calledWithExactly(navigator.mozLoop.releaseCallData, 8699);
+          sinon.assert.calledWithExactly(navigator.mozLoop.releaseCallData, "8699");
         });
       });
 
       describe("#blocked", function() {
         var mozLoop;
 
         beforeEach(function() {
           icView = mountTestComponent();
@@ -617,17 +619,17 @@ describe("loop.conversation", function()
         });
 
         it("should get callToken from conversation model", function() {
           sandbox.stub(conversation, "get");
           icView.declineAndBlock();
 
           sinon.assert.called(conversation.get);
           sinon.assert.calledWithExactly(conversation.get, "callToken");
-          sinon.assert.calledWithExactly(conversation.get, "callId");
+          sinon.assert.calledWithExactly(conversation.get, "windowId");
         });
 
         it("should trigger error handling in case of error", function() {
           // XXX just logging to console for now
           var log = sandbox.stub(console, "log");
           var fakeError = {
             error: true
           };
--- a/browser/components/loop/test/shared/conversationStore_test.js
+++ b/browser/components/loop/test/shared/conversationStore_test.js
@@ -120,21 +120,17 @@ describe("loop.store.ConversationStore",
         });
       }).to.Throw(/sdkDriver/);
     });
   });
 
   describe("#connectionFailure", function() {
     beforeEach(function() {
       store._websocket = fakeWebsocket;
-      sandbox.stub(loop.shared.utils.Helper.prototype, "locationData")
-        .returns({
-          hash: "#outgoing/42",
-          pathname: ""
-        });
+      store.set({windowId: "42"});
     });
 
     it("should disconnect the session", function() {
       dispatcher.dispatch(
         new sharedActions.ConnectionFailure({reason: "fake"}));
 
       sinon.assert.calledOnce(sdkDriver.disconnectSession);
     });
@@ -241,51 +237,51 @@ describe("loop.store.ConversationStore",
 
     afterEach(function() {
       delete navigator.mozLoop;
     });
 
     it("should set the state to 'gather'", function() {
       dispatcher.dispatch(
         new sharedActions.GatherCallData({
-          callId: "76543218",
+          windowId: "76543218",
           outgoing: true
         }));
 
       expect(store.get("callState")).eql(CALL_STATES.GATHER);
     });
 
     it("should save the basic call information", function() {
       dispatcher.dispatch(
         new sharedActions.GatherCallData({
-          callId: "123456",
+          windowId: "123456",
           outgoing: true
         }));
 
-      expect(store.get("callId")).eql("123456");
+      expect(store.get("windowId")).eql("123456");
       expect(store.get("outgoing")).eql(true);
     });
 
     it("should save the basic information from the mozLoop api", function() {
       dispatcher.dispatch(
         new sharedActions.GatherCallData({
-          callId: "123456",
+          windowId: "123456",
           outgoing: true
         }));
 
       expect(store.get("contact")).eql(contact);
       expect(store.get("callType")).eql(sharedUtils.CALL_TYPES.AUDIO_VIDEO);
     });
 
     describe("outgoing calls", function() {
       var outgoingCallData;
 
       beforeEach(function() {
         outgoingCallData = {
-          callId: "123456",
+          windowId: "123456",
           outgoing: true
         };
       });
 
       it("should request the outgoing call data", function() {
         dispatcher.dispatch(
           new sharedActions.GatherCallData(outgoingCallData));
 
@@ -494,21 +490,17 @@ describe("loop.store.ConversationStore",
       wsMediaFailSpy = sinon.spy();
       wsCloseSpy = sinon.spy();
 
       store._websocket = {
         mediaFail: wsMediaFailSpy,
         close: wsCloseSpy
       };
       store.set({callState: CALL_STATES.ONGOING});
-      sandbox.stub(loop.shared.utils.Helper.prototype, "locationData")
-        .returns({
-          hash: "#outgoing/42",
-          pathname: ""
-        });
+      store.set({windowId: "42"});
     });
 
     it("should disconnect the session", function() {
       dispatcher.dispatch(new sharedActions.HangupCall());
 
       sinon.assert.calledOnce(sdkDriver.disconnectSession);
     });
 
@@ -544,21 +536,17 @@ describe("loop.store.ConversationStore",
       wsMediaFailSpy = sinon.spy();
       wsCloseSpy = sinon.spy();
 
       store._websocket = {
         mediaFail: wsMediaFailSpy,
         close: wsCloseSpy
       };
       store.set({callState: CALL_STATES.ONGOING});
-      sandbox.stub(loop.shared.utils.Helper.prototype, "locationData")
-        .returns({
-          hash: "#outgoing/42",
-          pathname: ""
-        });
+      store.set({windowId: "42"});
     });
 
     it("should disconnect the session", function() {
       dispatcher.dispatch(new sharedActions.PeerHungupCall());
 
       sinon.assert.calledOnce(sdkDriver.disconnectSession);
     });
 
@@ -582,21 +570,17 @@ describe("loop.store.ConversationStore",
     });
   });
 
   describe("#cancelCall", function() {
     beforeEach(function() {
       store._websocket = fakeWebsocket;
 
       store.set({callState: CALL_STATES.CONNECTING});
-      sandbox.stub(loop.shared.utils.Helper.prototype, "locationData")
-        .returns({
-          hash: "#outgoing/42",
-          pathname: ""
-        });
+      store.set({windowId: "42"});
     });
 
     it("should disconnect the session", function() {
       dispatcher.dispatch(new sharedActions.CancelCall());
 
       sinon.assert.calledOnce(sdkDriver.disconnectSession);
     });
 
--- a/browser/components/loop/test/shared/dispatcher_test.js
+++ b/browser/components/loop/test/shared/dispatcher_test.js
@@ -40,17 +40,17 @@ describe("loop.Dispatcher", function () 
   });
 
   describe("#dispatch", function() {
     var gatherStore1, gatherStore2, cancelStore1, connectStore1;
     var gatherAction, cancelAction, connectAction, resolveCancelStore1;
 
     beforeEach(function() {
       gatherAction = new sharedActions.GatherCallData({
-        callId: "42",
+        windowId: "42",
         outgoing: false
       });
 
       cancelAction = new sharedActions.CancelCall();
       connectAction = new sharedActions.ConnectCall({
         sessionData: {}
       });