From f3902cdf77fadb6d5ea7558bfeb1a439f27d8764 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 8 Aug 2011 11:17:47 -0400 Subject: [PATCH] [#678] Initial failing tests for implementation --- test/popcorn.unit.js | 65 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 5 deletions(-) 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 () { -- 2.43.0