From 67b1ad449fa79339d382390d7f08557ec0f90025 Mon Sep 17 00:00:00 2001 From: Piotr Kosko Date: Fri, 27 Apr 2018 08:18:39 +0200 Subject: [PATCH] [Common] Disabled error log in case of Power special message [Verification] Code compiles without errors. Below code works without any JS errors (special Power chromium message is ignored): tizen.power.request("SCREEN", "SCREEN_NORMAL"); tizen.power.release("SCREEN"); TCT passrate for Power module is 100% (A & M). Change-Id: I2b2cf3d97442389b722db8a9943e5c98f1a0d0cf Signed-off-by: Piotr Kosko --- src/utils/utils_api.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/utils_api.js b/src/utils/utils_api.js index c6f0c6dc..90f7a5c8 100644 --- a/src/utils/utils_api.js +++ b/src/utils/utils_api.js @@ -1029,7 +1029,18 @@ var NativeManager = function(extension) { try { var msg = JSON_.parse(json); } catch (error) { + // Because of special handling of power lock in chromium, the special signals: + // - __DisableChromiumInternalPowerLock + // - __EnableChromiumInternalPowerLock + // could occur. In such cases we are silently ignroing those messages. + // TODO This is workaround for missing patch in chromium-efl package which should handle + // this special message and don't forward it to webapi JS. After chromium-efl will + // be updated, below checking should be removed. + if (json.substring(0,2) === '__') { + return; + } xwalk.utils.error('Invalid JSON received: ' + json); + return; } var id; -- 2.34.1