unittests/tests/widgets/arrowWidget.js
branchnew-model
changeset 924 64c2eaafe5e2
parent 923 b3ee7d1b472a
child 925 28efc97b5d78
equal deleted inserted replaced
923:b3ee7d1b472a 924:64c2eaafe5e2
     1 /* arrowWidget.js */
       
     2 
       
     3 function test_arrow_widget() {
       
     4   module("arrow widget testing", 
       
     5   {setup : function() {    
       
     6     this.Popcorn = Popcorn("#popcorn-div");
       
     7     
       
     8     this.dt = new IriSP.DataLoader();
       
     9     this.ser = new IriSP.MockSerializer(this.dt, "/url"); /* dummy serializer */
       
    10         
       
    11     
       
    12     this.config = {
       
    13 							width:650,
       
    14 							height:1,
       
    15 							mode:'radio',
       
    16 							container:'widget-div',
       
    17 							debug:true,
       
    18 							css:'../src/css/LdtPlayer.css'};
       
    19     },
       
    20   teardown: function() {
       
    21     /* free the popcorn object because it has signal handlers attached to it */
       
    22     this.Popcorn = Popcorn("#popcorn-div");
       
    23   }
       
    24   });
       
    25   
       
    26   test("test widget initialization", function() {  
       
    27   
       
    28     var widget = new IriSP.ArrowWidget(this.Popcorn, this.config, this.ser);    
       
    29     widget.draw();
       
    30 
       
    31     equal(widget.selector.children(".Ldt-arrowWidget").length, 1, "test if the div has been added correctly");
       
    32 
       
    33     /*
       
    34     widget._Popcorn.media.currentTime = 400;
       
    35     widget._Popcorn.trigger("timeupdate");
       
    36     equal(widget.selector.children(".Ldt-arrowWidget").css("left"), "22%", "test if the widget responds correctly to messages.");
       
    37   */
       
    38   });
       
    39  };