Skip to content

Commit

Permalink
Add Regression Test for Drm Engine
Browse files Browse the repository at this point in the history
Added a test to show how we broke Drm Engine for non-encrypted
content in change id I0558de50552a614692488a6c78d46b5ea345bc7b

Issue #1567

Change-Id: I2aab52c79eea1887b7f4281e1b8dcbbc0f3cd25e
  • Loading branch information
vaage committed Aug 31, 2018
1 parent 0310c78 commit 1f2ae49
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/media/drm_engine_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,23 @@ describe('DrmEngine', function() {
shaka.log.error = originalLogError;
});

describe('supportsVariants', function() {
it('supports all clear variants', async function() {
const manifest = new shaka.test.ManifestGenerator()
.addPeriod(0)
.addVariant(0)
.addDrmInfo('drm.abc')
.addDrmInfo('drm.def')
.addVideo(1).mime('video/foo', 'vbar').encrypted(false)
.build();

const variants = shaka.util.StreamUtils.getAllVariants(manifest);
await drmEngine.initForPlayback(variants, manifest.offlineSessionIds);

expect(drmEngine.supportsVariant(variants[0])).toBeTruthy();
});
});

describe('init', function() {
it('stops on first available key system', async () => {
// Accept both drm.abc and drm.def. Only one can be chosen.
Expand Down

0 comments on commit 1f2ae49

Please sign in to comment.