зеркало из https://github.com/mozilla/popcorn-js.git
modified tests to support HTML5 behaviours across all browsers.
Updated logic to use more recent Popcorn methods (namely exec/cue) [#822]
This commit is contained in:
Родитель
7dda833aac
Коммит
42708d233c
|
@ -16,12 +16,12 @@ test("Popcorn 0.3 JSON Parser Plugin", function () {
|
|||
}
|
||||
|
||||
poppercorn.parseJSON("data/video.json");
|
||||
poppercorn.pause();
|
||||
|
||||
expect(expects);
|
||||
|
||||
stop( 10000 );
|
||||
|
||||
|
||||
trackData = poppercorn.data;
|
||||
trackEvents = trackData.trackEvents;
|
||||
|
||||
|
@ -29,12 +29,11 @@ test("Popcorn 0.3 JSON Parser Plugin", function () {
|
|||
url: 'data/video.json',
|
||||
success: function( data ) {
|
||||
|
||||
var idx = 0;
|
||||
var idx = 1;
|
||||
|
||||
Popcorn.forEach( data.json.data, function (dataObj) {
|
||||
|
||||
Popcorn.forEach( dataObj, function ( obj, key ) {
|
||||
|
||||
equals( trackData.history[idx].indexOf(key), 0, "history item '" + trackData.history[idx] + "' matches data key '"+ key+ "' at correct index" );
|
||||
plus();
|
||||
|
||||
|
@ -46,14 +45,12 @@ test("Popcorn 0.3 JSON Parser Plugin", function () {
|
|||
}
|
||||
});
|
||||
|
||||
poppercorn.listen("timeupdate", function ( event ) {
|
||||
|
||||
|
||||
if ( Math.round( this.currentTime()) === 3 && !finished ) {
|
||||
poppercorn.exec( 3, function() {
|
||||
if ( !finished ) {
|
||||
|
||||
finished = true;
|
||||
|
||||
equals( trackEvents.byStart.length, numLoadingEvents + 2 , "trackEvents.byStart.length === (5 loaded, 2 padding) " );
|
||||
equals( trackEvents.byStart.length, numLoadingEvents + 3 , "trackEvents.byStart.length === (5 loaded, 2 padding) " );
|
||||
plus();
|
||||
|
||||
|
||||
|
@ -69,7 +66,9 @@ test("Popcorn 0.3 JSON Parser Plugin", function () {
|
|||
}
|
||||
});
|
||||
|
||||
poppercorn.currentTime(0).play()
|
||||
poppercorn.listen( "canplayall", function() {
|
||||
this.play();
|
||||
});
|
||||
});
|
||||
|
||||
test("Popcorn 0.3 JSON Parser Plugin - AUDIO", function () {
|
||||
|
@ -102,6 +101,7 @@ test("Popcorn 0.3 JSON Parser Plugin - AUDIO", function () {
|
|||
start();
|
||||
// clean up added events after tests
|
||||
clearInterval( interval );
|
||||
audiocorn.pause();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче