Author: ygrego Date: 2015-03-02 13:06:01 +0000 (Mon, 02 Mar 2015) New Revision: 903 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/903 Log: New test method added: "testNextChannel". Modified: oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-03-02 10:08:34 UTC (rev 902) +++ oipf/js/test/VideoBroadcastTest.js 2015-03-02 13:06:01 UTC (rev 903) @@ -148,6 +148,7 @@ videoBroadcastObject.onChannelChangeSucceeded = function(channel) { if (self.assertNotNull(channel)) { console.log("[TEST-RUNNING][Info] Id: vbTestPrevChannel, Label: Switch to precedent channel in channel list, State: Successful"); + console.log(channel.name); resolve("Successfull"); } else { console.log("[TEST-RUNNING][Info] Id: vbTestPrevChannel, Label: Switch to precedent channel in channel list, State: Failure"); @@ -160,6 +161,52 @@ }, + testNextChannel: function(resolve, reject) { + console.log("***************************************************************************************************************************"); + + console.log("[TEST-RUNNING][Info] Id: vbTestNextChannel, Label: Switch to next channel in channel list, State: Pending"); + var videoBroadcastObject = oipfObjectFactory.createVideoBroadcastObject(); + videoBroadcastObject.playstate = 2; + videoBroadcastObject.currentChannel = videoBroadcastObject.getChannelConfig().currentChannel; + videoBroadcastObject.nextChannel(); + + var self = this; + videoBroadcastObject.onPlayStateChange = function(state, error) { + + videoBroadcastObject.playstate = state; + + if (error) { + var errorText = self.error[error]; + console.log("[TEST-RUNNING][Info] Id: vbTestNextChannel, Label: Switch to next channel in channel list, State: Failure"); + + reject("Failure:" + errorText); + } + + }; + + videoBroadcastObject.onChannelChangeError = function(channel, error) { + var errorText = self.error[error]; + console.log("[TEST-RUNNING][Info] Id: vbTestNextChannel, Label: Switch to next channel in channel list, State: Failure"); + + reject("Failure:" + errorText); + }; + + videoBroadcastObject.onChannelChangeSucceeded = function(channel) { + if (self.assertNotNull(channel)) { + console.log("[TEST-RUNNING][Info] Id: vbTestNextChannel, Label: Switch to next channel in channel list, State: Successful"); + console.log(channel.name); + resolve("Successfull"); + } else { + console.log("[TEST-RUNNING][Info] Id: vbTestNextChannel, Label: Switch to next channel in channel list, State: Failure"); + reject("Failure : The channel is null for a unknown reason."); + } + + }; + console.log("***************************************************************************************************************************"); + + + }, + verifWantedPlayState: function (currentObject, object,receivedPlayState, wantedPlayState) { if (currentObject.assertEquals(receivedPlayState, wantedPlayState)) { object.playstate = receivedPlayState;
participants (1)
-
ygregoï¼ users.nuiton.org