Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Remove extraneous methods from PlaylistLoader #1286

Merged
merged 4 commits into from
Nov 6, 2017

Conversation

gesinger
Copy link
Contributor

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

*
* @return {Boolean} true if on lowest rendition
*/
export const isLowestEnabledRendition = (master, media) => {
Copy link
Contributor

@mjneil mjneil Oct 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this would make more sense being in the playlist.js file now that its not tied to the playlist-loader instance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Looks much nicer there 👍

@@ -791,6 +794,43 @@ QUnit.test('uses last segment duration for refresh delay', function(assert) {
'used half targetDuration when update is false');
});

QUnit.test('isLowestEnabledRendition detects if we are on lowest rendition',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think putting these tests in playlist.test.js would be more appropriate and then you can test on just plain objects with the info thats needed instead of all this extra creating a loader, responding to request, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

master-playlist-controller.test.js also already has integration tests for isLowestEnabledRendition, so even more reason to convert these to unit tests

@@ -4,6 +4,64 @@ import QUnit from 'qunit';
import xhrFactory from '../src/xhr';
import { useFakeEnvironment } from './test-helpers';

QUnit.module('Playlist Status');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already an entire module of tests for blacklisting and enabled states near the bottom of this file...
https://github.com/videojs/videojs-contrib-hls/blob/master/test/playlist.test.js#L791

@mjneil mjneil merged commit 9b95d1e into videojs:master Nov 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants