Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
54
gaia/apps/system/test/unit/bluetooth_icon_test.js
Executable file
54
gaia/apps/system/test/unit/bluetooth_icon_test.js
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
/* global BluetoothIcon, MockBluetooth, MockL10n */
|
||||
'use strict';
|
||||
|
||||
requireApp('system/js/service.js');
|
||||
requireApp('system/js/base_ui.js');
|
||||
requireApp('system/js/base_icon.js');
|
||||
requireApp('system/js/bluetooth_icon.js');
|
||||
requireApp('system/test/unit/mock_bluetooth.js');
|
||||
require('/shared/test/unit/mocks/mock_l10n.js');
|
||||
|
||||
suite('system/BluetoothIcon', function() {
|
||||
var subject, realL10n;
|
||||
|
||||
setup(function() {
|
||||
realL10n = navigator.mozL10n;
|
||||
navigator.mozL10n = MockL10n;
|
||||
subject = new BluetoothIcon(MockBluetooth);
|
||||
subject.start();
|
||||
subject.element = document.createElement('div');
|
||||
});
|
||||
|
||||
teardown(function() {
|
||||
navigator.mozL10n = realL10n;
|
||||
subject.stop();
|
||||
});
|
||||
|
||||
test('Bluetooth is enabled', function() {
|
||||
MockBluetooth._settingsEnabled = true;
|
||||
MockBluetooth.connected = false;
|
||||
subject.update();
|
||||
assert.isTrue(subject.isVisible());
|
||||
assert.equal(subject.element.dataset.active, 'false');
|
||||
assert.equal(MockL10n.getAttributes(subject.element).id,
|
||||
'statusbarIconOn-bluetooth');
|
||||
});
|
||||
|
||||
test('Bluetooth is enabled and connected', function() {
|
||||
MockBluetooth._settingsEnabled = true;
|
||||
MockBluetooth.connected = true;
|
||||
subject.update();
|
||||
assert.isTrue(subject.isVisible());
|
||||
assert.equal(subject.element.dataset.active, 'true');
|
||||
assert.equal(MockL10n.getAttributes(subject.element).id,
|
||||
'statusbarIconOnActive-bluetooth');
|
||||
});
|
||||
|
||||
test('Bluetooth is disabled', function() {
|
||||
MockBluetooth._settingsEnabled = false;
|
||||
MockBluetooth.connected = false;
|
||||
subject.update();
|
||||
assert.isFalse(subject.isVisible());
|
||||
assert.equal(subject.element.dataset.active, 'false');
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue