Author: ygrego Date: 2015-04-01 21:46:55 +0000 (Wed, 01 Apr 2015) New Revision: 1038 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1038 Log: New tests "testPrevChannelInConnecting", "testPrevChannelInPresenting", "testPrevChannelInStopped" have been added. Modified: oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-04-01 21:17:34 UTC (rev 1037) +++ oipf/js/test/VideoBroadcastTest.js 2015-04-01 21:46:55 UTC (rev 1038) @@ -242,12 +242,38 @@ this.vidBroadObj.bindToCurrentChannel(); }, - /* - * Description: - * Nominal Case - */ - testPrevChannel: function(resolve, reject) { + + testPrevChannelInUnrealized: function(resolve, reject) { + this.vidBroadObj.prevChannel(); + }, + + testPrevChannelInConnecting: function(resolve, reject) { var self = this; + this.addTransition(this.UNREALIZED, this.CONNECTING, function() { + self.vidBroadObj.prevChannel(); + }); + + this.addTransition(this.CONNECTING, this.CONNECTING); + + this.addTransition(this.PRESENTING, this.CONNECTING); + + this.vidBroadObj.onChannelChangeSucceeded = function(channel) { + + if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) { + logTest("State: Successful"); + resolve("Successfull"); + } else { + logTest("State: Failure"); + reject("Failure : The channel is null for a unknown reason or wrong play state."); + } + }; + + this.vidBroadObj.bindToCurrentChannel(); + + }, + + testPrevChannelInPresenting: function(resolve, reject) { + var self = this; this.addTransition(this.UNREALIZED, this.CONNECTING); this.addTransition(this.CONNECTING, this.PRESENTING, function() { @@ -273,6 +299,38 @@ }, + testPrevChannelInStopped: function(resolve, reject) { + var self = this; + + this.addTransition(this.UNREALIZED, this.CONNECTING); + + this.addTransition(this.CONNECTING, this.PRESENTING, function() { + self.vidBroadObj.stop(); + }); + + this.addTransition(this.PRESENTING, this.STOPPED, function() { + self.vidBroadObj.prevChannel(); + }); + + this.addTransition(this.STOPPED, this.CONNECTING); + + this.addTransition(this.CONNECTING, this.PRESENTING); + + this.vidBroadObj.onChannelChangeSucceeded = function(channel) { + + if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) { + logTest("State: Successful"); + resolve("Successfull"); + } else { + logTest("State: Failure"); + reject("Failure : The channel is null for a unknown reason or wrong play state."); + } + }; + + this.vidBroadObj.bindToCurrentChannel(); + + }, + // testPrevChannel: function(resolve, reject) { // var self = this; //