unittests/tests/widgets/arrowWidget.js
author cavaliet
Thu, 24 May 2012 15:05:47 +0200
changeset 907 27b248a13355
parent 427 440ffc18f827
permissions -rw-r--r--
little update for bab smooth playing.

/* arrowWidget.js */

function test_arrow_widget() {
  module("arrow widget testing", 
  {setup : function() {    
    this.Popcorn = Popcorn("#popcorn-div");
    
    this.dt = new IriSP.DataLoader();
    this.ser = new IriSP.MockSerializer(this.dt, "/url"); /* dummy serializer */
        
    
    this.config = {
							width:650,
							height:1,
							mode:'radio',
							container:'widget-div',
							debug:true,
							css:'../src/css/LdtPlayer.css'};
    },
  teardown: function() {
    /* free the popcorn object because it has signal handlers attached to it */
    this.Popcorn = Popcorn("#popcorn-div");
  }
  });
  
  test("test widget initialization", function() {  
  
    var widget = new IriSP.ArrowWidget(this.Popcorn, this.config, this.ser);    
    widget.draw();

    equal(widget.selector.children(".Ldt-arrowWidget").length, 1, "test if the div has been added correctly");

    /*
    widget._Popcorn.media.currentTime = 400;
    widget._Popcorn.trigger("timeupdate");
    equal(widget.selector.children(".Ldt-arrowWidget").css("left"), "22%", "test if the widget responds correctly to messages.");
  */
  });
 };