VulpesOS/gaia/shared/test/unit/mocks/mock_service.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

34 lines
807 B
JavaScript
Executable file

/* exported MockService */
'use strict';
var MockService = {
mTeardown: function() {
this.mQueries = {};
},
lowerCapital: function() {
return 'a';
},
lazyLoad: function() {},
register: function() {},
unregister: function() {},
registerState: function() {},
unregisterState: function() {},
request: function() {
return Promise.resolve();
},
query: function(name) {
return this.mQueries ? this.mQueries[name] : undefined;
},
mPublishEvents: {},
currentTime: function() {},
manifestURL: 'app://system.gaiamobile.org/manifest.webapp',
mockQueryWith: function(name, value) {
if (!this.mQueries) {
this.mQueries = {};
}
if (arguments.length === 1) {
return this.mQueries[name];
} else {
this.mQueries[name] = value;
}
}
};