From 05dd3bb608463991034036b2d1d34e2901b64ea1 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Tue, 10 May 2016 20:34:35 +0800 Subject: [PATCH 1/2] Fix web engine issues in test cases --- tests/js-tests/src/EventTest/EventTest.js | 7 +++++-- tests/js-tests/src/SceneTest/SceneTest.js | 3 ++- web | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/js-tests/src/EventTest/EventTest.js b/tests/js-tests/src/EventTest/EventTest.js index edaa70efcf..c6bdaaceec 100644 --- a/tests/js-tests/src/EventTest/EventTest.js +++ b/tests/js-tests/src/EventTest/EventTest.js @@ -253,8 +253,11 @@ var TouchAllAtOnce = EventTest.extend({ var touch = touches[i]; var pos = touch.getLocation(); var id = touch.getID(); - var force = touch.getCurrentForce(); - var maxForce = touch.getMaxForce(); + var force = 0, maxForce = 0; + if (touch.getCurrentForce) { + force = touch.getCurrentForce(); + maxForce = touch.getMaxForce(); + } cc.log("Touch #" + i + ". onTouchesMoved at: " + pos.x + " " + pos.y + " Id:" + id + " current force:" + force + " maximum postible force:" + maxForce); target.update_id(id, pos); } diff --git a/tests/js-tests/src/SceneTest/SceneTest.js b/tests/js-tests/src/SceneTest/SceneTest.js index 30367e8721..820b3f5a2e 100644 --- a/tests/js-tests/src/SceneTest/SceneTest.js +++ b/tests/js-tests/src/SceneTest/SceneTest.js @@ -41,7 +41,7 @@ var SceneTestLayer1 = cc.Layer.extend({ var item1 = new cc.MenuItemFont("Test pushScene", this.onPushScene, this); var item2 = new cc.MenuItemFont("Test pushScene w/transition", this.onPushSceneTran, this); var item3 = new cc.MenuItemFont("Quit", function () { - cc.log("quit!") + cc.log("quit!"); }, this); var item4 = new cc.MenuItemFont("setNotificationNode", function () { var layerTemp = new cc.LayerColor(cc.color(0, 255, 255, 120)); @@ -105,6 +105,7 @@ var SceneTestLayer1 = cc.Layer.extend({ }, onExit:function (sender) { cc.director.setNotificationNode(null); + this._super(); } //CREATE_NODE(SceneTestLayer1); diff --git a/web b/web index d176dc4f74..29e12e52e4 160000 --- a/web +++ b/web @@ -1 +1 @@ -Subproject commit d176dc4f74396746445112d030c2fa63875e5bf8 +Subproject commit 29e12e52e4d8f47aa5a256967613b353fbbb424d From 85812b4f5b90d524b1e269d70baba51d873311c5 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Tue, 10 May 2016 20:35:02 +0800 Subject: [PATCH 2/2] Remove client_no_context_takeover extension in WebSocket (not working on Android/iOS/Mac) --- cocos/network/WebSocket.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 11a0462e26..89da4889ac 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -570,13 +570,10 @@ void WebSocket::onSubThreadStarted() { "permessage-deflate", lws_extension_callback_pm_deflate, - // iOS doesn't support client_no_context_takeover extension in the current version, it will cause iOS connection fail - // It may be a bug of lib websocket iOS build -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + // client_no_context_takeover extension is not supported in the current version, it will cause connection fail + // It may be a bug of lib websocket build +// "permessage-deflate; client_no_context_takeover; client_max_window_bits" "permessage-deflate; client_max_window_bits" -#else - "permessage-deflate; client_no_context_takeover; client_max_window_bits" -#endif }, { "deflate-frame",