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

Commit

Permalink
Merge pull request #15124 from guhelski/Bug-949801
Browse files Browse the repository at this point in the history
Bug 949801 - [B2G][MMS] Service currently unavailable is prompted when d...
  • Loading branch information
rvandermeulen committed Jan 15, 2014
2 parents 1307a48 + eb91173 commit 3a0747d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/sms/js/thread_ui.js
Expand Up @@ -2009,6 +2009,10 @@ var ThreadUI = global.ThreadUI = {
MessageManager.sendMMS(mmsMessage, null,
function onError(error) {
var errorName = error.name;
if (errorName === 'NotFoundError') {
console.info('The message was deleted or is no longer available.');
return;
}
this.showMessageError(errorName);
}.bind(this)
);
Expand Down
24 changes: 24 additions & 0 deletions apps/sms/test/unit/thread_ui_test.js
Expand Up @@ -3727,6 +3727,30 @@ suite('thread_ui.js >', function() {
assert.isTrue(spy.calledOnce);
});

suite('sendMMS errors', function() {
setup(function() {
this.sinon.spy(MessageManager, 'sendMMS');
this.sinon.spy(MockErrorDialog.prototype, 'show');

ThreadUI.recipients.add({
number: '999'
});

Compose.append(mockAttachment(512));

sendButton.click();
});

test('NotFoundError', function() {
MessageManager.sendMMS.callArg(2, { name: 'NotFoundError' });
sinon.assert.notCalled(MockErrorDialog.prototype.show);
});

test('Generic error', function() {
MessageManager.sendMMS.callArg(2, { name: 'GenericError' });
sinon.assert.called(MockErrorDialog.prototype.show);
});
});
});

suite('Contact Picker Behavior(contactPickButton)', function() {
Expand Down

0 comments on commit 3a0747d

Please sign in to comment.