Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
42 lines
911 B
JavaScript
Executable file
42 lines
911 B
JavaScript
Executable file
'use strict';
|
|
/* exported MockNotificationHelper */
|
|
|
|
var MockNotificationHelper = {
|
|
send: function(titleL10n, options) {
|
|
this.mOptions = options;
|
|
this.mTitleL10n = titleL10n;
|
|
var self = this;
|
|
|
|
var notification = {
|
|
addEventListener: function(type, cb) {
|
|
self.mEvents[type] = cb;
|
|
},
|
|
removeEventListener: function(type, cb) {
|
|
},
|
|
close: sinon.stub()
|
|
};
|
|
sinon.spy(notification, 'addEventListener');
|
|
|
|
return Promise.resolve(notification);
|
|
},
|
|
|
|
getIconURI: function nc_getIconURI(app, entryPoint) {
|
|
var result = '' + app.name;
|
|
if (entryPoint) {
|
|
result += '/' + entryPoint;
|
|
}
|
|
return result;
|
|
},
|
|
|
|
mEmit: function(type) {
|
|
this.mEvents[type]();
|
|
},
|
|
mEvents: {},
|
|
mTitleL10n: null,
|
|
mOptions: null,
|
|
mTeardown: function teardown() {
|
|
this.mTitleL10n = null;
|
|
this.mOptions = null;
|
|
this.mEvents = {};
|
|
}
|
|
};
|