1
0
mirror of https://github.com/videojs/video.js.git synced 2025-03-03 15:12:49 +02:00

Reformat var statements

Declare them in a single line at the top of the function and initialize them later.
This commit is contained in:
David LaPalomento 2013-03-05 13:38:47 -05:00
parent b662139708
commit ad98bebf55
2 changed files with 41 additions and 43 deletions

72
test/unit/controls.js vendored
View File

@ -1,51 +1,49 @@
module('Controls');
test('should hide volume control if it\'s not supported', function() {
var
noop = function(){},
player = {
id: noop,
on: noop,
ready: noop,
tech: {
features: {
volumeControl: false
}
var noop, player, volumeControl, muteToggle;
noop = function(){};
player = {
id: noop,
on: noop,
ready: noop,
tech: {
features: {
volumeControl: false
}
},
volumeControl = new vjs.VolumeControl(player),
muteToggle = new vjs.MuteToggle(player);
}
};
volumeControl = new vjs.VolumeControl(player);
muteToggle = new vjs.MuteToggle(player);
equal(volumeControl.el().style.display, 'none', 'volumeControl is not hidden');
equal(muteToggle.el().style.display, 'none', 'muteToggle is not hidden');
});
test('should test and toggle volume control on `loadstart`', function(){
var
noop = function(){},
listeners = [],
player = {
id: noop,
on: function(event, callback){
listeners.push(callback);
},
ready: noop,
volume: function(){
return 1;
},
muted: function(){
return false;
},
tech: {
features: {
volumeControl: true
}
}
var noop, listeners, player, volumeControl, muteToggle;
noop = function(){};
listeners = [];
player = {
id: noop,
on: function(event, callback){
listeners.push(callback);
},
volumeControl = new vjs.VolumeControl(player),
muteToggle = new vjs.MuteToggle(player);
ready: noop,
volume: function(){
return 1;
},
muted: function(){
return false;
},
tech: {
features: {
volumeControl: true
}
}
};
volumeControl = new vjs.VolumeControl(player);
muteToggle = new vjs.MuteToggle(player);
equal(volumeControl.el().style.display,
'',

View File

@ -1,12 +1,12 @@
module('HTML5');
test('should detect whether the volume can be changed', function(){
var
testVid = vjs.TEST_VID,
ConstVolumeVideo = function(){
this.volume = 1;
this.__defineSetter__('volume', function(){});
};
var testVid, ConstVolumeVideo;
testVid = vjs.TEST_VID;
ConstVolumeVideo = function(){
this.volume = 1;
this.__defineSetter__('volume', function(){});
};
vjs.TEST_VID = new ConstVolumeVideo();
ok(!vjs.Html5.canControlVolume());