diff --git a/tests/LabelTest/LabelTest.js b/tests/LabelTest/LabelTest.js index e3d5ec0a..e581b5ae 100644 --- a/tests/LabelTest/LabelTest.js +++ b/tests/LabelTest/LabelTest.js @@ -1738,11 +1738,15 @@ var arrayOfLabelTest = [ LabelTTFA8Test, LabelTTFFontInitTest, LabelTTFAlignment, - LabelTTFStrokeShadowTest, LabelsEmpty ]; +if( sys.platform != "browser"){ + //Not implement in HTML5 + arrayOfLabelTest.push(LabelTTFStrokeShadowTest); +} + var nextLabelTest = function () { labelTestIdx++; labelTestIdx = labelTestIdx % arrayOfLabelTest.length; diff --git a/tests/MultiViewTest/MultiViewTest.js b/tests/MultiViewTest/MultiViewTest.js new file mode 100644 index 00000000..d52adc12 --- /dev/null +++ b/tests/MultiViewTest/MultiViewTest.js @@ -0,0 +1,138 @@ +/**************************************************************************** + + http://www.cocos2d-html5.org + http://www.cocos2d-iphone.org + http://www.cocos2d-x.org + + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +var multiViewTestSceneIdx = -1; +//------------------------------------------------------------------ +// +// MultiViewTestBase +// +//------------------------------------------------------------------ +var MultiViewTestBase = BaseTestLayer.extend({ + _title:"", + _subtitle:"", + + ctor:function() { + this._super(cc.c4b(0,0,0,255), cc.c4b(98,99,117,255)); + }, + + onRestartCallback:function (sender) { + var s = new MultiViewTestScene(); + s.addChild(restartMultiViewTest()); + director.replaceScene(s); + }, + onNextCallback:function (sender) { + var s = new MultiViewTestScene(); + s.addChild(nextMultiViewTest()); + director.replaceScene(s); + }, + onBackCallback:function (sender) { + var s = new MultiViewTestScene(); + s.addChild(previousMultiViewTest()); + director.replaceScene(s); + }, + // automation + numberOfPendingTests:function() { + return ( (arrayOfMultiViewTest.length-1) - multiViewTestSceneIdx ); + }, + + getTestNumber:function() { + return multiViewTestSceneIdx; + } + +}); + + +//------------------------------------------------------------------ +// +// CapabilitiesTest +// +//------------------------------------------------------------------ +var KillAndSwitchTest = MultiViewTestBase.extend({ + _title:"Stability test: Kill and Switch Activity/View", + _subtitle:"Coming back into cocos2d-x should start a new instance of TestJavascript", + + handleCloseActivity: function() { + cc.switchAndKillActivity(); + }, + + ctor:function () { + this._super(); + + var clickButton = cc.MenuItemFont.create("Click here to kill this cocos2d-x Activity and switch to new one", this.handleCloseActivity, this); + var menu = cc.Menu.create(clickButton); + menu.alignItemsVertically(); + this.addChild(menu); + } +}); + + +var MultiViewTestScene = TestScene.extend({ + runThisTest:function () { + multiViewTestSceneIdx = -1; + var layer = nextMultiViewTest(); + this.addChild(layer); + + director.replaceScene(this); + } +}); + +// +// Flow control +// + +var arrayOfMultiViewTest = [ +]; + +var arrayOfIOSSpeceficTests = [ +]; + +var arrayOfAndroidSpeceficTests = [ + KillAndSwitchTest +]; + +if(sys.os == "android") { + arrayOfMultiViewTest = arrayOfMultiViewTest.concat(arrayOfAndroidSpeceficTests); +} else if(sys.os == "ios") { + arrayOfMultiViewTest.concat(arrayOfIOSSpeceficTests); +} + +var nextMultiViewTest = function () { + multiViewTestSceneIdx++; + multiViewTestSceneIdx = multiViewTestSceneIdx % arrayOfMultiViewTest.length; + + return new arrayOfMultiViewTest[multiViewTestSceneIdx](); +}; +var previousMultiViewTest = function () { + multiViewTestSceneIdx--; + if (multiViewTestSceneIdx < 0) + multiViewTestSceneIdx += arrayOfMultiViewTest.length; + + return new arrayOfMultiViewTest[multiViewTestSceneIdx](); +}; +var restartMultiViewTest = function () { + return new arrayOfMultiViewTest[multiViewTestSceneIdx](); +}; + diff --git a/tests/tests-boot-jsb.js b/tests/tests-boot-jsb.js index ee5e7894..398b42b0 100644 --- a/tests/tests-boot-jsb.js +++ b/tests/tests-boot-jsb.js @@ -13,7 +13,6 @@ var tests_files = [ // base class 'BaseTestLayer/BaseTestLayer.js', - 'ActionManagerTest/ActionManagerTest.js', 'ActionsTest/ActionsTest.js', 'ChipmunkTest/ChipmunkTest.js', @@ -55,7 +54,8 @@ var tests_files = [ 'TileMapTest/TileMapTest.js', 'TransitionsTest/TransitionsTest.js', 'UnitTest/UnitTest.js', - 'SysTest/SysTest.js' + 'SysTest/SysTest.js', + 'MultiViewTest/MultiViewTest.js' ]; for (var i = 0; i < tests_files.length; i++) { diff --git a/tests/tests-main.js b/tests/tests-main.js index dd8050d5..aeba71bb 100644 --- a/tests/tests-main.js +++ b/tests/tests-main.js @@ -240,7 +240,7 @@ var testNames = [ }, { title:"ClippingNode Test", - platforms: PLATFORM_JSB_AND_WEBGL, + platforms: PLATFORM_HTML5_WEBGL, testScene:function () { return new ClippingNodeTestScene(); } @@ -285,7 +285,7 @@ var testNames = [ { title:"Extensions Test", resource:g_extensions, - platforms: PLATFORM_HTML5, + platforms: PLATFORM_ALL, testScene:function () { return new ExtensionsTestScene(); } @@ -366,9 +366,9 @@ var testNames = [ return new NodeTestScene(); } }, + //"MotionStreakTest", { title:"OpenGL Test", - resource:g_opengl_resources, platforms: PLATFORM_JSB_AND_WEBGL, testScene:function () { return new OpenGLTestScene(); @@ -393,7 +393,6 @@ var testNames = [ { title:"Performance Test", platforms: PLATFORM_ALL, - resource:g_performace, testScene:function () { return new PerformanceTestScene(); } @@ -514,6 +513,21 @@ var testNames = [ //"ZwoptexTest", ]; +var androidTestNames = [ + { + title:"MultiView Tests", + platforms: PLATFORM_ALL, + testScene:function () { + return new MultiViewTestScene(); + } + } +] + +if(sys.os == "android") { + testNames = testNames.concat(androidTestNames); +} + + var s_rcVisible = cc.rect(0, 0, 0, 0); var s_ptCenter = cc.p(0, 0); var s_ptTop = cc.p(0, 0);