Skip to content

Commit

Permalink
remove tests
Browse files Browse the repository at this point in the history
  • Loading branch information
harisha-swaminathan committed Aug 23, 2024
1 parent dae6b84 commit 8ad96b1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 103 deletions.
66 changes: 0 additions & 66 deletions test/eme.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,72 +263,6 @@ QUnit.test('keystatuseschange with expired key closes', function(assert) {
assert.equal(creates, 1, 'no new session created');
});

QUnit.test('sessions are closed and removed on `ended` after expiry', function(assert) {
const done = assert.async();
let getLicenseCalls = 0;
const options = {
keySystems: {
'com.widevine.alpha': {
url: 'some-url',
getLicense(emeOptions, keyMessage, callback) {
getLicenseCalls++;
}
}
}
};
const removeSessionCalls = [];
// once the eme module gets the removeSession function, the session argument is already
// bound to the function (note that it's a custom session maintained by the plugin, not
// the native session), so only initData is passed
const removeSession = (initData) => removeSessionCalls.push(initData);

const keySystemAccess = {
keySystem: 'com.widevine.alpha',
createMediaKeys: () => {
return Promise.resolve({
setServerCertificate: () => Promise.resolve(),
createSession: () => {
return {
addEventListener: (event, callback) => {
if (event === 'message') {
setTimeout(() => {
callback({message: 'whatever', messageType: 'license-renewal'});
assert.equal(getLicenseCalls, 0, 'did not call getLicense');
assert.equal(removeSessionCalls.length, 1, 'session is removed');
done();
});
}
},
keyStatuses: [],
generateRequest: () => Promise.resolve(),
close: () => {
return {
then: (nextCall) => {
nextCall();
return Promise.resolve();
}
};
}
};
}
});
}
};
const video = {
setMediaKeys: () => Promise.resolve()
};

this.player.ended = () => true;
standard5July2016({
player: this.player,
video,
keySystemAccess,
options,
eventBus: getMockEventBus(),
removeSession
});
});

QUnit.test('keystatuseschange with internal-error logs a warning', function(assert) {
const origWarn = videojs.log.warn;
const initData = new Uint8Array([1, 2, 3]);
Expand Down
37 changes: 0 additions & 37 deletions test/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import QUnit from 'qunit';
import sinon from 'sinon';
import videojs from 'video.js';
import window from 'global/window';
import * as plug from '../src/plugin';
import {
default as plugin,
hasSession,
Expand Down Expand Up @@ -518,42 +517,6 @@ QUnit.test('handleEncryptedEvent uses predefined init data', function(assert) {
});
});

QUnit.skip('handleEncryptedEvent called explicitly on replay or seekback after `ended` if browser is Firefox ', function(assert) {
const done = assert.async();

this.clock = sinon.useFakeTimers();

videojs.browser = {
IS_FIREFOX: true
};
this.player.eme();

this.player.trigger('ready');
this.player.trigger('play');

plug.handleEncryptedEvent = sinon.spy();

this.clock.tick(1);
this.player.trigger('ended');
this.clock.tick(1);
this.player.trigger('play');
assert.ok(plug.handleEncryptedEvent.calledOnce, 'HandleEncryptedEvent called if play fires after ended');

this.player.trigger('ended');
this.player.trigger('seek');
assert.ok(plug.handleEncryptedEvent.calledTwice, 'HandleEncryptedEvent called if seek fires after ended');

this.player.trigger('ended');
this.player.trigger('seek');

this.player.eme.sessions.push({});

this.player.trigger('play');
assert.ok(plug.handleEncryptedEvent.calledThrice, 'HandleEncryptedEvent only called once if seek and play both fire after ended');
sinon.restore();
done();
});

QUnit.test('handleMsNeedKeyEvent uses predefined init data', function(assert) {
const options = {
keySystems: {
Expand Down

0 comments on commit 8ad96b1

Please sign in to comment.