Skip to content

Commit

Permalink
Merge pull request cocos#1426 from jareguo/temp2
Browse files Browse the repository at this point in the history
fix unit tests about loader
  • Loading branch information
jareguo authored Jan 10, 2017
2 parents b63811d + 9ed97ad commit cbad139
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions test/qunit/unit/_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ var SetupEngine = {
}
};

QUnit.config.testTimeout = 5000;

// force stop to ensure start will only called once
function asyncEnd () {
cc.game.pause();
Expand Down
10 changes: 5 additions & 5 deletions test/qunit/unit/test-pack-downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
callback(null, res);
};
PackDownloader.initPacks(PACKS);
PackDownloader.load({ id: "f10d21ed" }, function (err, data) {
PackDownloader.load({ uuid: "f10d21ed" }, function (err, data) {
ok(data === "f10d21ed", 'simple test');
start();
});
Expand Down Expand Up @@ -58,8 +58,8 @@
};
PackDownloader.initPacks(PACKS);
//
PackDownloader.load({ id: "" + firstToLoad }, function (err, data) {
PackDownloader.load({ id: "A" }, function (err, data) {
PackDownloader.load({ uuid: "" + firstToLoad }, function (err, data) {
PackDownloader.load({ uuid: "A" }, function (err, data) {
strictEqual(lastLoadedPackUuid, 'PACK ' + firstToLoad, 'asset should load from previous loaded pack');
start();
});
Expand Down Expand Up @@ -93,9 +93,9 @@
};
PackDownloader.initPacks(PACKS);
//
PackDownloader.load({ id: "1" }, function (err, data) {
PackDownloader.load({ uuid: "1" }, function (err, data) {
strictEqual(lastLoadedPackUuid, 'PACK 1', 'asset should load from smallest pack 1');
PackDownloader.load({ id: "2" }, function (err, data) {
PackDownloader.load({ uuid: "2" }, function (err, data) {
strictEqual(lastLoadedPackUuid, 'PACK 2', 'asset should load from smallest pack 2');
start();
});
Expand Down
2 changes: 1 addition & 1 deletion test/qunit/unit/test-prefab.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
id : 'Prefab_Provider',
async : false,
handle : function (item) {
var url = item.id;
var url = item.uuid;
if (url === UUID) {
item.states['Downloader'] = cc.Pipeline.ItemState.COMPLETE;
return JSON.stringify(prefabJson);
Expand Down

0 comments on commit cbad139

Please sign in to comment.