Author: ygrego Date: 2015-04-01 22:18:29 +0000 (Wed, 01 Apr 2015) New Revision: 1041 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1041 Log: New tests "testNextChannelInUnrealized", "testNextChannelInConnecting", "testNextChannelInPresenting", "testNextChannelInStopped" have been added. Modified: oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-04-01 22:15:02 UTC (rev 1040) +++ oipf/js/test/VideoBroadcastTest.js 2015-04-01 22:18:29 UTC (rev 1041) @@ -353,13 +353,37 @@ // // }, - /* - * Description: - * Nominal Case - */ - testNextChannel: function(resolve, reject) { + testNextChannelInUnrealized: function(resolve, reject) { + this.vidBroadObj.nextChannel(); + }, + + testNextChannelInConnecting: function(resolve, reject) { var self = this; + this.addTransition(this.UNREALIZED, this.CONNECTING, function() { + self.vidBroadObj.nextChannel(); + }); + 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(); + + }, + + testNextChannelInPresenting: function(resolve, reject) { + var self = this; this.addTransition(this.UNREALIZED, this.CONNECTING); this.addTransition(this.CONNECTING, this.PRESENTING, function() { @@ -380,8 +404,26 @@ reject("Failure : The channel is null for a unknown reason or wrong play state."); } }; - this.addTransition(this.PRESENTING, this.CONNECTING); + + this.vidBroadObj.bindToCurrentChannel(); + }, + + testNextChannelInStopped: 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.nextChannel(); + }); + + this.addTransition(this.STOPPED, this.CONNECTING); + this.addTransition(this.CONNECTING, this.PRESENTING); this.vidBroadObj.onChannelChangeSucceeded = function(channel) { @@ -395,8 +437,8 @@ } }; - this.vidBroadObj.prevChannel(); this.vidBroadObj.bindToCurrentChannel(); + }, // testNextChannel: function(resolve, reject) {
participants (1)
-
ygregoï¼ users.nuiton.org