youtube.unit.js tests need reviewing
For starters I am having a hell of a time running them on my crappy network.
Second, it looks like events are defined multiple times. Is this intended? example:
var expectedEvents = [ 'play', 'loadeddata', 'playing', 'volumechange', 'pause', 'play', 'playing', 'seeked', 'volumechange', 'volumechange', 'playing', 'pause', 'ended' ];
Without duplicates, we would be seeing this:
var expectedEvents = [ 'play', 'loadeddata', 'playing', 'volumechange', 'pause', 'seeked', 'ended' ];
I am starting to think this is intended, but if that's the case, is there a better way to test this?
Also, the timeout of stop( 15000 ); is not enough, it always times out for me. We should consider raising this, or removing it.
Vimeo's tests are pretty solid. Has a 20 second timeout. I get the odd timeout, but mostly passes within 20 seconds.
Anyway, I am assigning this to myself, and I will be pestering Steve for help in the near future.
Comments and changes to this ticket
Just seeing this now.
I agree the Youtube tests could use an overhaul, the Vimeo ones could also benefit from a bit more robust test coverage. I've created #471 to try and help standardize test coverage across players.
My understanding is the duplicates are the expected order for events to be fired in throughout the course of the test.
Yes, the YouTube tests are not the best tests in the world and heavily depend on the network conditions in order to pass. The duplication is the result of the test logic requiring the exact events to be fired in sequence.
For example, if you pause and play, the Youtube wrapper fires pause, play and playing events. If these events are not specified, the test would fail. Also, in the case of seek(), the Youtube player attempts to mimic HTML5 video's behaviour by specifying that:
1) If video is playing, the video should be playing after seeking.
2) If video is paused, the video should be paused after seeking.
Therefore, if you seek the video while the video is paused, seek, play and pause events would be fired.
The effort in #471 would for sure be helpful in unifying the test method and DRYing out the tests.
ps. Steven, thanks for CC'ing me on this.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Popcorn.js is an HTML5 video framework that lets you bring elements of the web into your videos.
Popcorn.js is a project of Web Made Movies, Mozilla's Open Video Lab.