From 1458e0649265f59a383ee63c38c94c6a5a798f65 Mon Sep 17 00:00:00 2001 From: VisualSj Date: Thu, 13 Aug 2015 10:03:10 +0800 Subject: [PATCH 1/2] [js-tests] Optimization Cocosbuilder test --- .../src/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/js-tests/src/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.js b/tests/js-tests/src/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.js index dd505cf585..a571f1d6d2 100644 --- a/tests/js-tests/src/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.js +++ b/tests/js-tests/src/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.js @@ -42,5 +42,9 @@ var CocosBuilderTestScene = TestScene.extend({ } cc.director.runScene(this); - } + }, + onMainMenuCallback: function(){ + var scene = new ExtensionsTestScene(); + scene.runThisTest(); + } }); From dd7e00403ff85c8da6cdc20b7e377ec317bbd968 Mon Sep 17 00:00:00 2001 From: VisualSj Date: Thu, 13 Aug 2015 10:56:41 +0800 Subject: [PATCH 2/2] [js-tests] that is undefined - script test --- tests/js-tests/src/SysTest/SysTest.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/js-tests/src/SysTest/SysTest.js b/tests/js-tests/src/SysTest/SysTest.js index c650612bed..958f1f759e 100644 --- a/tests/js-tests/src/SysTest/SysTest.js +++ b/tests/js-tests/src/SysTest/SysTest.js @@ -182,25 +182,22 @@ var ScriptTestLayer = SysTestBase.extend({ { return; } + var that = this; var manifestPath = "Manifests/ScriptTest/project.manifest"; var storagePath = ((jsb.fileUtils ? jsb.fileUtils.getWritablePath() : "/") + "JSBTests/AssetsManagerTest/ScriptTest/"); cc.log("Storage path for this test : " + storagePath); - if (this._am) - { + if (this._am){ this._am.release(); this._am = null; } this._am = new jsb.AssetsManager(manifestPath, storagePath); this._am.retain(); - if (!this._am.getLocalManifest().isLoaded()) - { + if (!this._am.getLocalManifest().isLoaded()){ cc.log("Fail to update assets, step skipped."); that.clickMeShowTempLayer(); - } - else { - var that = this; + }else { var listener = new jsb.EventListenerAssetsManager(this._am, function (event) { var scene; switch (event.getEventCode()) { @@ -246,12 +243,9 @@ var ScriptTestLayer = SysTestBase.extend({ }, clickMeReloadTempLayer:function(){ cc.sys.cleanScript(tempJSFileName); - if (!cc.sys.isNative) - { + if (!cc.sys.isNative){ this.clickMeShowTempLayer(); - } - else - { + }else{ this.startDownload(); }