Author: ygrego Date: 2015-03-31 12:45:06 +0000 (Tue, 31 Mar 2015) New Revision: 1003 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1003 Log: The following methods have been added: "testSetChannelInUnrealized", "testSetChannelInConnecting", "testSetChannelInConnectingWithNull", "testSetChannelInPresenting", "testSetChannelInPresentingWithNull", "testSetChannelInStopped", "testSetChannelInStoppedWithNull". Modified: oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-03-31 12:43:59 UTC (rev 1002) +++ oipf/js/test/VideoBroadcastTest.js 2015-03-31 12:45:06 UTC (rev 1003) @@ -618,6 +618,82 @@ // reject(); // } // }, + testSetChannelInUnrealized: function(resolve, reject) { + var self = this; + + this.addTransition(this.UNREALIZED, this.CONNECTING); + + this.addTransition(this.CONNECTING, this.PRESENTING, function() { + self.vidBroadObj.setChannel(self.channel); + }); + + this.addTransition(this.PRESENTING, this.CONNECTING); + this.addTransition(this.CONNECTING, this.PRESENTING); + + this.vidBroadObj.onChannelChangeSucceeded = function(channel) { + + if (self.assertNotNull(channel) && self.assertEquals(self.vidBroadObj.playState, self.PRESENTING)) { + logTest("State: Successful"); + resolve("Success"); + } else { + logTest("State: Failure"); + reject("Failure : The channel is null for a unknown reason or wrong play state."); + } + }; + + this.vidBroadObj.bindToCurrentChannel(); + }, + + testSetChannelInConnecting: function(resolve, reject) { + var self = this; + + this.addTransition(this.UNREALIZED, this.CONNECTING); + + this.addTransition(this.CONNECTING, this.PRESENTING, function() { + self.vidBroadObj.setChannel(self.channel); + }); + + this.addTransition(this.PRESENTING, this.CONNECTING); + this.addTransition(this.CONNECTING, this.PRESENTING); + + this.vidBroadObj.onChannelChangeSucceeded = function(channel) { + + if (self.assertNotNull(channel) && self.assertEquals(self.vidBroadObj.playState, self.PRESENTING)) { + logTest("State: Successful"); + resolve("Success"); + } else { + logTest("State: Failure"); + reject("Failure : The channel is null for a unknown reason or wrong play state."); + } + }; + + this.vidBroadObj.bindToCurrentChannel(); + }, + testSetChannelInConnectingWithNull: function(resolve, reject) { + var self = this; + + this.addTransition(this.UNREALIZED, this.CONNECTING); + + this.addTransition(this.CONNECTING, this.PRESENTING, function() { + self.vidBroadObj.setChannel(self.channel); + }); + + this.addTransition(this.PRESENTING, this.CONNECTING); + this.addTransition(this.CONNECTING, this.PRESENTING); + + this.vidBroadObj.onChannelChangeSucceeded = function(channel) { + + if (self.assertNotNull(channel) && self.assertEquals(self.vidBroadObj.playState, self.PRESENTING)) { + logTest("State: Successful"); + resolve("Success"); + } else { + logTest("State: Failure"); + reject("Failure : The channel is null for a unknown reason or wrong play state."); + } + }; + + this.vidBroadObj.bindToCurrentChannel(); + }, testSetChannelInPresenting: function(resolve, reject) { var self = this; @@ -644,7 +720,6 @@ this.vidBroadObj.bindToCurrentChannel(); }, - testSetChannelInPresentingWithNull: function(resolve, reject) { var self = this; @@ -664,5 +739,51 @@ this.vidBroadObj.setChannel(null); + }, + + testSetChannelInStopped: function(resolve, reject) { + var self = this; + + this.addTransition(this.UNREALIZED, this.CONNECTING); + + this.addTransition(this.CONNECTING, this.PRESENTING, function() { + self.vidBroadObj.setChannel(self.channel); + }); + + this.addTransition(this.PRESENTING, this.CONNECTING); + this.addTransition(this.CONNECTING, this.PRESENTING); + + this.vidBroadObj.onChannelChangeSucceeded = function(channel) { + + if (self.assertNotNull(channel) && self.assertEquals(self.vidBroadObj.playState, self.PRESENTING)) { + logTest("State: Successful"); + resolve("Success"); + } else { + logTest("State: Failure"); + reject("Failure : The channel is null for a unknown reason or wrong play state."); + } + }; + + this.vidBroadObj.bindToCurrentChannel(); + }, + testSetChannelInStoppedWithNull: function(resolve, reject) { + var self = this; + + this.addTransition(this.PRESENTING, this.CONNECTING); + this.addTransition(this.CONNECTING, this.PRESENTING); + + this.vidBroadObj.onChannelChangeSucceeded = function(channel) { + + if (self.assertNotNull(channel) && self.assertEquals(self.vidBroadObj.playState, self.PRESENTING)) { + logTest("State: Successful"); + resolve("Success"); + } else { + logTest("State: Failure"); + reject("Failure : The channel is null for a unknown reason or wrong play state."); + } + }; + + this.vidBroadObj.setChannel(null); + } }); \ No newline at end of file
participants (1)
-
ygregoï¼ users.nuiton.org