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 #25243 from EdgarChen/bug_1083841/cfstatechange
Browse files Browse the repository at this point in the history
Bug 1083841 - [System] Don't need to check 'success' when handing cfstatechange event
  • Loading branch information
rvandermeulen committed Oct 23, 2014
2 parents 78d995e + f3a47c0 commit 24b956e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
2 changes: 1 addition & 1 deletion apps/system/js/call_forwarding.js
Expand Up @@ -124,7 +124,7 @@
* @memberof CallForwarding.prototype
*/
_updateCallForwardingIconState: function(slot, event) {
if (!event || !event.success ||
if (!event ||
(event.reason != _cfReason.CALL_FORWARD_REASON_UNCONDITIONAL &&
event.reason != _cfReason.CALL_FORWARD_REASON_ALL_CALL_FORWARDING)) {
return;
Expand Down
31 changes: 1 addition & 30 deletions apps/system/test/unit/call_forwarding_test.js
Expand Up @@ -260,8 +260,7 @@ suite('system/callForwarding >', function() {
setup(function() {
this.event = {
reason: reason,
action: cfAction.CALL_FORWARD_ACTION_ENABLE,
success: true
action: cfAction.CALL_FORWARD_ACTION_ENABLE
};

this.callForwarding.start();
Expand All @@ -284,22 +283,6 @@ suite('system/callForwarding >', function() {
this.callForwarding._callForwardingHelper.get);
});

test('the icon state should remains unchanged when unsuccess',
function(done) {
var originalValue =
MockSettingsHelper.instances['ril.cf.enabled'].value[0];
this.event.success = false;
this.callForwarding._updateCallForwardingIconState(this.slots[0],
this.event);
setTimeout(function() {
assert.equal(
MockSettingsHelper.instances['ril.cf.enabled'].value[0],
originalValue
);
done();
});
});

test('should set the icon state to false when erase the setting ' +
'successfully', function(done) {
this.event.action = cfAction.CALL_FORWARD_ACTION_ERASURE;
Expand Down Expand Up @@ -344,18 +327,6 @@ suite('system/callForwarding >', function() {
assert.isTrue(
MockasyncStorage.mItems['ril.cf.enabled.' + this.iccid]);
});

test('when unsuccess', function() {
var originalValue =
MockSettingsHelper.instances['ril.cf.enabled.' + this.iccid];
this.event.success = false;
this.callForwarding._updateCallForwardingIconState(this.slots[0],
this.event);
assert.equal(
MockasyncStorage.mItems['ril.cf.enabled.' + this.iccid],
originalValue
);
});
});
});
});
Expand Down

0 comments on commit 24b956e

Please sign in to comment.