Author: ygrego Date: 2015-04-01 12:12:09 +0000 (Wed, 01 Apr 2015) New Revision: 1014 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1014 Log: Modification of method "onChangeState", addition of block "if else" in main block "else" method and some comments for the method. Modified: oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-04-01 10:30:55 UTC (rev 1013) +++ oipf/js/test/VideoBroadcastTest.js 2015-04-01 12:12:09 UTC (rev 1014) @@ -72,7 +72,17 @@ // this.vidBroadObj.release(); //Useful for test on tv plateform this.vidBroadObj.removeEventListener("PlayStateChange", this.onPlayStateChange); }, - + + /* + * + * @param {type} resolve + * @param {type} reject + * @param {type} newState + * @param {type} errorCode + * @returns {undefined} + * FIX-ME: Yannis - 01/04/2015 - The verification done in else clause + * could be reviewed. + */ onChangeState: function(resolve, reject, newState, errorCode) { var currentTransition = this.transitions[this.currentIndex]; var begin = currentTransition.begin; @@ -90,7 +100,14 @@ } } else { - reject("Invalid state"); + // + if (begin == this.CONNECTING + && this.transitions.length == this.currentIndex + 1) { + reject("Untestable case for the moment."); + } else { + reject("Invalid state"); + } + } },