From 159545c46a86fee88eabd7015d9f0396b2668c3a Mon Sep 17 00:00:00 2001 From: Garrett Singer Date: Mon, 20 Dec 2021 14:49:54 -0500 Subject: [PATCH] test: fix failing IE11 test due to late initialize of EME keys (#1241) --- test/videojs-http-streaming.test.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/videojs-http-streaming.test.js b/test/videojs-http-streaming.test.js index f8c3f4c0c..bbd48b00c 100644 --- a/test/videojs-http-streaming.test.js +++ b/test/videojs-http-streaming.test.js @@ -4745,11 +4745,21 @@ QUnit.test('eme waitingforkey event triggers another setup', function(assert) { vhs.masterPlaylistController_.sourceUpdater_.trigger('createdsourcebuffers'); - assert.equal(createKeySessionCalls, 1, 'called createKeySessions_ once'); + // Since IE11 doesn't initialize media keys early, in this test IE11 will always have + // one less call than in other browsers. + if (videojs.browser.IE_VERSION === 11) { + assert.equal(createKeySessionCalls, 0, 'did not call createKeySessions_ yet'); + } else { + assert.equal(createKeySessionCalls, 1, 'called createKeySessions_ once'); + } this.player.tech_.trigger({type: 'waitingforkey', status: 'usable'}); - assert.equal(createKeySessionCalls, 2, 'called createKeySessions_ again'); + if (videojs.browser.IE_VERSION === 11) { + assert.equal(createKeySessionCalls, 1, 'called createKeySessions_ once'); + } else { + assert.equal(createKeySessionCalls, 2, 'called createKeySessions_ again'); + } }); QUnit.test('integration: configures eme for DASH on source buffer creation', function(assert) {