Bug 1029433 When in a Loop call, the title bar should display the remote party's information. r=nperriault
--- a/browser/components/loop/content/js/conversation.js
+++ b/browser/components/loop/content/js/conversation.js
@@ -230,18 +230,17 @@ loop.conversation = (function(mozL10n) {
return (
IncomingCallView({
model: this.props.conversation,
video: this.props.conversation.hasVideoStream("incoming")}
)
);
}
case "connected": {
- // XXX This should be the caller id (bug 1020449)
- document.title = mozL10n.get("incoming_call_title2");
+ document.title = this.props.conversation.getCallIdentifier();
var callType = this.props.conversation.get("selectedCallType");
return (
sharedViews.ConversationView({
initiate: true,
sdk: this.props.sdk,
model: this.props.conversation,
--- a/browser/components/loop/content/js/conversation.jsx
+++ b/browser/components/loop/content/js/conversation.jsx
@@ -230,18 +230,17 @@ loop.conversation = (function(mozL10n) {
return (
<IncomingCallView
model={this.props.conversation}
video={this.props.conversation.hasVideoStream("incoming")}
/>
);
}
case "connected": {
- // XXX This should be the caller id (bug 1020449)
- document.title = mozL10n.get("incoming_call_title2");
+ document.title = this.props.conversation.getCallIdentifier();
var callType = this.props.conversation.get("selectedCallType");
return (
<sharedViews.ConversationView
initiate={true}
sdk={this.props.sdk}
model={this.props.conversation}
--- a/browser/components/loop/test/desktop-local/conversation_test.js
+++ b/browser/components/loop/test/desktop-local/conversation_test.js
@@ -604,16 +604,24 @@ describe("loop.conversation", function()
describe("call:accepted", function() {
it("should display the ConversationView",
function() {
conversation.accepted();
TestUtils.findRenderedComponentWithType(icView,
sharedView.ConversationView);
});
+
+ it("should set the title to the call identifier", function() {
+ sandbox.stub(conversation, "getCallIdentifier").returns("fakeId");
+
+ conversation.accepted();
+
+ expect(document.title).eql("fakeId");
+ });
});
describe("session:ended", function() {
it("should display the feedback view when the call session ends",
function() {
conversation.trigger("session:ended");
TestUtils.findRenderedComponentWithType(icView,
--- a/browser/components/loop/test/shared/models_test.js
+++ b/browser/components/loop/test/shared/models_test.js
@@ -369,24 +369,34 @@ describe("loop.shared.models", function(
beforeEach(function() {
model = new sharedModels.ConversationModel(fakeSessionData, {
sdk: fakeSDK
});
model.startSession();
});
it("should return the callerId", function() {
- expect(model.getCallIdentifier()).to.eql("mrssmith");
+ expect(model.getCallIdentifier()).eql("mrssmith");
});
it("should return the shorted callUrl if the callerId does not exist",
function() {
- model.set({"callerId": ""});
+ model.set({callerId: ""});
+
+ expect(model.getCallIdentifier()).eql("invalid/callToken");
+ });
- expect(model.getCallIdentifier()).to.eql("invalid/callToken");
+ it("should return an empty string if neither callerId nor callUrl exist",
+ function() {
+ model.set({
+ callerId: undefined,
+ callUrl: undefined
+ });
+
+ expect(model.getCallIdentifier()).eql("");
});
});
});
});
describe("NotificationCollection", function() {
var collection, notifData, testNotif;