Author: ygrego Date: 2015-04-17 14:40:44 +0000 (Fri, 17 Apr 2015) New Revision: 1222 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1222 Log: Deletion of transitions additions and call to "bindTocurrentCahnnel" for all methods of test in keeping with "getVolume" and "setVolume". Modified: oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-04-17 14:37:50 UTC (rev 1221) +++ oipf/js/test/VideoBroadcastTest.js 2015-04-17 14:40:44 UTC (rev 1222) @@ -578,120 +578,78 @@ */ testSetVolume: function(resolve, reject) { var volume = 15; - var self = this; - this.addTransition(this.UNREALIZED, this.CONNECTING); + var done = this.vidBroadObj.setVolume(volume); - this.addTransition(this.CONNECTING, this.PRESENTING, function() { - var done = self.vidBroadObj.setVolume(volume); - if (done && self.assertEquals(volume, self.vidBroadObj._volume)) { - resolve(); - } else { - reject(); - } - }); - - this.vidBroadObj.bindToCurrentChannel(); + if (done && this.assertEquals(volume, this.vidBroadObj._volume)) { + resolve(); + } else { + reject(); + } }, testSetVolumeWithoutArgument: function(resolve, reject) { - var self = this; - this.addTransition(this.UNREALIZED, this.CONNECTING); + var done = this.vidBroadObj.setVolume(); - this.addTransition(this.CONNECTING, this.PRESENTING, function() { - var done = self.vidBroadObj.setVolume(); - if (done) { - reject(); - } else { - resolve(); - } - }); - - this.vidBroadObj.bindToCurrentChannel(); + if (done) { + reject(); + } else { + resolve(); + } }, testSetVolumeWithFloatArgument: function(resolve, reject) { var volume = 15.8; - var self = this; - this.addTransition(this.UNREALIZED, this.CONNECTING); + var done = this.vidBroadObj.setVolume(volume); - this.addTransition(this.CONNECTING, this.PRESENTING, function() { - var done = self.vidBroadObj.setVolume(volume); - if (done || self.assertEquals(volume, self.vidBroadObj._volume)) { - reject("[Stub]Wrong Implementation."); - } else { - resolve(); - } - }); - - this.vidBroadObj.bindToCurrentChannel(); + if (done || this.assertEquals(volume, this.vidBroadObj._volume)) { + reject("[Stub]Wrong Implementation."); + } else { + resolve(); + } }, testSetVolumeWithFloatUnderBoundMin: function(resolve, reject) { var volume = -15.8; - var self = this; - this.addTransition(this.UNREALIZED, this.CONNECTING); + var done = this.vidBroadObj.setVolume(volume); - this.addTransition(this.CONNECTING, this.PRESENTING, function() { - var done = self.vidBroadObj.setVolume(volume); - if (done || self.assertEquals(volume, self.vidBroadObj._volume)) { - reject("[Stub]Wrong Implementation."); - } else { - resolve(); - } - }); - - this.vidBroadObj.bindToCurrentChannel(); + if (done || this.assertEquals(volume, this.vidBroadObj._volume)) { + reject("[Stub]Wrong Implementation."); + } else { + resolve(); + } }, testSetVolumeWithFloatAboveBoundMax: function(resolve, reject) { var volume = 151.74; - var self = this; - this.addTransition(this.UNREALIZED, this.CONNECTING); + var done = this.vidBroadObj.setVolume(volume); - this.addTransition(this.CONNECTING, this.PRESENTING, function() { - var done = self.vidBroadObj.setVolume(volume); - if (done || self.assertEquals(volume, self.vidBroadObj._volume)) { - reject("[Stub]Wrong Implementation."); - } else { - resolve(); - } - }); - - this.vidBroadObj.bindToCurrentChannel(); + if (done || this.assertEquals(volume, this.vidBroadObj._volume)) { + reject("[Stub]Wrong Implementation."); + } else { + resolve(); + } }, testSetVolumeWithValueUnderBoundMin: function(resolve, reject) { var volume = -15; - var self = this; - this.addTransition(this.UNREALIZED, this.CONNECTING); + var done = this.vidBroadObj.setVolume(volume); - this.addTransition(this.CONNECTING, this.PRESENTING, function() { - var done = self.vidBroadObj.setVolume(volume); - if (done && self.assertEquals(volume, self.vidBroadObj._volume)) { - reject(); - } else { - resolve(); - } - }); - - this.vidBroadObj.bindToCurrentChannel(); + if (done && this.assertEquals(volume, this.vidBroadObj._volume)) { + reject(); + } else { + resolve(); + } }, testSetVolumeWithValueAboveBoundMax: function(resolve, reject) { var volume = 105; - var self = this; - this.addTransition(this.UNREALIZED, this.CONNECTING); + var done = this.vidBroadObj.setVolume(volume); - this.addTransition(this.CONNECTING, this.PRESENTING, function() { - var done = self.vidBroadObj.setVolume(volume); - if (done && self.assertEquals(volume, self.vidBroadObj._volume)) { - reject(); - } else { - resolve(); - } - }); - - this.vidBroadObj.bindToCurrentChannel(); + if (done && this.assertEquals(volume, this.vidBroadObj._volume)) { + reject(); + } else { + resolve(); + } }, // testSetVolume: function(resolve, reject) { @@ -713,24 +671,18 @@ */ testGetVolume: function(resolve, reject) { var initialVolume = 15; - var self = this; - this.addTransition(this.UNREALIZED, this.CONNECTING); + var done = this.vidBroadObj.setVolume(initialVolume); - this.addTransition(this.CONNECTING, this.PRESENTING, function() { - var done = self.vidBroadObj.setVolume(initialVolume); - var finalVolume = self.vidBroadObj.getVolume(); - - if (done && self.assertEquals(initialVolume, self.vidBroadObj._volume) - && self.assertEquals(initialVolume, finalVolume) - && self.assertEquals(self.vidBroadObj._volume, finalVolume)) { - - resolve(); - } else { - reject(); - } - }); - - this.vidBroadObj.bindToCurrentChannel(); + var finalVolume = this.vidBroadObj.getVolume(); + + if (done && this.assertEquals(initialVolume, this.vidBroadObj._volume) + && this.assertEquals(initialVolume, finalVolume) + && this.assertEquals(this.vidBroadObj._volume, finalVolume)) { + + resolve(); + } else { + reject(); + } }, // testGetVolume: function(resolve, reject) {
participants (1)
-
ygregoï¼ users.nuiton.org