Skip to content

Commit

Permalink
test: Remove global Util alias
Browse files Browse the repository at this point in the history
There was an alias to shaka.test.Util in a global context which was
affecting other tests.  The result was that these tests could refer to
"Util" without the namespace or their own alias, and everything would
work.

The problem with that is that when the file with the global alias was
removed or disabled, those other tests would fail because "Util" would
be undefined.

This removes the global alias and adds missing local aliases to the
test suites that were accidentally relying on the global one.

Change-Id: Ifca8c1ada0c3e46cb30a2039b5c4c2252d992d37
  • Loading branch information
joeyparrish committed Apr 29, 2021
1 parent 1bb3b6e commit 8d9a975
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions test/cea/mp4_cea_parser_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ goog.require('shaka.util.Error');
describe('Mp4CeaParser', () => {
const ceaInitSegmentUri = '/base/test/test/assets/cea-init.mp4';
const ceaSegmentUri = '/base/test/test/assets/cea-segment.mp4';
const Util = shaka.test.Util;

/** @type {!ArrayBuffer} */
let ceaInitSegment;
Expand Down
2 changes: 2 additions & 0 deletions test/player_integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ describe('Player', () => {
/** @type {shaka.test.Waiter} */
let waiter;

const Util = shaka.test.Util;

beforeAll(async () => {
video = shaka.test.UiUtils.createVideoElement();
document.body.appendChild(video);
Expand Down
6 changes: 3 additions & 3 deletions test/ui/text_displayer_layout_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ goog.require('shaka.text.UITextDisplayer');
goog.require('shaka.ui.Overlay');
goog.require('shaka.util.EventManager');

const Util = shaka.test.Util;

// TODO: Move this suite to the text/ folder where it belongs
filterDescribe('TextDisplayer layout', Util.supportsScreenshots, () => {
const supportsScreenshots = () => shaka.test.Util.supportsScreenshots();
filterDescribe('TextDisplayer layout', supportsScreenshots, () => {
const UiUtils = shaka.test.UiUtils;
const Util = shaka.test.Util;

/** @type {!shaka.extern.TextDisplayer} */
let textDisplayer;
Expand Down

0 comments on commit 8d9a975

Please sign in to comment.