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:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,65 @@
/* global BatteryIcon, MockNavigatorBattery, MockL10n */
'use strict';
requireApp('system/js/service.js');
requireApp('system/js/base_ui.js');
requireApp('system/js/base_icon.js');
requireApp('system/js/battery_icon.js');
requireApp('system/test/unit/mock_navigator_battery.js');
require('/shared/test/unit/mocks/mock_l10n.js');
suite('system/BatteryIcon', function() {
var subject, realMozL10n;
setup(function() {
realMozL10n = navigator.mozL10n;
navigator.mozL10n = MockL10n;
MockNavigatorBattery.level = 0.95;
MockNavigatorBattery.charging = false;
subject = new BatteryIcon({
_battery: MockNavigatorBattery
});
subject.start();
subject.element = document.createElement('div');
});
teardown(function() {
navigator.mozL10n = realMozL10n;
subject.stop();
});
test('should not publish changed when there is no change', function() {
subject.update();
this.sinon.stub(subject, 'publish');
subject.update();
assert.isFalse(subject.publish.calledWith('changed'));
});
test('should not publish iconchange when computed level does not change',
function() {
subject.update();
MockNavigatorBattery.level = 0.95;
this.sinon.stub(subject, 'publish');
subject.update();
assert.isFalse(subject.publish.calledWith('changed'));
});
test('should publish iconchange when battery changes', function() {
subject.update();
MockNavigatorBattery.level = 0.5;
this.sinon.stub(subject, 'publish');
subject.update();
assert.isTrue(subject.publish.calledWith('changed'));
});
test('should publish iconchange when charging state changes', function() {
subject.update();
MockNavigatorBattery.charging = true;
this.sinon.stub(subject, 'publish');
subject.update();
assert.isTrue(subject.publish.calledWith('changed'));
});
});