equal
deleted
inserted
replaced
2 module("test initialization routines", |
2 module("test initialization routines", |
3 { |
3 { |
4 setup: function() { |
4 setup: function() { |
5 IriSP.jQuery("#widget-div").append("<div id='player_container'></div>"); |
5 IriSP.jQuery("#widget-div").append("<div id='player_container'></div>"); |
6 this.popcornOptions = { |
6 this.popcornOptions = { |
7 container: "#player_container", |
7 container: "player_container", |
8 type: "jwplayer", file : "video/franceculture/franceculture_retourdudimanche20100620.flv", |
8 type: "jwplayer", file : "video/franceculture/franceculture_retourdudimanche20100620.flv", |
9 streamer: "rtmp://media.iri.centrepompidou.fr/ddc_player/", |
9 streamer: "rtmp://media.iri.centrepompidou.fr/ddc_player/", |
10 flashplayer : '../libs/player.swf', |
10 flashplayer : '../libs/player.swf', |
11 live: true, |
11 live: true, |
12 "controlbar.position" : "none", |
12 "controlbar.position" : "none", |
20 height:480, |
20 height:480, |
21 container:'LdtPlayer', |
21 container:'LdtPlayer', |
22 css:'../../src/css/LdtPlayer.css', |
22 css:'../../src/css/LdtPlayer.css', |
23 widgets: [ |
23 widgets: [ |
24 {type: "PlayerWidget", |
24 {type: "PlayerWidget", |
|
25 mode: "radio", |
25 metadata:{ |
26 metadata:{ |
26 format:'cinelab', |
27 format:'cinelab', |
27 src:'test.json', |
28 src:'test.json', |
28 type:'dummy'} |
29 type:'dummy'} |
29 }, |
30 }, |
56 test("test the instantiation of a bunch of widgets", function() { |
57 test("test the instantiation of a bunch of widgets", function() { |
57 var pop = IriSP.configurePopcorn(this.popcornOptions); |
58 var pop = IriSP.configurePopcorn(this.popcornOptions); |
58 var widgets = IriSP.configureWidgets(pop, this.widgetOptions); |
59 var widgets = IriSP.configureWidgets(pop, this.widgetOptions); |
59 |
60 |
60 ok(widgets[0] instanceof IriSP.PlayerWidget, "first widget is a player widget"); |
61 ok(widgets[0] instanceof IriSP.PlayerWidget, "first widget is a player widget"); |
|
62 equal(widgets[0].selector.length, 1, "the first widget has a created a dom element"); |
61 ok(widgets[1] instanceof IriSP.SegmentsWidget, "second widget is a segments widget"); |
63 ok(widgets[1] instanceof IriSP.SegmentsWidget, "second widget is a segments widget"); |
62 ok(widgets[2] instanceof IriSP.AnnotationsWidget, "third widget is an annotation widget"); |
64 ok(widgets[2] instanceof IriSP.AnnotationsWidget, "third widget is an annotation widget"); |
63 }); |
65 }); |
64 } |
66 } |