Skip to content

Commit 702dc36

Browse files
TheModMakerjoeyparrish
authored andcommitted
Fix destroying UI in some tests.
These tests were creating two UI instances in the same container. This caused the second one to replace the first without destroying the first. This caused test contamination since there could be extra CastProxy instances. This wouldn't always happen since the no-longer-referenced objects would be garbage-collected eventually; but depending on timing, the CastSender tests might fail. Change-Id: I7f4a008f56224ee33bee15c5e0370a225a5fc033
1 parent dbc9ea9 commit 702dc36

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/ui/ui_customization_unit.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,22 @@ describe('UI Customization', () => {
5757
UiUtils.confirmElementMissing(container, 'shaka-caption-button');
5858
});
5959

60-
it('seek bar only created when configured', () => {
61-
UiUtils.createUIThroughAPI(container, video, {addSeekBar: false});
60+
it('seek bar only created when configured', async () => {
61+
const ui =
62+
UiUtils.createUIThroughAPI(container, video, {addSeekBar: false});
6263
UiUtils.confirmElementMissing(container, 'shaka-seek-bar');
64+
await ui.destroy();
6365

6466
UiUtils.createUIThroughAPI(container, video, {addSeekBar: true});
6567
UiUtils.confirmElementFound(container, 'shaka-seek-bar');
6668
});
6769

68-
it('big play button only created when configured', () => {
69-
UiUtils.createUIThroughAPI(container, video, {addBigPlayButton: false});
70+
it('big play button only created when configured', async () => {
71+
const ui =
72+
UiUtils.createUIThroughAPI(container, video, {addBigPlayButton: false});
7073
UiUtils.confirmElementMissing(container, 'shaka-play-button-container');
7174
UiUtils.confirmElementMissing(container, 'shaka-play-button');
75+
await ui.destroy();
7276

7377
UiUtils.createUIThroughAPI(container, video, {addBigPlayButton: true});
7478
UiUtils.confirmElementFound(container, 'shaka-play-button-container');

0 commit comments

Comments
 (0)