From ad98bebf5560ba79595433a818db45eba6794ba9 Mon Sep 17 00:00:00 2001 From: David LaPalomento Date: Tue, 5 Mar 2013 13:38:47 -0500 Subject: [PATCH] Reformat `var` statements Declare them in a single line at the top of the function and initialize them later. --- test/unit/controls.js | 72 +++++++++++++++++++--------------------- test/unit/media.html5.js | 12 +++---- 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/test/unit/controls.js b/test/unit/controls.js index 3ee5de7ef..fee1eec96 100644 --- a/test/unit/controls.js +++ b/test/unit/controls.js @@ -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, '', diff --git a/test/unit/media.html5.js b/test/unit/media.html5.js index 92cc3fa9a..eb7c0b763 100644 --- a/test/unit/media.html5.js +++ b/test/unit/media.html5.js @@ -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());