VulpesOS/gaia/apps/system/test/unit/mock_statusbar.js
OverSu b38dea0597 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.
2026-09-30 23:13:03 +02:00

57 lines
1.2 KiB
JavaScript
Executable file

'use strict';
/* exported MockStatusBar */
var MockStatusBar = {
name: 'Statusbar',
getIcon: function(id) {
if (document.getElementById(id)) {
return document.getElementById(id);
} else {
var ele = document.createElement('div');
ele.id = id;
document.body.appendChild(ele);
this.mIconsElements.push(ele);
return ele;
}
},
height: 20,
notificationsCount: null,
wasMethodCalled: {},
methodCalled: function msb_methodCalled(name) {
this.wasMethodCalled[name] =
this.wasMethodCalled[name] ? this.wasMethodCalled[name]++ : 1;
},
updateNotification: function(count) {
/* jshint -W053 */
var number = new Number(count);
this.notificationsCount = number.toString();
this.methodCalled('updateNotification');
},
setActive: function(unread) {
this.mNotificationUnread = unread;
},
mNotificationUnread: false,
mTeardown: function teardown() {
this.notificationsCount = null;
this.mNotificationsUpdated = false;
this.mNotificationUnread = false;
this.wasMethodCalled = {};
this.height = 20;
},
expand: function() {
this.methodCalled('expand');
},
collapse: function() {
this.methodCalled('collapse');
}
};