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

Add playback tests #894

Merged
merged 2 commits into from
Nov 16, 2016
Merged

Add playback tests #894

merged 2 commits into from
Nov 16, 2016

Conversation

forbesjo
Copy link
Contributor

@forbesjo forbesjo commented Nov 4, 2016

This is the start to automating end to end playback tests.

import { Hls } from '../src/videojs-contrib-hls';

let when = function(element, type, cb, condition) {
element.on(type, function func() {
Copy link
Member

Choose a reason for hiding this comment

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

why not use element.one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want the function to fire when the targeted event is triggered and a certain condition is met. Using one will just remove it the first time the event is fired.

For example, I use this with timeupdate and some target time.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, totally missed that. I guess I was focused on less code :P

player.autoplay(true);

playFor(player, 2, function() {
QUnit.ok(true, 'played for three more seconds');
Copy link
Contributor

@mjneil mjneil Nov 8, 2016

Choose a reason for hiding this comment

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

should this be "played for three two more seconds" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I get for copy/paste

Fixed MSE and environment test helpers, restore properly

Removed unused test files

video.width = 600;
video.height = 300;
document.querySelector('#qunit-fixture').appendChild(video);
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not an issue but do we want to remove the element from the DOM between tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

qunit will automatically reset the fixture it provides https://qunitjs.com/cookbook/#keeping-tests-atomic


QUnit.module('Playback', {
beforeEach() {
QUnit.stop();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use async and done instead of stop and start?

Copy link
Member

Choose a reason for hiding this comment

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

yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update Qunit

Copy link
Contributor Author

@forbesjo forbesjo Nov 15, 2016

Choose a reason for hiding this comment

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

https://github.com/apsdehal/qunit-migrate might be useful for the other projects that are going to update qunit.

Never mind, this doesn't really work well with ES6

@mjneil
Copy link
Contributor

mjneil commented Nov 16, 2016

LGTM

@forbesjo forbesjo merged commit f2352e4 into videojs:simple-fetcher Nov 16, 2016
@forbesjo forbesjo deleted the test/playback branch November 16, 2016 19:14
imbcmdth pushed a commit that referenced this pull request Nov 18, 2016
Fixed seeking behavior

Updated getMediaIndexForTime to be simple and stupid

Remove spurious console logs

Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior.

Remove limits on gap-skipper. Skip instantly without waiting.

Use the proper native MediaSource duration for buffer removals.

Improvements for live stream rendition changes

Fixed an undefined variable bug

Some more simplification and a very conservative live stream rendition change approach

VOD fixes

Experimental change to the way we throttle the fetcher

Use GOAL_BUFFER_LENGTH again

Continued massive changes to segment fetching. Cleanup and comments.

Fixed a bug where we were fetching starting at mediaIndex 0 on every seek.

Refactor probing code in preparation for pulling into it's own module or class

Moved sync-related logic out of segment-loader and into a new sync-controller class

Removed expired from the SegmentLoader

Update mux.js dependency to 2.5.0

Don't error when the tsprobe returns null

Fixed two issues: MAAT switching and Flash seeking

Rename duration variable

fix flash failing first segment load (#859)

dont use tech for has played (#861)

Code Coverage and Unit tests for Simple Fetcher (#862)

fix has played returning false on vod (#866)

Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878)

Fixed a small bug in gap-skipper where we could seek to the same spot during a video underflow more than once

Provide option to set contrib-hls first in the HTML5 tech (#889)

Add playback tests (#894)

remove expired time tracking and use sync points to calculate seekable (#898)
imbcmdth pushed a commit that referenced this pull request Nov 18, 2016
* Added playback test

Fixed MSE and environment test helpers, restore properly

Removed unused test files

* Update to qunit 2.0
imbcmdth pushed a commit that referenced this pull request Nov 21, 2016
Fixed seeking behavior

Updated getMediaIndexForTime to be simple and stupid

Remove spurious console logs

Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior.

Remove limits on gap-skipper. Skip instantly without waiting.

Use the proper native MediaSource duration for buffer removals.

Improvements for live stream rendition changes

Fixed an undefined variable bug

Some more simplification and a very conservative live stream rendition change approach

VOD fixes

Experimental change to the way we throttle the fetcher

Use GOAL_BUFFER_LENGTH again

Continued massive changes to segment fetching. Cleanup and comments.

Fixed a bug where we were fetching starting at mediaIndex 0 on every seek.

Refactor probing code in preparation for pulling into it's own module or class

Moved sync-related logic out of segment-loader and into a new sync-controller class

Removed expired from the SegmentLoader

Update mux.js dependency to 2.5.0

Don't error when the tsprobe returns null

Fixed two issues: MAAT switching and Flash seeking

Rename duration variable

fix flash failing first segment load (#859)

dont use tech for has played (#861)

Code Coverage and Unit tests for Simple Fetcher (#862)

fix has played returning false on vod (#866)

Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878)

Provide option to set contrib-hls first in the HTML5 tech (#889)

This reverts commit 59ddbe1.

Add playback tests (#894)

Fixed MSE and environment test helpers, restore properly

Removed unused test files

remove expired time tracking and use sync points to calculate seekable (#898)

Fixing a few tests for QUnit 2.0
imbcmdth added a commit that referenced this pull request Nov 22, 2016
Fixed seeking behavior

Updated getMediaIndexForTime to be simple and stupid

Remove spurious console logs

Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior.

Remove limits on gap-skipper. Skip instantly without waiting.

Use the proper native MediaSource duration for buffer removals.

Improvements for live stream rendition changes

Fixed an undefined variable bug

Some more simplification and a very conservative live stream rendition change approach

VOD fixes

Experimental change to the way we throttle the fetcher

Use GOAL_BUFFER_LENGTH again

Continued massive changes to segment fetching. Cleanup and comments.

Fixed a bug where we were fetching starting at mediaIndex 0 on every seek.

Refactor probing code in preparation for pulling into it's own module or class

Moved sync-related logic out of segment-loader and into a new sync-controller class

Removed expired from the SegmentLoader

Update mux.js dependency to 2.5.0

Don't error when the tsprobe returns null

Fixed two issues: MAAT switching and Flash seeking

Rename duration variable

fix flash failing first segment load (#859)

dont use tech for has played (#861)

Code Coverage and Unit tests for Simple Fetcher (#862)

fix has played returning false on vod (#866)

Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878)

Provide option to set contrib-hls first in the HTML5 tech (#889)

This reverts commit 59ddbe1.

Add playback tests (#894)

Fixed MSE and environment test helpers, restore properly

Removed unused test files

remove expired time tracking and use sync points to calculate seekable (#898)

Fixing a few tests for QUnit 2.0
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.

4 participants