Bug 1029433 When in a Loop call, the title bar should display the remote party's information. r=nperriault

This commit is contained in:
Mark Banner
2014-10-10 14:03:56 +01:00
parent ff021c934b
commit bea2c4acd2
4 changed files with 23 additions and 7 deletions

View File

@@ -235,8 +235,7 @@ loop.conversation = (function(mozL10n) {
);
}
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");

View File

@@ -235,8 +235,7 @@ loop.conversation = (function(mozL10n) {
);
}
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");

View File

@@ -609,6 +609,14 @@ describe("loop.conversation", function() {
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() {

View File

@@ -374,14 +374,24 @@ describe("loop.shared.models", function() {
});
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()).to.eql("invalid/callToken");
expect(model.getCallIdentifier()).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("");
});
});
});