VulpesOS/gaia/apps/operatorvariant/test/unit/resources_test.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

29 lines
762 B
JavaScript
Executable file

/* global requireApp, suite, test, assert, Resources */
'use strict';
requireApp('operatorvariant/js/resources.js');
var resourcePath = '/test/unit/resources/wallpaper.jpg';
suite(' Resources > ', function() {
test(' load properly ', function(done) {
var onerror = function errorHandler() {
assert.ok(false, 'Resource not loaded properly');
done();
};
Resources.load(resourcePath, 'blob', function() {
done();
}, onerror);
});
test(' error while loading ', function(done) {
var onerror = function errorHandler() {
done();
};
Resources.load('/wrong/path/file.jpg', 'blob', function() {
assert.ok(false, 'Resource loaded when it should not.');
done();
}, onerror);
});
});