From: Rick Waldron Date: Mon, 8 Aug 2011 15:17:47 +0000 (-0400) Subject: [#678] Initial failing tests for implementation X-Git-Tag: v0.8^2~18^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f3902cdf77fadb6d5ea7558bfeb1a439f27d8764;p=popcorn-js.git [#678] Initial failing tests for implementation --- diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index 7d19d05..545f39b 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -483,7 +483,7 @@ test("Popcorn.[addTrackEvent | removeTrackEvent].ref()", function() { -module("Popcorn Methods"); +module("Popcorn Prototype Methods"); @@ -500,7 +500,7 @@ test("roundTime", function () { }); - + test("exec", function () { QUnit.reset(); @@ -542,6 +542,61 @@ test("exec", function () { }); +test("mute", function () { + + var video = Popcorn("#video"), + audio = Popcorn("#audio"), + expects = 4, + count = 0; + + expect( expects ); + + function plus(){ + if ( ++count == expects ) { + start(); + } + } + + stop(); + + + video.listen("muted", function() { + + equal( this.media.muted, true, "Video `muted` attribute is true when muted" ); + plus(); + + this.unmute(); + + }).listen("unmuted", function() { + + equal( this.media.muted, false, "Video `muted` attribute is false when unmuted" ); + plus(); + + }); + + audio.listen("muted", function() { + + equal( this.media.muted, true, "Audio `muted` attribute is true when muted" ); + plus(); + + this.unmute(); + + }).listen("unmuted", function() { + + equal( this.media.muted, false, "Audio `muted` attribute is false when unmuted" ); + plus(); + + }); + + + video.mute(); + audio.mute(); + +}); + + +module("Popcorn Static Methods"); + test( "Popcorn.extend", function () { QUnit.reset(); @@ -1330,9 +1385,9 @@ test("Start Zero Immediately", function () { end: function() {} }); - $pop.zero({ - start:0, - end: 2 + $pop.zero({ + start:0, + end: 2 }); }); test("Update Timer", function () {