Skip to content

Commit

Permalink
Test proper usage of techCall.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Dec 7, 2015
1 parent bdb15de commit a5ab59b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/unit/player.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,3 +909,28 @@ test('player#reset loads the Html5 tech and then techCalls reset', function() {
equal(loadedSource, null, 'with a null source');
equal(techCallMethod, 'reset', 'we then reset the tech');
});

test('player#reset loads the first item in the techOrder and then techCalls reset', function() {
let loadedTech;
let loadedSource;
let techCallMethod;

let testPlayer = {
options_: {
techOrder: ['flash', 'html5'],
},
loadTech_(tech, source) {
loadedTech = tech;
loadedSource = source;
},
techCall_(method) {
techCallMethod = method;
}
};

Player.prototype.reset.call(testPlayer);

equal(loadedTech, 'Flash', 'we loaded the Flash tech');
equal(loadedSource, null, 'with a null source');
equal(techCallMethod, 'reset', 'we then reset the tech');
});

0 comments on commit a5ab59b

Please sign in to comment.