Merge pull request #13345 from VisualSJ/v3-updateIndex

[ci skip] update js-tests
This commit is contained in:
子龙山人 2015-08-13 11:18:19 +08:00
commit 5e21580cdd
2 changed files with 11 additions and 13 deletions

View File

@ -42,5 +42,9 @@ var CocosBuilderTestScene = TestScene.extend({
} }
cc.director.runScene(this); cc.director.runScene(this);
},
onMainMenuCallback: function(){
var scene = new ExtensionsTestScene();
scene.runThisTest();
} }
}); });

View File

@ -182,25 +182,22 @@ var ScriptTestLayer = SysTestBase.extend({
{ {
return; return;
} }
var that = this;
var manifestPath = "Manifests/ScriptTest/project.manifest"; var manifestPath = "Manifests/ScriptTest/project.manifest";
var storagePath = ((jsb.fileUtils ? jsb.fileUtils.getWritablePath() : "/") + "JSBTests/AssetsManagerTest/ScriptTest/"); var storagePath = ((jsb.fileUtils ? jsb.fileUtils.getWritablePath() : "/") + "JSBTests/AssetsManagerTest/ScriptTest/");
cc.log("Storage path for this test : " + storagePath); cc.log("Storage path for this test : " + storagePath);
if (this._am) if (this._am){
{
this._am.release(); this._am.release();
this._am = null; this._am = null;
} }
this._am = new jsb.AssetsManager(manifestPath, storagePath); this._am = new jsb.AssetsManager(manifestPath, storagePath);
this._am.retain(); this._am.retain();
if (!this._am.getLocalManifest().isLoaded()) if (!this._am.getLocalManifest().isLoaded()){
{
cc.log("Fail to update assets, step skipped."); cc.log("Fail to update assets, step skipped.");
that.clickMeShowTempLayer(); that.clickMeShowTempLayer();
} }else {
else {
var that = this;
var listener = new jsb.EventListenerAssetsManager(this._am, function (event) { var listener = new jsb.EventListenerAssetsManager(this._am, function (event) {
var scene; var scene;
switch (event.getEventCode()) { switch (event.getEventCode()) {
@ -246,12 +243,9 @@ var ScriptTestLayer = SysTestBase.extend({
}, },
clickMeReloadTempLayer:function(){ clickMeReloadTempLayer:function(){
cc.sys.cleanScript(tempJSFileName); cc.sys.cleanScript(tempJSFileName);
if (!cc.sys.isNative) if (!cc.sys.isNative){
{
this.clickMeShowTempLayer(); this.clickMeShowTempLayer();
} }else{
else
{
this.startDownload(); this.startDownload();
} }