From 1a7b09141e952de2acc8d596f0cb3db3fcc88cb6 Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Sat, 9 Apr 2011 20:45:06 -0400 Subject: [PATCH] [#357] lowerthird plugin tests --- .../lowerthird/popcorn.lowerthird.unit.html | 43 +++++++++++++ plugins/lowerthird/popcorn.lowerthird.unit.js | 64 +++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 plugins/lowerthird/popcorn.lowerthird.unit.html create mode 100644 plugins/lowerthird/popcorn.lowerthird.unit.js diff --git a/plugins/lowerthird/popcorn.lowerthird.unit.html b/plugins/lowerthird/popcorn.lowerthird.unit.html new file mode 100644 index 0000000..c409b2b --- /dev/null +++ b/plugins/lowerthird/popcorn.lowerthird.unit.html @@ -0,0 +1,43 @@ + + + + Popcorn Lower Third Plug-in Test + + + + + + + + + + +

Popcorn Lower Third Plugin

+

+
+

+
    +
    + + +
    + + diff --git a/plugins/lowerthird/popcorn.lowerthird.unit.js b/plugins/lowerthird/popcorn.lowerthird.unit.js new file mode 100644 index 0000000..50d3bf3 --- /dev/null +++ b/plugins/lowerthird/popcorn.lowerthird.unit.js @@ -0,0 +1,64 @@ +test( "Popcorn lower third Plugin", function () { + + var popped = Popcorn( "#video" ), + expects = 7, + count = 0, + lowerthirddiv = document.getElementById( "lowerthirddiv" ); + + expect(expects); + + function plus() { + if ( ++count===expects ) { + start(); + } + } + + stop(); + + ok ( "lowerthird" in popped, "lowerthird is a method of the popped instance" ); + plus(); + + equals ( lowerthirddiv.innerHTML, "", "initially, there is nothing inside the lowerthirddiv" ); + plus(); + + ok( !popped.container, "initially, there is no default div" ); + plus(); + + + popped.lowerthird({ + start: 0, // seconds + end: 5, // seconds + salutation: "Mr", + name: "Hyde", + role: "Monster" + } ) + .lowerthird({ + start: 3, // seconds + end: 10, // seconds + target: "lowerthirddiv", + salutation: "Dr", + name: "Jekyll", + role: "Person" + } ) + .volume(0); + + popped.exec( 1, function() { + equals ( popped.container.innerHTML, "Mr Hyde
    Monster", "first lowerthird is visible" ); + plus(); + }); + + popped.exec( 4, function() { + equals ( lowerthirddiv.innerHTML, "Dr Jekyll
    Person", "second lowerthird is visible" ); + plus(); + }); + + popped.exec( 11, function() { + equals ( popped.container.innerHTML, "", "first lowerthird is empty" ); + plus(); + equals ( lowerthirddiv.innerHTML, "", "second lowerthird is empty" ); + plus(); + }); + + popped.play(); + +}); \ No newline at end of file -- 2.43.0