diff --git a/static/script-tests/lib/ondevicetestconfigvalidate.js b/static/script-tests/lib/ondevicetestconfigvalidate.js index c051867d..7e66b7f3 100644 --- a/static/script-tests/lib/ondevicetestconfigvalidate.js +++ b/static/script-tests/lib/ondevicetestconfigvalidate.js @@ -3,7 +3,7 @@ * Return (Bool) True if test can be run on this device, otherwise false */ -var onDeviceTestConfigValidation = { +window.onDeviceTestConfigValidation = { removeTestsForIncompatibleDevices : function( modifiers, testObject ){ //this indicates we are testing on a device and want to exclude tests based on configs @@ -13,7 +13,7 @@ var onDeviceTestConfigValidation = { for( var m0 in modifiers ){ //look for each modifier in the actual device configuration - if( window.deviceConfig.modules.modifiers.indexOf( modifiers[ m0 ] ) == -1 ){ + if( window.deviceConfig.modules.modifiers.indexOf( modifiers[ m0 ] ) === -1 ){ //if a modifier is not found then this is not a valid test for( var tr in testObject.prototype ){ if( tr.indexOf( "test" ) === 0 ){ diff --git a/static/script-tests/lib/queuedrequire.js b/static/script-tests/lib/queuedrequire.js index a38a40e6..73dcac61 100644 --- a/static/script-tests/lib/queuedrequire.js +++ b/static/script-tests/lib/queuedrequire.js @@ -56,7 +56,7 @@ function __qr(){ requireModules[name] = arguments; originalRequireDefine.apply(require, arguments); }; - require.load = function(moduleName, contextName) { + require.load = function(moduleName) { var module = requireModules[moduleName]; if(module) { require.s.contexts._.specified[moduleName] = true; diff --git a/static/script-tests/tests/class.js b/static/script-tests/tests/class.js index 8b964b79..d3505024 100644 --- a/static/script-tests/tests/class.js +++ b/static/script-tests/tests/class.js @@ -66,12 +66,6 @@ assertEquals("Example method returns expected value", "method", obj.returnMethodString()); assertEquals("Constructor sets expected value", "value", obj._variable); - - var ExtendedTwiceClass = ExtendedClass.extend({ - overridableFunction: function() { - return "subclass"; - } - }); }); }; @@ -140,4 +134,4 @@ }); }; -})(); +})(); diff --git a/static/script-tests/tests/devices/anim/styletopleft.js b/static/script-tests/tests/devices/anim/styletopleft.js index 662b7730..418c5d13 100644 --- a/static/script-tests/tests/devices/anim/styletopleft.js +++ b/static/script-tests/tests/devices/anim/styletopleft.js @@ -23,9 +23,6 @@ */ (function() { - // How many milliseconds to give a 'no animation' transition to complete - var noAnimToleranceMs = 20; - // The default animation duration in tween.js is 840, so it's reasonable to think we should only need to tick for // 840 to get the onComplete callback to be fired. However the callback passed to shifty that invokes onComplete // doesn't run until tick 866.666666666667. This seems to be because the Shifty timeoutHandler waits for the diff --git a/static/script-tests/tests/devices/broadcastsource/hbbtvsourcetest.js b/static/script-tests/tests/devices/broadcastsource/hbbtvsourcetest.js index f70929f1..bcb29fad 100644 --- a/static/script-tests/tests/devices/broadcastsource/hbbtvsourcetest.js +++ b/static/script-tests/tests/devices/broadcastsource/hbbtvsourcetest.js @@ -288,7 +288,7 @@ var self = this; var config = getGenericHBBTVConfig(); - queuedApplicationInit(queue, 'lib/mockapplication', ['antie/events/tunerpresentingevent'], function(application, TunerPresentingEvent) { + queuedApplicationInit(queue, 'lib/mockapplication', [], function(application) { var device = application.getDevice(); device.createBroadcastSource(); diff --git a/static/script-tests/tests/devices/device.js b/static/script-tests/tests/devices/device.js index f362fab4..d3e49cd5 100644 --- a/static/script-tests/tests/devices/device.js +++ b/static/script-tests/tests/devices/device.js @@ -53,8 +53,8 @@ queuedApplicationInit( queue, "lib/mockapplication", - ["antie/devices/device","antie/class"], - function(application, Device, Class) { + ["antie/devices/device"], + function(application, Device) { var device = new Device(antie.framework.deviceConfiguration); assertFalse(device.isBroadcastSourceSupported()); }); @@ -66,8 +66,8 @@ queuedApplicationInit( queue, "lib/mockapplication", - ["antie/devices/device","antie/class"], - function(application, Device, Class) { + ["antie/devices/device"], + function(application, Device) { var device = new Device(antie.framework.deviceConfiguration); assertException("Broadcast API not available on this device.", function() { device.createBroadcastSource(); @@ -102,7 +102,7 @@ this.DeviceTest.prototype.testGetConfig = function(queue) { expectAsserts(2); - queuedApplicationInit(queue, "lib/mockapplication", ["antie/devices/device","antie/application"], function(application, Device, Application) { + queuedApplicationInit(queue, "lib/mockapplication", ["antie/devices/device"], function(application, Device) { var callbacks = { onSuccess: this.sandbox.stub(), onError: this.sandbox.stub() @@ -110,7 +110,6 @@ assertNoException(function() { Device.load(antie.framework.deviceConfiguration, callbacks); }); - var application = Application.getCurrentApplication(); var device = application.getDevice(); assertSame(antie.framework.deviceConfiguration, device.getConfig()); }); diff --git a/static/script-tests/tests/devices/exit/destroyapplication.js b/static/script-tests/tests/devices/exit/destroyapplication.js index ecd29e0d..6d6a9e4f 100644 --- a/static/script-tests/tests/devices/exit/destroyapplication.js +++ b/static/script-tests/tests/devices/exit/destroyapplication.js @@ -39,7 +39,7 @@ * requesting the correct MIME type for the HBBTV application manager. */ this.DestroyApplicationTest.prototype.testGetOipfObjectFactory = function(queue) { - expectAsserts(1); + expectAsserts(2); var config = {"modules":{"base":"antie/devices/browserdevice","modifiers":["antie/devices/exit/destroyapplication"]},"input":{"map":{}},"layouts":[{"width":960,"height":540,"module":"fixtures/layouts/default","classes":["browserdevice540p"]}],"deviceConfigurationKey":"devices-html5-1"}; @@ -47,11 +47,11 @@ queuedApplicationInit(queue, "lib/mockapplication", [], function(application) { var expectedMimeType = 'application/oipfApplicationManager'; - + // Mimic the object provided by HBBTVs window.oipfObjectFactory = { isObjectSupported: function(mimeType) { - //assertEquals('Requested MIME type is as expected', expectedMimeType, mimeType); + assertEquals('Requested MIME type is as expected', expectedMimeType, mimeType); return false; } }; diff --git a/static/script-tests/tests/devices/media/html5.js b/static/script-tests/tests/devices/media/html5.js index 53ec4b68..c4de86ee 100644 --- a/static/script-tests/tests/devices/media/html5.js +++ b/static/script-tests/tests/devices/media/html5.js @@ -174,8 +174,8 @@ this.HTML5Test.prototype.testRenderCausesPlayEventListenerCallbackWithAPlayMediaEvent = function (queue) { expectAsserts(4); var self = this; - queuedApplicationInit(queue, 'lib/mockapplication', ["antie/devices/media/html5", "antie/events/mediaevent", "antie/devices/media/mediainterface"], - function(application, HTML5Player, MediaEvent, MediaInterface) { + queuedApplicationInit(queue, 'lib/mockapplication', ["antie/devices/media/html5", "antie/events/mediaevent"], + function(application, HTML5Player, MediaEvent) { var callbackStub = self.sandbox.stub(); diff --git a/static/script-tests/tests/devices/media/mediainterface.js b/static/script-tests/tests/devices/media/mediainterface.js index dae6eedc..54a78320 100644 --- a/static/script-tests/tests/devices/media/mediainterface.js +++ b/static/script-tests/tests/devices/media/mediainterface.js @@ -33,15 +33,6 @@ this.sandbox.restore(); }; - this.MediaInterfaceTest.prototype.testMediaInterfaceInitDoesNotThrowAnExceptionWhenCalled = function (queue) { - expectAsserts(1); - queuedApplicationInit(queue, 'lib/mockapplication', ["antie/devices/media/mediainterface"], function(application, MediaInterface) { - assertNoException(function() { - new MediaInterface('id', 'video', function(){}); - }); - }); - }; - this.MediaInterfaceTest.prototype.testMediaInterfaceRenderDoesNotThrowAnExceptionWhenCalled = function (queue) { expectAsserts(1); queuedApplicationInit(queue, 'lib/mockapplication', ["antie/devices/media/mediainterface"], function(application, MediaInterface) { diff --git a/static/script-tests/tests/devices/media/samsung_maple.js b/static/script-tests/tests/devices/media/samsung_maple.js index 92054dab..be19e6cf 100644 --- a/static/script-tests/tests/devices/media/samsung_maple.js +++ b/static/script-tests/tests/devices/media/samsung_maple.js @@ -464,11 +464,11 @@ this.SamsungMapleTest.prototype.testThatStopIsCalledOnThePlayerPluginWhenAHideEventIsFired = function (queue) { expectAsserts(1); var self = this; - queuedApplicationInit(queue, 'lib/mockapplication', ["antie/devices/media/samsung_maple", "antie/events/mediaevent"], - function(application, SamsungPlayer, MediaErrorEvent) { + queuedApplicationInit(queue, 'lib/mockapplication', [], + function(application) { var callbackStub = self.sandbox.stub(); - var mediaInterface = application.getDevice().createMediaInterface("id", "video", callbackStub); + application.getDevice().createMediaInterface("id", "video", callbackStub); var event = new CustomEvent('hide'); window.dispatchEvent(event); diff --git a/static/script-tests/tests/devices/mediaplayer/commontests.js b/static/script-tests/tests/devices/mediaplayer/commontests.js index fe0f5cb8..ba609e05 100644 --- a/static/script-tests/tests/devices/mediaplayer/commontests.js +++ b/static/script-tests/tests/devices/mediaplayer/commontests.js @@ -188,7 +188,7 @@ window.commonTests.mediaPlayer.all.mixinTests = function (testCase, mediaPlayerD return test; }; - var makeDeviceErrorGetsReported = function (setup, deviceEventName) { + var makeDeviceErrorGetsReported = function (setup) { var test = function (queue) { expectAsserts(4); doTest(this, queue, function (MediaPlayer) { @@ -897,7 +897,7 @@ window.commonTests.mediaPlayer.all.mixinTests = function (testCase, mediaPlayerD var makeStandardErrorWhileMakingCallInEmptyAndErrorStatesIsLoggedTest = function(method, args) { return function(queue) { expectAsserts(2); - doTest(this, queue, function (MediaPlayer) { + doTest(this, queue, function (MediaPlayer) { //jshint ignore:line var errorStub = this.sandbox.stub(); this.sandbox.stub(this.device, "getLogger").returns({error: errorStub}); try { diff --git a/static/script-tests/tests/devices/mediaplayer/mediaplayer.js b/static/script-tests/tests/devices/mediaplayer/mediaplayer.js index 34fad395..aa9b48f1 100644 --- a/static/script-tests/tests/devices/mediaplayer/mediaplayer.js +++ b/static/script-tests/tests/devices/mediaplayer/mediaplayer.js @@ -33,15 +33,6 @@ this.sandbox.restore(); }; - this.MediaPlayerTest.prototype.testMediaPlayerInitDoesNotThrowAnExceptionWhenCalled = function (queue) { - expectAsserts(1); - queuedRequire(queue, ["antie/devices/mediaplayer/mediaplayer"], function(MediaPlayer) { - assertNoException(function() { - new MediaPlayer(); - }); - }); - }; - var createSubClass = function(MediaPlayer) { var range = { start: 0, end: 100 }; var currentTime = 0; diff --git a/static/script-tests/tests/formatter.js b/static/script-tests/tests/formatter.js index c9964655..e134b396 100644 --- a/static/script-tests/tests/formatter.js +++ b/static/script-tests/tests/formatter.js @@ -42,14 +42,6 @@ }); }; - this.FormatterTest.prototype.testConstructorAcceptsEmptyArguments = function(queue) { - expectAsserts(1); - - queuedRequire(queue, ["antie/formatter"], function(Formatter) { - assertNoException(function() { new Formatter(); }); - }); - }; - this.FormatterTest.prototype.testNonOverriddenFormatThrowsException = function(queue) { expectAsserts(1); diff --git a/static/script-tests/tests/runtimecontext.js b/static/script-tests/tests/runtimecontext.js index b5d54330..917c4a80 100644 --- a/static/script-tests/tests/runtimecontext.js +++ b/static/script-tests/tests/runtimecontext.js @@ -27,14 +27,14 @@ this.RuntimeContextTest.prototype.testGetApplicationWhenNoApplicationIsSet = function(queue) { expectAsserts(1); - DoTest(queue, function(RuntimeContext) { + doTest(queue, function(RuntimeContext) { assertEquals(undefined, RuntimeContext.getCurrentApplication()); }); }; this.RuntimeContextTest.prototype.testSetApplication = function(queue) { expectAsserts(1); - DoTest(queue, function(RuntimeContext) { + doTest(queue, function(RuntimeContext) { var mockApplication = {}; RuntimeContext.setCurrentApplication(mockApplication); assertEquals(mockApplication, RuntimeContext.getCurrentApplication()); @@ -43,7 +43,7 @@ this.RuntimeContextTest.prototype.testSetApplicationTwiceCausesError = function(queue) { expectAsserts(1); - DoTest(queue, function(RuntimeContext) { + doTest(queue, function(RuntimeContext) { RuntimeContext.setCurrentApplication({}); assertException(function () { RuntimeContext.setCurrentApplication({}); @@ -54,7 +54,7 @@ this.RuntimeContextTest.prototype.testClearApplication = function(queue) { expectAsserts(1); - DoTest(queue, function(RuntimeContext) { + doTest(queue, function(RuntimeContext) { RuntimeContext.setCurrentApplication({}); RuntimeContext.clearCurrentApplication(); assertEquals(undefined, RuntimeContext.getCurrentApplication()); @@ -63,7 +63,7 @@ this.RuntimeContextTest.prototype.testGetDevice = function(queue) { expectAsserts(1); - DoTest(queue, function(RuntimeContext) { + doTest(queue, function(RuntimeContext) { var mockDevice = {}; var mockApplication = { getDevice: function () { @@ -76,7 +76,7 @@ }; // Helper - function DoTest (queue, test) { + function doTest (queue, test) { queuedRequire(queue, ["antie/runtimecontext"], function(RuntimeContext) { // Make sure the class under test is available var original = RuntimeContext.getCurrentApplication(); RuntimeContext.clearCurrentApplication(); // Start from scratch each time diff --git a/static/script-tests/tests/widgets/carousel.js b/static/script-tests/tests/widgets/carousel.js index fdda1739..d6a2867a 100644 --- a/static/script-tests/tests/widgets/carousel.js +++ b/static/script-tests/tests/widgets/carousel.js @@ -55,7 +55,7 @@ function stubUnstubbedFunctions(Class) { var prototype, propertyName, property; prototype = Class.prototype; - for (propertyName in prototype) { + for (propertyName in prototype) { //jshint ignore:line property = prototype[propertyName]; if ((typeof property === 'function') && !(property.restore && property.restore.sinon) && propertyName !== 'self') { self.sandbox.stub(prototype, propertyName); @@ -210,7 +210,7 @@ this.CarouselTest.prototype.testGetChildWidgetWithMaskIdCallsCore = function (queue) { var self = this; - function testFunction(application, Carousel, WidgetStrip, Mask, Navigator, Button, Container, CarouselCore) { + function testFunction(application, Carousel, WidgetStrip, Mask, Navigator, Button, Container, CarouselCore) { //jshint ignore:line var carousel, widget; stubClassPrototypes(self, [WidgetStrip, Mask, Button, Navigator, Container]); carousel = new Carousel(); @@ -222,7 +222,7 @@ this.CarouselTest.prototype.testGetChildWidgetWithNonMaskIdCallsWidgetStrip = function (queue) { var self = this; - function testFunction(application, Carousel, WidgetStrip, Mask, Navigator, Button, Container, CarouselCore) { + function testFunction(application, Carousel, WidgetStrip, Mask, Navigator, Button, Container, CarouselCore) { //jshint ignore:line var carousel; self.sandbox.stub(WidgetStrip.prototype, 'getChildWidget'); stubClassPrototypes(self, [WidgetStrip, Mask, Button, Navigator, Container]); diff --git a/static/script-tests/tests/widgets/carousel/navigators/testhelpers/navigator.js b/static/script-tests/tests/widgets/carousel/navigators/testhelpers/navigator.js index 1009df59..ffc67938 100644 --- a/static/script-tests/tests/widgets/carousel/navigators/testhelpers/navigator.js +++ b/static/script-tests/tests/widgets/carousel/navigators/testhelpers/navigator.js @@ -39,7 +39,7 @@ require.def('tests/widgets/navigators/testhelpers/navigator', function stubUnstubbedFunctions(Class) { var prototype, propertyName, property; prototype = Class.prototype; - for (propertyName in prototype) { + for (propertyName in prototype) { //jshint ignore:line property = prototype[propertyName]; if ((typeof property === 'function') && !(property.restore && property.restore.sinon) && propertyName !== 'self') { self.sandbox.stub(prototype, propertyName); diff --git a/static/script-tests/tests/widgets/horizontalcarousel.js b/static/script-tests/tests/widgets/horizontalcarousel.js index 7ccaa71c..189bbee2 100644 --- a/static/script-tests/tests/widgets/horizontalcarousel.js +++ b/static/script-tests/tests/widgets/horizontalcarousel.js @@ -184,8 +184,8 @@ queuedApplicationInit( queue, "lib/mockapplication", - ["antie/widgets/horizontalcarousel", "antie/widgets/list", "antie/widgets/button"], - function(application, HorizontalCarousel, List, Button) { + ["antie/widgets/horizontalcarousel", "antie/widgets/list"], + function(application, HorizontalCarousel, List) { var widget = new HorizontalCarousel("id"); widget.setRenderMode(List.RENDER_MODE_CONTAINER); var device = application.getDevice();