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

Commit

Permalink
Revert "Bug 985888 - [DSDS] Display currently in-use SIM cards on cal…
Browse files Browse the repository at this point in the history
…l buttons. r=rik"

This reverts commit 1606cc3.
  • Loading branch information
DouglasSherk committed Mar 26, 2014
1 parent 1606cc3 commit f4e5224
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ suite('multi SIM action button', function() {
MockNavigatorSettings.mTeardown();
MockNavigatorMozTelephony.mTeardown();
MockNavigatorMozIccManager.mTeardown();
MockTelephonyHelper.mTeardown();
});

suite('<= 1 SIMs', function() {
Expand Down Expand Up @@ -224,6 +223,10 @@ suite('multi SIM action button', function() {
initSubject();
});

teardown(function() {
MockTelephonyHelper.mTeardown();
});

test('should not open SIM picker on (long) tap', function() {
var showSpy = this.sinon.spy(MockSimPicker, 'getOrPick');
simulateClick();
Expand Down Expand Up @@ -316,44 +319,6 @@ suite('multi SIM action button', function() {

assert.isFalse(document.body.classList.contains('has-preferred-sim'));
});

suite('with a call in progress', function() {
suiteSetup(function() {
window.TelephonyHelper = MockTelephonyHelper;
});

suiteTeardown(function() {
window.TelephonyHelper = null;
});

setup(function() {
cardIndex = 0;
initSubject();
});

test('should show SIM indicator with in-use serviceId', function() {
var localizeSpy = this.sinon.spy(MockMozL10n, 'localize');

MockTelephonyHelper.mInUseSim = 1;
MockNavigatorMozTelephony.mTriggerEvent({type: 'callschanged'});

sinon.assert.calledWith(localizeSpy, simIndication,
'sim-picker-button', {n: 2});
});

test('SIM indicator should go back to default serviceId when call over',
function() {
MockTelephonyHelper.mInUseSim = 1;
MockNavigatorMozTelephony.mTriggerEvent({type: 'callschanged'});

var localizeSpy = this.sinon.spy(MockMozL10n, 'localize');
MockTelephonyHelper.mTeardown();
MockNavigatorMozTelephony.mTriggerEvent({type: 'callschanged'});

sinon.assert.calledWith(localizeSpy, simIndication,
'sim-picker-button', {n: 1});
});
});
});

suite('without SIM indication', function() {
Expand Down
7 changes: 0 additions & 7 deletions shared/js/multi_sim_action_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ var MultiSimActionButton = function MultiSimActionButton(
self._simIndication = self._button.querySelector('.js-sim-indication');
SettingsListener.observe(settingsKey, 0, self._updateUI.bind(self));
});

this._simIndication = this._button.querySelector('.js-sim-indication');

var telephony = navigator.mozTelephony;
if (telephony) {
telephony.addEventListener('callschanged', this._updateUI.bind(this));
}
}
};

Expand Down

0 comments on commit f4e5224

Please sign in to comment.