Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 1150953 - merge pull request #29333 from DouglasSherk:1150953-cal…
Browse files Browse the repository at this point in the history
…lscreen-bdi-contact to mozilla-b2g:master
  • Loading branch information
mozilla-autolander-deprecated committed Apr 3, 2015
2 parents 1c1eb64 + cf1f3f8 commit 050e521
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions apps/callscreen/js/calls_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@ var CallsHandler = (function callsHandler() {
if (contact && contact.name) {
CallScreen.incomingInfo.classList.add('additionalInfo');
CallScreen.incomingNumber.textContent = contact.name;
CallScreen.incomingNumberAdditionalInfo.textContent =
CallScreen.incomingNumberAdditionalInfo.innerHTML =
Utils.getPhoneNumberAndType(matchingTel);
} else {
CallScreen.incomingNumber.textContent = number;
CallScreen.incomingNumberAdditionalInfo.textContent = '';
CallScreen.incomingNumberAdditionalInfo.innerHTML = '';
}

FontSizeManager.adaptToSpace(
Expand Down
4 changes: 2 additions & 2 deletions apps/callscreen/js/handled_call.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ HandledCall.prototype.replaceAdditionalContactInfo =
function hc_replaceAdditionalContactInfo(additionalContactInfo) {
if (!additionalContactInfo ||
additionalContactInfo.trim() === '') {
this.additionalInfoNode.textContent = '';
this.additionalInfoNode.innerHTML = '';
this.node.classList.remove('additionalInfo');
} else {
this.additionalInfoNode.textContent = additionalContactInfo;
this.additionalInfoNode.innerHTML = additionalContactInfo;
this.node.classList.add('additionalInfo');
}
};
Expand Down
4 changes: 2 additions & 2 deletions apps/callscreen/test/unit/calls_handler_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ suite('calls handler', function() {
MockNavigatorMozTelephony.mTriggerCallsChanged();
assert.equal(MockCallScreen.incomingNumber.textContent, 'test name');
assert.isTrue(MockUtils.mCalledGetPhoneNumberAndType);
assert.equal(MockCallScreen.incomingNumberAdditionalInfo.textContent,
assert.equal(MockCallScreen.incomingNumberAdditionalInfo.innerHTML,
'type, 12334');
});

Expand All @@ -364,7 +364,7 @@ suite('calls handler', function() {
extraCall.id.number);
assert.isTrue(MockUtils.mCalledGetPhoneNumberAndType);
assert.equal(
MockCallScreen.incomingNumberAdditionalInfo.textContent, '');
MockCallScreen.incomingNumberAdditionalInfo.innerHTML, '');
});

suite('adaptToSpace and ensureFixedBaseline', function() {
Expand Down
12 changes: 6 additions & 6 deletions apps/callscreen/test/unit/handled_call_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ suite('dialer/handled_call', function() {
mockCall = new MockCall('888', 'incoming');
subject = new HandledCall(mockCall);
MockVoicemail.mResolvePromise(false);
assert.equal(subject.additionalInfoNode.textContent, 'type, 888');
assert.equal(subject.additionalInfoNode.innerHTML, 'type, 888');
});

test('check switch-calls mode', function() {
Expand All @@ -669,9 +669,9 @@ suite('dialer/handled_call', function() {
mockCall.secondId = { number: '999' };
subject.updateCallNumber();

assert.equal('', subject.additionalInfoNode.textContent);
assert.equal('', subject.additionalInfoNode.innerHTML);
subject.restoreAdditionalContactInfo();
assert.equal('', subject.additionalInfoNode.textContent);
assert.equal('', subject.additionalInfoNode.innerHTML);
});

suite('additional contact info', function() {
Expand All @@ -686,7 +686,7 @@ suite('dialer/handled_call', function() {
});

test('should update the text content', function() {
assert.equal(subject.additionalInfoNode.textContent,
assert.equal(subject.additionalInfoNode.innerHTML,
'test additional info');
});

Expand All @@ -701,7 +701,7 @@ suite('dialer/handled_call', function() {
});

test('should empty the text content', function() {
assert.equal(subject.additionalInfoNode.textContent, '');
assert.equal(subject.additionalInfoNode.innerHTML, '');
});

test('should remove the css class', function() {
Expand Down Expand Up @@ -1034,7 +1034,7 @@ suite('dialer/handled_call', function() {
mockCall.emergency = true;
mockCall._connect();

assert.equal(subject.additionalInfoNode.textContent, 'emergencyNumber');
assert.equal(subject.additionalInfoNode.innerHTML, 'emergencyNumber');
assert.isTrue(subject.node.classList.contains('emergency'));
assert.isTrue(subject.node.textContent.contains('112'));
});
Expand Down
3 changes: 2 additions & 1 deletion apps/sharedtest/test/unit/dialer/utils_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ suite('dialer/utils', function() {
MockContacts.findByNumber(number, function(contact, matchingTel) {
var additionalInfo = subject.getPhoneNumberAndType(matchingTel);
sinon.assert.calledWith(MockL10n.get, MockContacts.mType);
assert.equal(MockContacts.mType + ', ' + number, additionalInfo);
assert.equal(MockContacts.mType + ', ' + '<bdi>' + number + '</bdi>',
additionalInfo);
});
});

Expand Down
3 changes: 2 additions & 1 deletion shared/js/dialer/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ var Utils = {
},

getPhoneNumberAndType: function ut_getPhoneNumberAndType(matchingTel) {
return this._getPhoneNumberType(matchingTel) + ', ' + matchingTel.value;
return this._getPhoneNumberType(matchingTel) + ', ' +
'<bdi>' + matchingTel.value + '</bdi>';
}
};

0 comments on commit 050e521

Please sign in to comment.