From a5abab1f716aa4fae382067748c8b41730e76a71 Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Fri, 24 Jun 2011 10:53:11 -0400 Subject: [PATCH] [t611] unit tests for accessibility checkbox --- plugins/subtitle/popcorn.subtitle.unit.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/plugins/subtitle/popcorn.subtitle.unit.js b/plugins/subtitle/popcorn.subtitle.unit.js index 57f2bc3..8eee6a5 100755 --- a/plugins/subtitle/popcorn.subtitle.unit.js +++ b/plugins/subtitle/popcorn.subtitle.unit.js @@ -1,7 +1,7 @@ test("Popcorn Subtitle Plugin", function () { var popped = Popcorn( "#video" ), - expects = 11, + expects = 14, count = 0, subTop = 9001, subLeft = 9001, @@ -73,6 +73,7 @@ test("Popcorn Subtitle Plugin", function () { popped.exec( 1.5, function() { popped.media.pause(); + // check position of subttile that should of moved with video, // a subtitle must be displayed to get valid data ok( subtitlediv.style.left !== subLeft, "subtitle's left position has changed" ); @@ -91,6 +92,7 @@ test("Popcorn Subtitle Plugin", function () { equals (subtitlediv.children[ 1 ].innerHTML, "this is the second subtitle of 2011", "subtitle displaying correct information" ); plus(); + popped.media.play(); }); @@ -100,13 +102,31 @@ test("Popcorn Subtitle Plugin", function () { popped.media.pause(); equals (subtitlediv.children[ 1 ].innerHTML, "", "subtitle is clear" ); plus(); + popped.media.play(); }); popped.exec( 3.5, function() { + popped.media.play(); + + equals (subtitlediv.style.display, "inline", "subtitles being displayed with accessiblity on" ); + plus(); + + // turn accessibility off + document.getElementById( "accessibility" ).click(); + + equals (subtitlediv.style.display, "none", "subtitles not being displayed with accessiblity off" ); + plus(); + + // turn accessibility back on + document.getElementById( "accessibility" ).click(); + + equals (subtitlediv.style.display, "inline", "subtitles being displayed with accessiblity back on" ); + plus(); + equals (subtitlediv.children[ 2 ].innerHTML, "this is the third subtitle of 2011", "subtitle displaying correct information" ); plus(); popped.media.play(); -- 2.43.0