| author | hamidouk |
| Wed, 07 Dec 2011 17:12:04 +0100 | |
| branch | bugslaying-after-r417-merge |
| changeset 427 | 440ffc18f827 |
| parent 327 | f20d0807a5ea |
| permissions | -rw-r--r-- |
| 305 | 1 |
/* arrowWidget.js */ |
2 |
||
3 |
function test_arrow_widget() { |
|
4 |
module("arrow widget testing", |
|
5 |
{setup : function() { |
|
|
427
440ffc18f827
changed the unit tests to reference a local video instead of youtube.
hamidouk
parents:
327
diff
changeset
|
6 |
this.Popcorn = Popcorn("#popcorn-div"); |
| 305 | 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 */ |
|
|
427
440ffc18f827
changed the unit tests to reference a local video instead of youtube.
hamidouk
parents:
327
diff
changeset
|
22 |
this.Popcorn = Popcorn("#popcorn-div"); |
| 305 | 23 |
} |
24 |
}); |
|
25 |
|
|
26 |
test("test widget initialization", function() { |
|
|
327
f20d0807a5ea
deactivated a non-passing test while looking for a way to make it work
hamidouk
parents:
319
diff
changeset
|
27 |
|
| 305 | 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 |
||
|
327
f20d0807a5ea
deactivated a non-passing test while looking for a way to make it work
hamidouk
parents:
319
diff
changeset
|
33 |
/* |
|
f20d0807a5ea
deactivated a non-passing test while looking for a way to make it work
hamidouk
parents:
319
diff
changeset
|
34 |
widget._Popcorn.media.currentTime = 400; |
|
f20d0807a5ea
deactivated a non-passing test while looking for a way to make it work
hamidouk
parents:
319
diff
changeset
|
35 |
widget._Popcorn.trigger("timeupdate"); |
| 319 | 36 |
equal(widget.selector.children(".Ldt-arrowWidget").css("left"), "22%", "test if the widget responds correctly to messages."); |
|
327
f20d0807a5ea
deactivated a non-passing test while looking for a way to make it work
hamidouk
parents:
319
diff
changeset
|
37 |
*/ |
| 305 | 38 |
}); |
39 |
}; |