Skip to content

Commit

Permalink
Merge pull request #2705 from Orange-OpenSource/isCompatibleWithStrea…
Browse files Browse the repository at this point in the history
…mUnitTest

Update CompareCodecs function
  • Loading branch information
epiclabsDASH committed Jul 17, 2018
2 parents 20a06d4 + 2fa0edc commit 2ddaf2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/streaming/Stream.js
Expand Up @@ -691,6 +691,9 @@ function Stream(config) {
}

function compareCodecs( stream, type ) {
if (!stream) {
return false;
}
const newStreamInfo = stream.getStreamInfo();
const currentStreamInfo = getStreamInfo();

Expand Down
7 changes: 7 additions & 0 deletions test/unit/streaming.Stream.js
Expand Up @@ -49,4 +49,11 @@ describe('Stream', function () {
const stream = Stream(context).create({});
expect(stream.activate.bind(stream)).to.be.throw('Missing config parameter(s)');
});

it('should return null when isCompatibleWithStream is called but stream attribute is undefined', () => {
const stream = Stream(context).create({});
const isCompatible = stream.isCompatibleWithStream();

expect(isCompatible).to.be.false; // jshint ignore:line
});
});

0 comments on commit 2ddaf2b

Please sign in to comment.