mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
33 lines
975 B
JavaScript
33 lines
975 B
JavaScript
(function () {
|
|
|
|
module('load resources', {
|
|
setup: function () {
|
|
_resetGame();
|
|
AssetLibrary.init({
|
|
libraryPath: assetDir + '/library',
|
|
rawAssetsBase: cc.path.dirname(cc.path._setEndWithSep(assetDir, false) + '.dummyExtForDirname') + '/',
|
|
rawAssets: {
|
|
assets: {
|
|
'748321': { url: 'resources/grossini.png', raw: true }
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
asyncTest('load single', function () {
|
|
cc.loader.releaseAll();
|
|
cc.loader.loadRes('grossini.png', function (err, texture) {
|
|
ok(texture instanceof cc.Texture2D, 'should be able to load texture without file extname');
|
|
clearTimeout(timeoutId);
|
|
start();
|
|
});
|
|
|
|
var timeoutId = setTimeout(function () {
|
|
ok(false, 'time out!');
|
|
start();
|
|
}, 5000);
|
|
});
|
|
|
|
})();
|