Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: memory leak fixes in tests #5861

Merged
merged 2 commits into from Mar 18, 2019
Merged

tests: memory leak fixes in tests #5861

merged 2 commits into from Mar 18, 2019

Conversation

brandonocasey
Copy link
Contributor

Using DomData.elData contained a ton of improperly cleaned up objects in tests this pull request fixes that.

@@ -444,13 +444,13 @@ if (Html5.supportsNativeTextTracks()) {

el.textTracks = tt;

/* eslint-disable no-unused-vars */
const htmlTech = new Html5({el});
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 guess we should have thought about no-unused-vars a bit more here. woops!

@@ -364,6 +364,8 @@ QUnit.test('menu items should polyfill mode change events', function(assert) {
assert.equal(changes, 2, 'clicks trigger change events');

player.dispose();
trackMenuItem.dispose();
player.textTracks().off('change');
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 almost wonder if we should call off on track lists when we dispose, instead of doing this.

Copy link
Member

Choose a reason for hiding this comment

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

probably, though, I thought we did that?

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 think we clear them out of Tracks. Let's see...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we want to call off on them on player dispose, rather than tech dispose, since the track lists stick around between techs.

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 will remove the test changes related to this if #5867 is ok.

@@ -21,8 +20,9 @@ TrackBaseline(Track, {
kind: 'subtitles',
mode: 'disabled',
label: 'English',
language: 'en',
tech: new TechFaker()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we need a way to cleanup this tech, we cannot just pass a new TechFaker into baseline. Instead I create one in every test inside TrackBaseline and pass it as an options.

@gkatsev gkatsev merged commit 23a36f3 into master Mar 18, 2019
@gkatsev gkatsev deleted the tests/memory-leaks branch March 18, 2019 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants