From a5ab59b2c749a2bd7ccbba4f87790f2bd5e0bfc5 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Mon, 7 Dec 2015 16:11:50 -0500 Subject: [PATCH] Test proper usage of techCall. --- test/unit/player.test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/unit/player.test.js b/test/unit/player.test.js index fdab6a5168..a287a8769f 100644 --- a/test/unit/player.test.js +++ b/test/unit/player.test.js @@ -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'); +});