From fbbd63d96ba39cd99d70dbe7d47377870c41ca96 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Mon, 11 Apr 2022 15:47:48 -0700 Subject: [PATCH] test: Late load tests, fix Chromecast test flake (#4115) This change fixes tests on Chromecast by loading tests later in the process. Test scripts are now dynamically inserted by boot.js, rather than loaded by Karma. The bootstrapping code then awaits the completion of that before starting the Karma frameworks (Jasmine) to run the tests. This also removes the use of goog.provide/goog.require in tests and test utils. We don't need to load test utils or library sources dynamically in each test, and this gives us more explicit control over script loading and ordering. Closes #4094 --- demo/config.js | 1 - demo/custom.js | 1 - karma.conf.js | 66 +++++++++---- test/abr/simple_abr_manager_unit.js | 5 - test/ads/ad_manager_unit.js | 6 -- test/cast/cast_proxy_unit.js | 8 -- test/cast/cast_receiver_integration.js | 14 --- test/cast/cast_receiver_unit.js | 8 -- test/cast/cast_sender_unit.js | 6 -- test/cast/cast_utils_unit.js | 13 --- test/cea/cea608_memory_unit.js | 5 - test/cea/cea708_service_unit.js | 7 -- test/cea/cea708_window_unit.js | 5 - test/cea/cea_decoder_unit.js | 6 -- test/cea/dtvcc_packet_builder_unit.js | 3 - test/cea/dtvcc_packet_unit.js | 5 - test/cea/mp4_cea_parser_unit.js | 4 - .../dash_parser_content_protection_unit.js | 8 -- test/dash/dash_parser_live_unit.js | 13 --- test/dash/dash_parser_manifest_unit.js | 15 --- test/dash/dash_parser_segment_base_unit.js | 7 -- test/dash/dash_parser_segment_list_unit.js | 6 -- .../dash/dash_parser_segment_template_unit.js | 9 -- test/dash/mpd_utils_unit.js | 7 -- test/demo/demo_unit.js | 5 - test/deprecate/enforcer_unit.js | 4 - test/deprecate/version_unit.js | 2 - test/hls/hls_live_unit.js | 9 -- test/hls/hls_parser_unit.js | 11 --- test/hls/manifest_text_parser_unit.js | 10 -- test/media/adaptation_set_criteria_unit.js | 4 - test/media/adaptation_set_unit.js | 2 - test/media/buffering_observer_unit.js | 2 - test/media/closed_caption_parser_unit.js | 3 - test/media/drm_engine_integration.js | 15 --- test/media/drm_engine_unit.js | 20 ---- test/media/manifest_parser_unit.js | 4 - test/media/media_source_engine_integration.js | 7 -- test/media/media_source_engine_unit.js | 13 --- test/media/mp4_segment_index_parser_unit.js | 4 - test/media/play_rate_controller_unit.js | 4 - test/media/playhead_unit.js | 8 -- test/media/presentation_timeline_unit.js | 3 - test/media/quality_observer_unit.js | 4 - test/media/region_observer_unit.js | 5 - test/media/region_timeline_unit.js | 3 - test/media/segment_index_unit.js | 6 -- test/media/segment_reference_unit.js | 3 - test/media/stall_detector_unit.js | 5 - test/media/streaming_engine_integration.js | 25 ----- test/media/streaming_engine_unit.js | 23 ----- test/media/time_ranges_utils_unit.js | 2 - test/media/transmuxer_integration.js | 6 -- test/media/webm_segment_index_parser_unit.js | 4 - test/net/data_uri_plugin_unit.js | 7 -- test/net/http_plugin_unit.js | 9 -- test/net/networking_engine_unit.js | 11 --- .../download_progress_estimator_unit.js | 2 - test/offline/indexeddb_storage_unit.js | 6 -- test/offline/manifest_convert_unit.js | 8 -- test/offline/offline_integration.js | 10 -- test/offline/offline_manifest_parser_unit.js | 6 -- test/offline/offline_scheme_unit.js | 8 -- test/offline/offline_uri_unit.js | 2 - test/offline/storage_compatibility_unit.js | 13 --- test/offline/storage_integration.js | 26 ----- test/player_external.js | 9 -- test/player_integration.js | 14 --- test/player_load_graph_integration.js | 5 - test/player_src_equals_external.js | 6 -- test/player_src_equals_integration.js | 7 -- test/player_unit.js | 23 ----- test/routing/walker_unit.js | 8 -- test/test/boot.js | 97 ++++++++++++++----- test/test/externs/karma.js | 4 + test/test/namespace.js | 10 ++ test/test/util/canned_idb.js | 8 -- test/test/util/cea_utils.js | 6 -- test/test/util/dash_parser_util.js | 13 --- test/test/util/fake_ad.js | 3 - test/test/util/fake_ad_manager.js | 9 -- test/test/util/fake_demo_main.js | 5 - test/test/util/fake_drm_engine.js | 6 -- test/test/util/fake_media_source_engine.js | 7 -- test/test/util/fake_networking_engine.js | 5 - test/test/util/fake_text_displayer.js | 5 - test/test/util/indexeddb_utils.js | 6 -- test/test/util/jasmine_fetch.js | 1 - test/test/util/loader.js | 18 ---- test/test/util/manifest_generator.js | 11 --- test/test/util/manifest_parser_util.js | 6 -- test/test/util/offline_utils.js | 5 - test/test/util/simple_fakes.js | 22 ----- test/test/util/stream_generator.js | 14 --- test/test/util/streaming_engine_util.js | 15 --- test/test/util/test_scheme.js | 18 ---- test/test/util/ttml_utils.js | 2 - test/test/util/ui_utils.js | 9 -- test/test/util/util.js | 11 --- test/test/util/waiter.js | 8 -- test/text/cue_integration.js | 4 - test/text/lrc_text_parser_unit.js | 4 - test/text/mp4_ttml_parser_unit.js | 6 -- test/text/mp4_vtt_parser_unit.js | 6 -- test/text/sbv_text_parser_unit.js | 4 - test/text/simple_text_displayer_unit.js | 7 -- test/text/srt_text_parser_unit.js | 4 - test/text/ssa_text_parser_unit.js | 5 - test/text/text_engine_unit.js | 5 - test/text/text_track_integration.js | 2 - test/text/ttml_text_parser_unit.js | 9 -- test/text/ui_text_displayer_unit.js | 4 - test/text/vtt_text_parser_unit.js | 9 -- test/text/web_vtt_generator_unit.js | 3 - test/ui/ad_ui_unit.js | 11 --- test/ui/localization_unit.js | 3 - test/ui/text_displayer_layout_unit.js | 11 --- test/ui/ui_customization_unit.js | 6 -- test/ui/ui_integration.js | 16 --- test/ui/ui_unit.js | 14 --- test/util/abortable_operation_unit.js | 5 - test/util/array_utils_unit.js | 2 - test/util/buffer_utils_unit.js | 2 - test/util/cmcd_manager_unit.js | 3 - test/util/data_view_reader_unit.js | 4 - test/util/ebml_parser_unit.js | 4 - test/util/event_manager_unit.js | 3 - test/util/fake_event_target_unit.js | 5 - test/util/iterables_unit.js | 2 - test/util/language_utils_unit.js | 3 - test/util/manifest_parser_utils_unit.js | 2 - test/util/mp4_box_parsers_unit.js | 5 - test/util/mp4_parser_unit.js | 4 - test/util/multi_map_unit.js | 3 - test/util/object_utils_unit.js | 2 - test/util/periods_unit.js | 4 - test/util/pssh_unit.js | 5 - test/util/state_history_unit.js | 2 - test/util/stream_utils_unit.js | 5 - test/util/string_utils_unit.js | 6 -- test/util/text_parser_unit.js | 2 - test/util/xml_utils_unit.js | 4 - 142 files changed, 134 insertions(+), 1024 deletions(-) create mode 100644 test/test/namespace.js diff --git a/demo/config.js b/demo/config.js index a220857b3d..ae8fc448ee 100644 --- a/demo/config.js +++ b/demo/config.js @@ -11,7 +11,6 @@ goog.require('goog.asserts'); goog.require('shakaDemo.BoolInput'); goog.require('shakaDemo.DatalistInput'); goog.require('shakaDemo.InputContainer'); -goog.require('shakaDemo.Main'); goog.require('shakaDemo.MessageIds'); goog.require('shakaDemo.NumberInput'); goog.require('shakaDemo.SelectInput'); diff --git a/demo/custom.js b/demo/custom.js index 84454b4150..0255425207 100644 --- a/demo/custom.js +++ b/demo/custom.js @@ -12,7 +12,6 @@ goog.require('ShakaDemoAssetInfo'); goog.require('shakaDemo.AssetCard'); goog.require('shakaDemo.Input'); goog.require('shakaDemo.InputContainer'); -goog.require('shakaDemo.Main'); goog.require('shakaDemo.MessageIds'); goog.require('shakaDemo.TextInput'); diff --git a/karma.conf.js b/karma.conf.js index 9888c26800..80982da340 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -9,6 +9,7 @@ const Jimp = require('jimp'); const fs = require('fs'); +const glob = require('glob'); const path = require('path'); const rimraf = require('rimraf'); const {ssim} = require('ssim.js'); @@ -107,39 +108,38 @@ module.exports = (config) => { 'dist/deps.js', 'shaka-player.uncompiled.js', + // the demo's config tab will register with shakaDemoMain, and will be + // tested in test/demo/demo_unit.js + 'demo/config.js', + // cajon module (an AMD variant of requirejs) next 'node_modules/cajon/cajon.js', - // bootstrapping for the test suite - 'test/test/boot.js', + // define the test namespace next (shaka.test) + 'test/test/namespace.js', - // test utils next + // test utilities next, which fill in that namespace 'test/test/util/*.js', - // list of test assets next - 'demo/common/message_ids.js', - 'demo/common/asset.js', - 'demo/common/assets.js', + // bootstrapping for the test suite last; this will load the actual tests + 'test/test/boot.js', // if --test-custom-asset *is not* present, we will add unit tests. // if --quick *is not* present, we will add integration tests. // if --external *is* present, we will add external asset tests. - // load relevant demo files - { - pattern: 'demo/!(main|load|demo_uncompiled|service_worker).js', - included: true, - }, - - // source files - these are only watched and served + // source files - these are only watched and served. + // anything not listed here can't be dynamically loaded by other scripts. {pattern: 'lib/**/*.js', included: false}, {pattern: 'ui/**/*.js', included: false}, {pattern: 'ui/**/*.less', included: false}, {pattern: 'third_party/**/*.js', included: false}, + {pattern: 'test/**/*.js', included: false}, {pattern: 'test/test/assets/*', included: false}, {pattern: 'test/test/assets/3675/*', included: false}, {pattern: 'dist/shaka-player.ui.js', included: false}, {pattern: 'dist/locales.js', included: false}, + {pattern: 'demo/**/*.js', included: false}, {pattern: 'demo/locales/en.json', included: false}, {pattern: 'demo/locales/source.json', included: false}, {pattern: 'node_modules/sprintf-js/src/sprintf.js', included: false}, @@ -284,26 +284,30 @@ module.exports = (config) => { }); } + const clientArgs = config.client.args[0]; + clientArgs.testFiles = []; + if (settings.test_custom_asset) { // If testing custom assets, we don't serve other unit or integration tests. // External asset tests are the basis for custom asset testing, so this file // is automatically included. - config.files.push('test/player_external.js'); + clientArgs.testFiles.push('test/player_external.js'); } else { // In a normal test run, we serve unit tests. - config.files.push('test/**/*_unit.js'); + clientArgs.testFiles.push('test/**/*_unit.js'); if (!settings.quick) { // If --quick is present, we don't serve integration tests. - config.files.push('test/**/*_integration.js'); + clientArgs.testFiles.push('test/**/*_integration.js'); } if (settings.external) { // If --external is present, we serve external asset tests. - config.files.push('test/**/*_external.js'); + clientArgs.testFiles.push('test/**/*_external.js'); } } - // We just modified the config in-place. No need for config.set() after we - // push to config.files. + + // These are the test files that will be dynamically loaded by boot.js. + clientArgs.testFiles = resolveGlobs(clientArgs.testFiles); const reporters = []; @@ -348,7 +352,6 @@ module.exports = (config) => { const seed = settings.seed == null ? new Date().getTime() : settings.seed; // Run tests in a random order. - const clientArgs = config.client.args[0]; clientArgs.random = true; clientArgs.seed = seed; @@ -356,6 +359,27 @@ module.exports = (config) => { } }; +/** + * Resolves a list of paths using globs into a list of explicit paths. + * Paths are all relative to the source directory. + * + * @param {!Array.} list + * @return {!Array.} + */ +function resolveGlobs(list) { + const options = { + cwd: __dirname, + }; + + const resolved = []; + for (const path of list) { + for (const resolvedPath of glob.sync(path, options)) { + resolved.push(resolvedPath); + } + } + return resolved; +} + /** * Determines which launchers and customLaunchers can be used and returns an * array of strings. diff --git a/test/abr/simple_abr_manager_unit.js b/test/abr/simple_abr_manager_unit.js index 52a4330fb2..d232c0b54c 100644 --- a/test/abr/simple_abr_manager_unit.js +++ b/test/abr/simple_abr_manager_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.abr.SimpleAbrManager'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.PlayerConfiguration'); - describe('SimpleAbrManager', () => { const sufficientBWMultiplier = 1.06; const defaultBandwidthEstimate = 500e3; // 500kbps diff --git a/test/ads/ad_manager_unit.js b/test/ads/ad_manager_unit.js index a8425bdc0e..d2c58a81ac 100644 --- a/test/ads/ad_manager_unit.js +++ b/test/ads/ad_manager_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.Player'); -goog.require('shaka.ads.AdManager'); -goog.require('shaka.test.FakeVideo'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); - describe('Ad manager', () => { /** @type {!shaka.test.FakeVideo} */ let mockVideo; diff --git a/test/cast/cast_proxy_unit.js b/test/cast/cast_proxy_unit.js index cb336e5a44..4055d362b2 100644 --- a/test/cast/cast_proxy_unit.js +++ b/test/cast/cast_proxy_unit.js @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cast.CastProxy'); -goog.require('shaka.cast.CastSender'); -goog.require('shaka.test.FakeVideo'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.FakeEvent'); -goog.require('shaka.util.PublicPromise'); - describe('CastProxy', () => { const CastProxy = shaka.cast.CastProxy; const FakeEvent = shaka.util.FakeEvent; diff --git a/test/cast/cast_receiver_integration.js b/test/cast/cast_receiver_integration.js index d1512e2de8..de94a67525 100644 --- a/test/cast/cast_receiver_integration.js +++ b/test/cast/cast_receiver_integration.js @@ -4,20 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.Player'); -goog.require('shaka.cast.CastReceiver'); -goog.require('shaka.cast.CastUtils'); -goog.require('shaka.log'); -goog.require('shaka.media.DrmEngine'); -goog.require('shaka.media.ManifestParser'); -goog.require('shaka.media.StreamingEngine'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.TestScheme'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.util.EventManager'); -goog.require('shaka.util.Platform'); -goog.require('shaka.util.PublicPromise'); - // The receiver is only meant to run on the Chromecast, so we have the // ability to use modern APIs there that may not be available on all of the // browsers our library supports. Because of this, CastReceiver tests will diff --git a/test/cast/cast_receiver_unit.js b/test/cast/cast_receiver_unit.js index 2199a2b32b..37163cdba1 100644 --- a/test/cast/cast_receiver_unit.js +++ b/test/cast/cast_receiver_unit.js @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cast.CastReceiver'); -goog.require('shaka.cast.CastUtils'); -goog.require('shaka.test.FakeVideo'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.Platform'); -goog.require('shaka.util.PublicPromise'); - // The receiver is only meant to run on the Chromecast, so we have the // ability to use modern APIs there that may not be available on all of the // browsers our library supports. Because of this, CastReceiver tests will diff --git a/test/cast/cast_sender_unit.js b/test/cast/cast_sender_unit.js index e038e5ca14..2602fc54d4 100644 --- a/test/cast/cast_sender_unit.js +++ b/test/cast/cast_sender_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cast.CastSender'); -goog.require('shaka.cast.CastUtils'); -goog.require('shaka.test.StatusPromise'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); - describe('CastSender', () => { const CastSender = shaka.cast.CastSender; const CastUtils = shaka.cast.CastUtils; diff --git a/test/cast/cast_utils_unit.js b/test/cast/cast_utils_unit.js index 0688d3ef89..54c7e77c58 100644 --- a/test/cast/cast_utils_unit.js +++ b/test/cast/cast_utils_unit.js @@ -4,19 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.Player'); -goog.require('shaka.cast.CastUtils'); -goog.require('shaka.media.MediaSourceEngine'); -goog.require('shaka.media.TimeRangesUtils'); -goog.require('shaka.test.FakeClosedCaptionParser'); -goog.require('shaka.test.FakeTextDisplayer'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.EventManager'); -goog.require('shaka.util.FakeEvent'); -goog.require('shaka.util.FakeEventTarget'); -goog.require('shaka.util.ManifestParserUtils'); - describe('CastUtils', () => { const CastUtils = shaka.cast.CastUtils; const FakeEvent = shaka.util.FakeEvent; diff --git a/test/cea/cea608_memory_unit.js b/test/cea/cea608_memory_unit.js index 5cc0918d25..4105b0bd41 100644 --- a/test/cea/cea608_memory_unit.js +++ b/test/cea/cea608_memory_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cea.Cea608Memory'); -goog.require('shaka.cea.CeaUtils'); -goog.require('shaka.test.CeaUtils'); -goog.require('shaka.text.Cue'); - describe('Cea608Memory', () => { const CeaUtils = shaka.test.CeaUtils; diff --git a/test/cea/cea708_service_unit.js b/test/cea/cea708_service_unit.js index 71b7465e27..550a08cc52 100644 --- a/test/cea/cea708_service_unit.js +++ b/test/cea/cea708_service_unit.js @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cea.Cea708Service'); -goog.require('shaka.cea.CeaUtils'); -goog.require('shaka.cea.DtvccPacket'); -goog.require('shaka.cea.DtvccPacketBuilder'); -goog.require('shaka.test.CeaUtils'); -goog.require('shaka.text.Cue'); - describe('Cea708Service', () => { const CeaUtils = shaka.test.CeaUtils; diff --git a/test/cea/cea708_window_unit.js b/test/cea/cea708_window_unit.js index 7082684cbf..e8f6c98913 100644 --- a/test/cea/cea708_window_unit.js +++ b/test/cea/cea708_window_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cea.Cea708Window'); -goog.require('shaka.cea.CeaUtils'); -goog.require('shaka.test.CeaUtils'); -goog.require('shaka.text.Cue'); - describe('Cea708Window', () => { const CeaUtils = shaka.test.CeaUtils; diff --git a/test/cea/cea_decoder_unit.js b/test/cea/cea_decoder_unit.js index 482dc41a0a..0223c0193a 100644 --- a/test/cea/cea_decoder_unit.js +++ b/test/cea/cea_decoder_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cea.CeaDecoder'); -goog.require('shaka.cea.CeaUtils'); -goog.require('shaka.log'); -goog.require('shaka.test.CeaUtils'); -goog.require('shaka.text.Cue'); - describe('CeaDecoder', () => { const CeaUtils = shaka.test.CeaUtils; diff --git a/test/cea/dtvcc_packet_builder_unit.js b/test/cea/dtvcc_packet_builder_unit.js index 39e61f237d..2dc26f011c 100644 --- a/test/cea/dtvcc_packet_builder_unit.js +++ b/test/cea/dtvcc_packet_builder_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cea.DtvccPacket'); -goog.require('shaka.cea.DtvccPacketBuilder'); - describe('DtvccPacketBuilder', () => { /** @type {!shaka.cea.DtvccPacketBuilder} */ let dtvccPacketBuilder; diff --git a/test/cea/dtvcc_packet_unit.js b/test/cea/dtvcc_packet_unit.js index 0c04ecca8f..67b0ccc6ac 100644 --- a/test/cea/dtvcc_packet_unit.js +++ b/test/cea/dtvcc_packet_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cea.DtvccPacket'); -goog.require('shaka.cea.DtvccPacketBuilder'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); - describe('DtvccPacket', () => { /** @type {!shaka.cea.DtvccPacket} */ let dtvccPacket; diff --git a/test/cea/mp4_cea_parser_unit.js b/test/cea/mp4_cea_parser_unit.js index aa7c8d45d0..3f93c65bc8 100644 --- a/test/cea/mp4_cea_parser_unit.js +++ b/test/cea/mp4_cea_parser_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.cea.Mp4CeaParser'); -goog.require('shaka.test.Util'); -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'; diff --git a/test/dash/dash_parser_content_protection_unit.js b/test/dash/dash_parser_content_protection_unit.js index 8e004ef267..2514c45fea 100644 --- a/test/dash/dash_parser_content_protection_unit.js +++ b/test/dash/dash_parser_content_protection_unit.js @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.dash.ContentProtection'); -goog.require('shaka.dash.DashParser'); -goog.require('shaka.test.Dash'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.Uint8ArrayUtils'); - // Test DRM-related parsing. describe('DashParser ContentProtection', () => { const Dash = shaka.test.Dash; diff --git a/test/dash/dash_parser_live_unit.js b/test/dash/dash_parser_live_unit.js index 3b8373a84d..ca1acceb8e 100644 --- a/test/dash/dash_parser_live_unit.js +++ b/test/dash/dash_parser_live_unit.js @@ -4,19 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.dash.DashParser'); -goog.require('shaka.media.SegmentReference'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.ManifestParser'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.StringUtils'); -goog.requireType('shaka.util.PublicPromise'); - describe('DashParser Live', () => { const Util = shaka.test.Util; const ManifestParser = shaka.test.ManifestParser; diff --git a/test/dash/dash_parser_manifest_unit.js b/test/dash/dash_parser_manifest_unit.js index 21aebadedb..0f20add3fe 100644 --- a/test/dash/dash_parser_manifest_unit.js +++ b/test/dash/dash_parser_manifest_unit.js @@ -4,21 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.media.SegmentReference'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.Dash'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.LanguageUtils'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.StringUtils'); -goog.requireType('shaka.dash.DashParser'); - // Test basic manifest parsing functionality. describe('DashParser Manifest', () => { const ContentType = shaka.util.ManifestParserUtils.ContentType; diff --git a/test/dash/dash_parser_segment_base_unit.js b/test/dash/dash_parser_segment_base_unit.js index 6f2731d884..ca054fe47d 100644 --- a/test/dash/dash_parser_segment_base_unit.js +++ b/test/dash/dash_parser_segment_base_unit.js @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.test.Dash'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.requireType('shaka.dash.DashParser'); - describe('DashParser SegmentBase', () => { const Dash = shaka.test.Dash; diff --git a/test/dash/dash_parser_segment_list_unit.js b/test/dash/dash_parser_segment_list_unit.js index 38f31092c9..1b95d6a076 100644 --- a/test/dash/dash_parser_segment_list_unit.js +++ b/test/dash/dash_parser_segment_list_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.test.Dash'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.ManifestParser'); -goog.require('shaka.util.Error'); - describe('DashParser SegmentList', () => { const Dash = shaka.test.Dash; const ManifestParser = shaka.test.ManifestParser; diff --git a/test/dash/dash_parser_segment_template_unit.js b/test/dash/dash_parser_segment_template_unit.js index 9e70452991..b0ff89ea1e 100644 --- a/test/dash/dash_parser_segment_template_unit.js +++ b/test/dash/dash_parser_segment_template_unit.js @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.test.Dash'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.ManifestParser'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.PlayerConfiguration'); -goog.requireType('shaka.dash.DashParser'); - describe('DashParser SegmentTemplate', () => { const Dash = shaka.test.Dash; const ManifestParser = shaka.test.ManifestParser; diff --git a/test/dash/mpd_utils_unit.js b/test/dash/mpd_utils_unit.js index fc00cf1be9..0a99b28fa8 100644 --- a/test/dash/mpd_utils_unit.js +++ b/test/dash/mpd_utils_unit.js @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.dash.MpdUtils'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.requireType('shaka.util.PublicPromise'); - describe('MpdUtils', () => { const MpdUtils = shaka.dash.MpdUtils; diff --git a/test/demo/demo_unit.js b/test/demo/demo_unit.js index bd1afa4806..1b0828de45 100644 --- a/test/demo/demo_unit.js +++ b/test/demo/demo_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.FakeDemoMain'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.StringUtils'); -goog.require('shakaDemo.MessageIds'); - describe('Demo', () => { beforeEach(() => { // Make mock versions of misc third-party libraries. diff --git a/test/deprecate/enforcer_unit.js b/test/deprecate/enforcer_unit.js index 30d09953b0..1968d1d0bd 100644 --- a/test/deprecate/enforcer_unit.js +++ b/test/deprecate/enforcer_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.deprecate.Enforcer'); -goog.require('shaka.deprecate.Version'); -goog.require('shaka.test.Util'); - describe('Enforcer', () => { const Enforcer = shaka.deprecate.Enforcer; const Version = shaka.deprecate.Version; diff --git a/test/deprecate/version_unit.js b/test/deprecate/version_unit.js index 6c95902f5c..b1962ef2b0 100644 --- a/test/deprecate/version_unit.js +++ b/test/deprecate/version_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.deprecate.Version'); - describe('Version', () => { const Version = shaka.deprecate.Version; diff --git a/test/hls/hls_live_unit.js b/test/hls/hls_live_unit.js index 97e80a406a..d50150d5ac 100644 --- a/test/hls/hls_live_unit.js +++ b/test/hls/hls_live_unit.js @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.hls.HlsParser'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.ManifestParser'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.Uint8ArrayUtils'); -goog.requireType('shaka.util.PublicPromise'); - describe('HlsParser live', () => { const ManifestParser = shaka.test.ManifestParser; diff --git a/test/hls/hls_parser_unit.js b/test/hls/hls_parser_unit.js index 9f11607459..46b6e3b3b3 100644 --- a/test/hls/hls_parser_unit.js +++ b/test/hls/hls_parser_unit.js @@ -4,17 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.hls.HlsParser'); -goog.require('shaka.log'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.Uint8ArrayUtils'); - describe('HlsParser', () => { const ContentType = shaka.util.ManifestParserUtils.ContentType; const TextStreamKind = shaka.util.ManifestParserUtils.TextStreamKind; diff --git a/test/hls/manifest_text_parser_unit.js b/test/hls/manifest_text_parser_unit.js index 9196fa43df..c637399510 100644 --- a/test/hls/manifest_text_parser_unit.js +++ b/test/hls/manifest_text_parser_unit.js @@ -4,16 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - -goog.require('shaka.hls.Attribute'); -goog.require('shaka.hls.ManifestTextParser'); -goog.require('shaka.hls.PlaylistType'); -goog.require('shaka.hls.Segment'); -goog.require('shaka.hls.Tag'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.StringUtils'); - describe('ManifestTextParser', () => { /** @type {!shaka.hls.ManifestTextParser} */ let parser; diff --git a/test/media/adaptation_set_criteria_unit.js b/test/media/adaptation_set_criteria_unit.js index d6464608ff..47e5e7a7e5 100644 --- a/test/media/adaptation_set_criteria_unit.js +++ b/test/media/adaptation_set_criteria_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.PreferenceBasedCriteria'); -goog.require('shaka.test.ManifestGenerator'); -goog.requireType('shaka.media.AdaptationSet'); - describe('AdaptationSetCriteria', () => { describe('preference based selection', () => { it('chooses variants in user\'s preferred language', () => { diff --git a/test/media/adaptation_set_unit.js b/test/media/adaptation_set_unit.js index 426ec7959d..ebd0be76eb 100644 --- a/test/media/adaptation_set_unit.js +++ b/test/media/adaptation_set_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.AdaptationSet'); - describe('AdaptationSet', () => { describe('roles', () => { const mimeType = 'mime-type'; diff --git a/test/media/buffering_observer_unit.js b/test/media/buffering_observer_unit.js index 21f7b37c77..a0ae8f6ebc 100644 --- a/test/media/buffering_observer_unit.js +++ b/test/media/buffering_observer_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.BufferingObserver'); - describe('BufferingObserver', () => { const BufferingObserver = shaka.media.BufferingObserver; const State = shaka.media.BufferingObserver.State; diff --git a/test/media/closed_caption_parser_unit.js b/test/media/closed_caption_parser_unit.js index 705ab55f70..9bfd1657ba 100644 --- a/test/media/closed_caption_parser_unit.js +++ b/test/media/closed_caption_parser_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.ClosedCaptionParser'); -goog.require('shaka.test.Util'); - describe('ClosedCaptionParser', () => { it('can handle empty caption packets', async () => { const initSegment = await shaka.test.Util.fetch( diff --git a/test/media/drm_engine_integration.js b/test/media/drm_engine_integration.js index 78a7dbb9ab..920f9d5a4b 100644 --- a/test/media/drm_engine_integration.js +++ b/test/media/drm_engine_integration.js @@ -4,21 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.DrmEngine'); -goog.require('shaka.media.MediaSourceEngine'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.FakeClosedCaptionParser'); -goog.require('shaka.test.FakeTextDisplayer'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.util.EventManager'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.Platform'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.PublicPromise'); - describe('DrmEngine', () => { const ContentType = shaka.util.ManifestParserUtils.ContentType; diff --git a/test/media/drm_engine_unit.js b/test/media/drm_engine_unit.js index 2de91cf0ee..5077388e08 100644 --- a/test/media/drm_engine_unit.js +++ b/test/media/drm_engine_unit.js @@ -4,26 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.log'); -goog.require('shaka.media.DrmEngine'); -goog.require('shaka.media.Transmuxer'); -goog.require('shaka.net.DataUriPlugin'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.FakeVideo'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.Platform'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.Platform'); -goog.require('shaka.util.PublicPromise'); -goog.require('shaka.util.StringUtils'); -goog.require('shaka.util.Uint8ArrayUtils'); - - describe('DrmEngine', () => { const Util = shaka.test.Util; diff --git a/test/media/manifest_parser_unit.js b/test/media/manifest_parser_unit.js index 67dd1ba283..3f9bb1c2a1 100644 --- a/test/media/manifest_parser_unit.js +++ b/test/media/manifest_parser_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.ManifestParser'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.FakeNetworkingEngine'); - const testGetMimeType = async (expertedMimeType, contentType) => { const netEngine = new shaka.test.FakeNetworkingEngine() .setHeaders('dummy://foo', {'content-type': contentType}); diff --git a/test/media/media_source_engine_integration.js b/test/media/media_source_engine_integration.js index 4d0727a1b5..fb4bd579dd 100644 --- a/test/media/media_source_engine_integration.js +++ b/test/media/media_source_engine_integration.js @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.ClosedCaptionParser'); -goog.require('shaka.media.MediaSourceEngine'); -goog.require('shaka.test.FakeTextDisplayer'); -goog.require('shaka.test.TestScheme'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.util.ManifestParserUtils'); - describe('MediaSourceEngine', () => { const ContentType = shaka.util.ManifestParserUtils.ContentType; const presentationDuration = 840; diff --git a/test/media/media_source_engine_unit.js b/test/media/media_source_engine_unit.js index eeb1ebd06b..3dbe0fdb93 100644 --- a/test/media/media_source_engine_unit.js +++ b/test/media/media_source_engine_unit.js @@ -4,19 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - -goog.require('goog.asserts'); -goog.require('shaka.media.MediaSourceEngine'); -goog.require('shaka.media.Transmuxer'); -goog.require('shaka.test.FakeClosedCaptionParser'); -goog.require('shaka.test.FakeTextDisplayer'); -goog.require('shaka.test.FakeTransmuxer'); -goog.require('shaka.test.StatusPromise'); -goog.require('shaka.test.Util'); -goog.require('shaka.text.TextEngine'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.ManifestParserUtils'); - /** * @typedef {{ * length: number, diff --git a/test/media/mp4_segment_index_parser_unit.js b/test/media/mp4_segment_index_parser_unit.js index baf770ec0c..c67cf465b3 100644 --- a/test/media/mp4_segment_index_parser_unit.js +++ b/test/media/mp4_segment_index_parser_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.Mp4SegmentIndexParser'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); - describe('Mp4SegmentIndexParser', () => { const Util = shaka.test.Util; diff --git a/test/media/play_rate_controller_unit.js b/test/media/play_rate_controller_unit.js index 25b015a4fe..b7c6028565 100644 --- a/test/media/play_rate_controller_unit.js +++ b/test/media/play_rate_controller_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - -goog.require('shaka.media.PlayRateController'); -goog.require('shaka.test.Util'); - describe('PlayRateController', () => { /** @type {!jasmine.Spy} */ let getPlayRateSpy; diff --git a/test/media/playhead_unit.js b/test/media/playhead_unit.js index 549381dc4a..0e9b149c4d 100644 --- a/test/media/playhead_unit.js +++ b/test/media/playhead_unit.js @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - -goog.require('shaka.media.MediaSourcePlayhead'); -goog.require('shaka.test.FakePresentationTimeline'); -goog.require('shaka.test.FakeVideo'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.PlayerConfiguration'); -goog.requireType('shaka.media.Playhead'); - /** * @typedef {{start: number, end: number}} * diff --git a/test/media/presentation_timeline_unit.js b/test/media/presentation_timeline_unit.js index ecbceaf348..03d2bf94fa 100644 --- a/test/media/presentation_timeline_unit.js +++ b/test/media/presentation_timeline_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.PresentationTimeline'); -goog.require('shaka.test.ManifestParser'); - describe('PresentationTimeline', () => { const originalDateNow = Date.now; const makeSegmentReference = (startTime, endTime) => { diff --git a/test/media/quality_observer_unit.js b/test/media/quality_observer_unit.js index 1d8ab5a2d1..3b9e0be664 100644 --- a/test/media/quality_observer_unit.js +++ b/test/media/quality_observer_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.QualityObserver'); -goog.require('shaka.test.Util'); - - describe('QualityObserver', () => { /** @type {!shaka.media.QualityObserver} */ let observer; diff --git a/test/media/region_observer_unit.js b/test/media/region_observer_unit.js index 6334dc275d..6d49f38a43 100644 --- a/test/media/region_observer_unit.js +++ b/test/media/region_observer_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.RegionObserver'); -goog.require('shaka.media.RegionTimeline'); -goog.require('shaka.test.Util'); -goog.requireType('shaka.media.IPlayheadObserver'); - describe('RegionObserver', () => { /** @type {!shaka.media.RegionTimeline} */ let timeline; diff --git a/test/media/region_timeline_unit.js b/test/media/region_timeline_unit.js index ceb7c4e17a..9ab76db499 100644 --- a/test/media/region_timeline_unit.js +++ b/test/media/region_timeline_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.RegionTimeline'); -goog.require('shaka.test.Util'); - describe('RegionTimeline', () => { /** @type {!shaka.media.RegionTimeline} */ let timeline; diff --git a/test/media/segment_index_unit.js b/test/media/segment_index_unit.js index b0edfd3ce5..4f858fddd0 100644 --- a/test/media/segment_index_unit.js +++ b/test/media/segment_index_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.media.MetaSegmentIndex'); -goog.require('shaka.media.SegmentIndex'); -goog.require('shaka.media.SegmentReference'); -goog.require('shaka.test.Util'); - describe('SegmentIndex', /** @suppress {accessControls} */ () => { const actual1 = makeReference(uri(0), 0, 10); const actual2 = makeReference(uri(20), 10, 20); diff --git a/test/media/segment_reference_unit.js b/test/media/segment_reference_unit.js index 25c456f16a..13157ad632 100644 --- a/test/media/segment_reference_unit.js +++ b/test/media/segment_reference_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.InitSegmentReference'); -goog.require('shaka.media.SegmentReference'); - describe('SegmentReference', () => { it('returns in getters values from constructor parameters', () => { const initSegmentReference = new shaka.media.InitSegmentReference( diff --git a/test/media/stall_detector_unit.js b/test/media/stall_detector_unit.js index a50a200037..bbe1b55739 100644 --- a/test/media/stall_detector_unit.js +++ b/test/media/stall_detector_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - -goog.require('shaka.media.StallDetector'); -goog.require('shaka.media.StallDetector.Implementation'); -goog.require('shaka.test.Util'); - describe('StallDetector', () => { /** * @implements {shaka.media.StallDetector.Implementation} diff --git a/test/media/streaming_engine_integration.js b/test/media/streaming_engine_integration.js index df866c8fb3..84768a1440 100644 --- a/test/media/streaming_engine_integration.js +++ b/test/media/streaming_engine_integration.js @@ -4,31 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.InitSegmentReference'); -goog.require('shaka.media.MediaSourceEngine'); -goog.require('shaka.media.MediaSourcePlayhead'); -goog.require('shaka.media.SegmentIndex'); -goog.require('shaka.media.SegmentReference'); -goog.require('shaka.media.StreamingEngine'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.FakeClosedCaptionParser'); -goog.require('shaka.test.FakeTextDisplayer'); -goog.require('shaka.test.Mp4LiveStreamGenerator'); -goog.require('shaka.test.Mp4VodStreamGenerator'); -goog.require('shaka.test.StreamingEngineUtil'); -goog.require('shaka.test.TestScheme'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.util.EventManager'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.Platform'); -goog.require('shaka.util.PlayerConfiguration'); -goog.requireType('shaka.media.Playhead'); -goog.requireType('shaka.media.PresentationTimeline'); -goog.requireType('shaka.test.FakeNetworkingEngine'); -goog.requireType('shaka.test.FakePresentationTimeline'); - describe('StreamingEngine', () => { const ContentType = shaka.util.ManifestParserUtils.ContentType; const Util = shaka.test.Util; diff --git a/test/media/streaming_engine_unit.js b/test/media/streaming_engine_unit.js index 55e7dac165..a2035438e4 100644 --- a/test/media/streaming_engine_unit.js +++ b/test/media/streaming_engine_unit.js @@ -4,29 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.log'); -goog.require('shaka.media.InitSegmentReference'); -goog.require('shaka.media.SegmentReference'); -goog.require('shaka.media.StreamingEngine'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.net.NetworkingEngine.PendingRequest'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.FakeMediaSourceEngine'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.StreamingEngineUtil'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.MimeUtils'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.PublicPromise'); -goog.require('shaka.util.Uint8ArrayUtils'); -goog.requireType('shaka.media.PresentationTimeline'); -goog.requireType('shaka.test.FakeNetworkingEngine'); -goog.requireType('shaka.test.FakePresentationTimeline'); - describe('StreamingEngine', () => { const Util = shaka.test.Util; const ContentType = shaka.util.ManifestParserUtils.ContentType; diff --git a/test/media/time_ranges_utils_unit.js b/test/media/time_ranges_utils_unit.js index 2e970f9e8b..6fefc1b190 100644 --- a/test/media/time_ranges_utils_unit.js +++ b/test/media/time_ranges_utils_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.TimeRangesUtils'); - describe('TimeRangesUtils', () => { const TimeRangesUtils = shaka.media.TimeRangesUtils; diff --git a/test/media/transmuxer_integration.js b/test/media/transmuxer_integration.js index 4c095e4497..d229ec83c5 100644 --- a/test/media/transmuxer_integration.js +++ b/test/media/transmuxer_integration.js @@ -3,12 +3,6 @@ * Copyright 2016 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.media.Transmuxer'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.Mp4BoxParsers'); -goog.require('shaka.util.Mp4Parser'); describe('Transmuxer', () => { const ContentType = shaka.util.ManifestParserUtils.ContentType; diff --git a/test/media/webm_segment_index_parser_unit.js b/test/media/webm_segment_index_parser_unit.js index 0c1522eb42..6050f7af40 100644 --- a/test/media/webm_segment_index_parser_unit.js +++ b/test/media/webm_segment_index_parser_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.WebmSegmentIndexParser'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); - describe('WebmSegmentIndexParser', () => { const indexSegmentUri = '/base/test/test/assets/index-segment.webm'; const initSegmentUri = '/base/test/test/assets/init-segment.webm'; diff --git a/test/net/data_uri_plugin_unit.js b/test/net/data_uri_plugin_unit.js index 13c3e7eb1e..06fe61fe03 100644 --- a/test/net/data_uri_plugin_unit.js +++ b/test/net/data_uri_plugin_unit.js @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.net.DataUriPlugin'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.net.NetworkingEngine.RequestType'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.StringUtils'); - describe('DataUriPlugin', () => { const retryParameters = shaka.net.NetworkingEngine.defaultRetryParameters(); diff --git a/test/net/http_plugin_unit.js b/test/net/http_plugin_unit.js index 04c264683b..20fc7a5036 100644 --- a/test/net/http_plugin_unit.js +++ b/test/net/http_plugin_unit.js @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - -goog.require('shaka.net.HttpFetchPlugin'); -goog.require('shaka.net.HttpXHRPlugin'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.net.NetworkingEngine.RequestType'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.Error'); - /** * Add a set of http plugin tests, for the given scheme plugin. * diff --git a/test/net/networking_engine_unit.js b/test/net/networking_engine_unit.js index d6db85a518..3fe96ad03f 100644 --- a/test/net/networking_engine_unit.js +++ b/test/net/networking_engine_unit.js @@ -4,17 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.net.Backoff'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.net.NetworkingEngine.RequestType'); -goog.require('shaka.test.StatusPromise'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.Networking'); -goog.require('shaka.util.PublicPromise'); -goog.requireType('shaka.net.NetworkingEngine.PendingRequest'); - describe('NetworkingEngine', /** @suppress {accessControls} */ () => { const StatusPromise = shaka.test.StatusPromise; const Util = shaka.test.Util; diff --git a/test/offline/download_progress_estimator_unit.js b/test/offline/download_progress_estimator_unit.js index 621670ce33..1cc0513f46 100644 --- a/test/offline/download_progress_estimator_unit.js +++ b/test/offline/download_progress_estimator_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.offline.DownloadProgressEstimator'); - describe('DownloadProgressEstimator', () => { /** @type {!shaka.offline.DownloadProgressEstimator} */ let estimator; diff --git a/test/offline/indexeddb_storage_unit.js b/test/offline/indexeddb_storage_unit.js index dfc1e76049..f210b9b496 100644 --- a/test/offline/indexeddb_storage_unit.js +++ b/test/offline/indexeddb_storage_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.offline.indexeddb.V5StorageCell'); -goog.require('shaka.test.IndexedDBUtils'); -goog.require('shaka.test.OfflineUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); - filterDescribe('IndexeddbStorageCell', () => window.indexedDB, () => { const IndexedDBUtils = shaka.test.IndexedDBUtils; const OfflineUtils = shaka.test.OfflineUtils; diff --git a/test/offline/manifest_convert_unit.js b/test/offline/manifest_convert_unit.js index 62b3e04058..a25c58cf6f 100644 --- a/test/offline/manifest_convert_unit.js +++ b/test/offline/manifest_convert_unit.js @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.media.InitSegmentReference'); -goog.require('shaka.media.PresentationTimeline'); -goog.require('shaka.media.SegmentIndex'); -goog.require('shaka.offline.ManifestConverter'); -goog.require('shaka.offline.OfflineUri'); -goog.require('shaka.util.ManifestParserUtils'); -goog.requireType('shaka.media.SegmentReference'); - describe('ManifestConverter', () => { describe('createVariants', () => { const audioType = 'audio'; diff --git a/test/offline/offline_integration.js b/test/offline/offline_integration.js index a8379e17e2..52646de48a 100644 --- a/test/offline/offline_integration.js +++ b/test/offline/offline_integration.js @@ -4,16 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.Player'); -goog.require('shaka.offline.Storage'); -goog.require('shaka.test.TestScheme'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.util.EventManager'); -goog.require('shaka.util.Platform'); - /** @return {boolean} */ const supportsStorage = () => shaka.offline.Storage.support(); diff --git a/test/offline/offline_manifest_parser_unit.js b/test/offline/offline_manifest_parser_unit.js index 79620e90dc..cc692c83f4 100644 --- a/test/offline/offline_manifest_parser_unit.js +++ b/test/offline/offline_manifest_parser_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.offline.OfflineManifestParser'); -goog.require('shaka.offline.OfflineUri'); -goog.require('shaka.offline.StorageMuxer'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); - /** @return {boolean} */ const offlineManifestParserSupport = () => shaka.offline.StorageMuxer.support(); filterDescribe('OfflineManifestParser', offlineManifestParserSupport, () => { diff --git a/test/offline/offline_scheme_unit.js b/test/offline/offline_scheme_unit.js index ec69899a7f..95c180f5ea 100644 --- a/test/offline/offline_scheme_unit.js +++ b/test/offline/offline_scheme_unit.js @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.net.NetworkingEngine.RequestType'); -goog.require('shaka.offline.OfflineScheme'); -goog.require('shaka.offline.OfflineUri'); -goog.require('shaka.offline.StorageMuxer'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); - /** @return {boolean} */ const offlineSchemeSupport = () => shaka.offline.StorageMuxer.support(); filterDescribe('OfflineScheme', offlineSchemeSupport, () => { diff --git a/test/offline/offline_uri_unit.js b/test/offline/offline_uri_unit.js index ec4240150d..85f348b86c 100644 --- a/test/offline/offline_uri_unit.js +++ b/test/offline/offline_uri_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.offline.OfflineUri'); - describe('OfflineUri', () => { const OfflineUri = shaka.offline.OfflineUri; diff --git a/test/offline/storage_compatibility_unit.js b/test/offline/storage_compatibility_unit.js index a31c8e30d4..8f97b4fafe 100644 --- a/test/offline/storage_compatibility_unit.js +++ b/test/offline/storage_compatibility_unit.js @@ -4,19 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.offline.ManifestConverter'); -goog.require('shaka.offline.indexeddb.V1StorageCell'); -goog.require('shaka.offline.indexeddb.V2StorageCell'); -goog.require('shaka.offline.indexeddb.V5StorageCell'); -goog.require('shaka.test.CannedIDB'); -goog.require('shaka.test.IndexedDBUtils'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.StringUtils'); - // All of the database dumps referenced below were originally made from the // "Heliocentrism" content in our demo app. // https://storage.googleapis.com/shaka-demo-assets/heliocentrism/heliocentrism.mpd diff --git a/test/offline/storage_integration.js b/test/offline/storage_integration.js index 76b51a853d..ee5b39ecd2 100644 --- a/test/offline/storage_integration.js +++ b/test/offline/storage_integration.js @@ -4,32 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.Player'); -goog.require('shaka.media.DrmEngine'); -goog.require('shaka.media.ManifestParser'); -goog.require('shaka.media.SegmentIndex'); -goog.require('shaka.net.NetworkingEngine.RequestType'); -goog.require('shaka.offline.ManifestConverter'); -goog.require('shaka.offline.OfflineUri'); -goog.require('shaka.offline.Storage'); -goog.require('shaka.offline.StorageMuxer'); -goog.require('shaka.test.FakeDrmEngine'); -goog.require('shaka.test.FakeManifestParser'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.Loader'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.TestScheme'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.EventManager'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.PublicPromise'); -goog.require('shaka.util.Uint8ArrayUtils'); -goog.requireType('shaka.media.SegmentReference'); - /** @return {boolean} */ function storageSupport() { return shaka.offline.Storage.support(); diff --git a/test/player_external.js b/test/player_external.js index afd9573247..887aaa8273 100644 --- a/test/player_external.js +++ b/test/player_external.js @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('ShakaDemoAssetInfo'); -goog.require('shaka.test.Loader'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.util.EventManager'); -goog.requireType('shaka.Player'); -goog.requireType('shaka.net.NetworkingEngine.RequestType'); - describe('Player', () => { const Util = shaka.test.Util; const Feature = shakaAssets.Feature; diff --git a/test/player_integration.js b/test/player_integration.js index fa9bba8939..aa29101679 100644 --- a/test/player_integration.js +++ b/test/player_integration.js @@ -4,20 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.Uri'); -goog.require('shaka.Player'); -goog.require('shaka.log'); -goog.require('shaka.media.DrmEngine'); -goog.require('shaka.media.TimeRangesUtils'); -goog.require('shaka.test.FakeAbrManager'); -goog.require('shaka.test.FakeTextDisplayer'); -goog.require('shaka.test.Loader'); -goog.require('shaka.test.TestScheme'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.util.EventManager'); - describe('Player', () => { /** @type {!jasmine.Spy} */ let onErrorSpy; diff --git a/test/player_load_graph_integration.js b/test/player_load_graph_integration.js index 036b0eb545..987aef0383 100644 --- a/test/player_load_graph_integration.js +++ b/test/player_load_graph_integration.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.Player'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); - describe('Player Load Graph', () => { const SMALL_MP4_CONTENT_URI = '/base/test/test/assets/small.mp4'; diff --git a/test/player_src_equals_external.js b/test/player_src_equals_external.js index ad41e7ade6..607779b369 100644 --- a/test/player_src_equals_external.js +++ b/test/player_src_equals_external.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.Player'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.util.EventManager'); - describe('Player Src Equals', () => { // This asset needs to be (1) long and (2) high bitrate so that we can // invoke unbuffered seeks. diff --git a/test/player_src_equals_integration.js b/test/player_src_equals_integration.js index 9599d18643..4e3e8a00df 100644 --- a/test/player_src_equals_integration.js +++ b/test/player_src_equals_integration.js @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.Uri'); -goog.require('shaka.Player'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.util.EventManager'); - // These tests are for testing Shaka Player's integration with // |HTMLMediaElement.src=|. These tests are to verify that all |shaka.Player| // public methods behaviour correctly when playing content video |src=|. diff --git a/test/player_unit.js b/test/player_unit.js index 805b47e7fc..24e3944895 100644 --- a/test/player_unit.js +++ b/test/player_unit.js @@ -4,29 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.Player'); -goog.require('shaka.log'); -goog.require('shaka.media.BufferingObserver'); -goog.require('shaka.media.ManifestParser'); -goog.require('shaka.media.PresentationTimeline'); -goog.require('shaka.media.SegmentReference'); -goog.require('shaka.media.SegmentIndex'); -goog.require('shaka.test.FakeAbrManager'); -goog.require('shaka.test.FakeDrmEngine'); -goog.require('shaka.test.FakeManifestParser'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.FakePlayhead'); -goog.require('shaka.test.FakeStreamingEngine'); -goog.require('shaka.test.FakeTextDisplayer'); -goog.require('shaka.test.FakeVideo'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.ConfigUtils'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.ManifestParserUtils'); -goog.requireType('shaka.media.Playhead'); - describe('Player', () => { const ContentType = shaka.util.ManifestParserUtils.ContentType; const Util = shaka.test.Util; diff --git a/test/routing/walker_unit.js b/test/routing/walker_unit.js index a226ac09ac..cce94f0a50 100644 --- a/test/routing/walker_unit.js +++ b/test/routing/walker_unit.js @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.routing.Walker'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.PublicPromise'); -goog.requireType('shaka.routing.Node'); - describe('Walker', () => { const AbortableOperation = shaka.util.AbortableOperation; diff --git a/test/test/boot.js b/test/test/boot.js index 1210848aaa..999bd6f425 100644 --- a/test/test/boot.js +++ b/test/test/boot.js @@ -4,18 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.Player'); -goog.require('shaka.log'); -goog.require('shaka.polyfill'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.Platform'); - -// If ENABLE_DEBUG_LOADER is not set to false, goog.require() will try to load -// extra sources on-the-fly using pre-computed pathes in deps.js, which is not -// applicable for the tests. -goog['ENABLE_DEBUG_LOADER'] = false; - /** * Gets the value of an argument passed from karma. * @param {string} name @@ -384,9 +372,10 @@ function configureJasmineEnvironment() { }; } -// Executed before test utilities and tests are loaded, but after Shaka Player -// is loaded in uncompiled mode. -try { +/** + * Set up the Shaka Player test environment. + */ +function setupTestEnvironment() { failTestsOnFailedAssertions(); failTestsOnNamespacedElementOrAttributeNames(); failTestsOnUnhandledRejections(); @@ -399,12 +388,76 @@ try { shaka.polyfill.installAll(); configureJasmineEnvironment(); +} - // eslint-disable-next-line no-restricted-syntax -} catch (error) { - // Throw this boot-sequence error in place of jasmine's execute method, to - // fail clearly and right away without running any tests. - jasmine.getEnv().execute = () => { - throw error; - }; +/** + * Load a script dynamically and await completion. + * + * @param {string} file + * @return {!Promise} + */ +function loadScript(file) { + return new Promise((resolve, reject) => { + const script = /** @type {!HTMLScriptElement} */( + document.createElement('script')); + script.defer = false; + script['async'] = false; + script.onload = resolve; + script.onerror = reject; + script.setAttribute('src', '/base/' + file); + document.head.appendChild(script); + }); } + +/** + * Load all test scripts and await completion. + * + * @return {!Promise} + */ +function loadTests() { + const loadPromises = []; + for (const file of getClientArg('testFiles')) { + loadPromises.push(loadScript(file)); + } + return Promise.all(loadPromises); +} + +// Hijack Karma's start() method and start things our way. +// eslint-disable-next-line no-restricted-syntax +const originalStart = window.__karma__.start.bind(window.__karma__); +window.__karma__.start = async () => { + // Executed when Karma has finished loading everything it loads for us. + // Those things were all loaded in parallel, and had no interdependencies + // other than those in the Shaka Player library, tracked by the Closure + // library's goog.require/goog.provide. + + // Now we load the tests from here, rather than letting Karma do it. This + // give us control over the order, so that everything else is loaded and + // complete before any tests are requested. Then we may reference test + // utilities and library namespaces in the body of describe() blocks, which + // are executed synchronously as the test scripts are loaded. Without this + // ordering, we would have to either: + // 1. very carefully avoid references in describe() and defer them to + // beforeAll() + // or 2. strictly adopt goog.provide/goog.require throughout our tests + // In those scenarios, failure to do so would only manifest some of the time + // and on certain platforms. So this seems to be the more robust solution. + + // See https://github.com/shaka-project/shaka-player/issues/4094 + + try { + setupTestEnvironment(); + console.log('Set up test environment.'); + await loadTests(); + console.log('Loaded all tests.'); + + // eslint-disable-next-line no-restricted-syntax + } catch (error) { + console.error('Error during setup:', error); + window.__karma__.error(error); + return; + } + + // Finally, start the tests. + originalStart(); +}; diff --git a/test/test/externs/karma.js b/test/test/externs/karma.js index a98a11e9d0..cb303cee63 100644 --- a/test/test/externs/karma.js +++ b/test/test/externs/karma.js @@ -20,3 +20,7 @@ __karma__.config = {}; /** @const {!Array.<*>} */ __karma__.config.args; + + +/** @param {?} error */ +__karma__.error = function(error) {}; diff --git a/test/test/namespace.js b/test/test/namespace.js new file mode 100644 index 0000000000..6b5e84195b --- /dev/null +++ b/test/test/namespace.js @@ -0,0 +1,10 @@ +/*! @license + * Shaka Player + * Copyright 2016 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +// Define the shaka.test namespace before we load the test utilities. +// Without goog.provide in the test utils, this has to be explicit and come +// before we load the utils. +shaka.test = {}; diff --git a/test/test/util/canned_idb.js b/test/test/util/canned_idb.js index d4e296bfef..02b2772b44 100644 --- a/test/test/util/canned_idb.js +++ b/test/test/util/canned_idb.js @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.CannedIDB'); - -goog.require('shaka.log'); -goog.require('shaka.offline.indexeddb.DBOperation'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.Uint8ArrayUtils'); - - /** * A testing utility that can be used to dump and restore entire IndexedDB * databases. This can be inserted into a running app to snapshot databases diff --git a/test/test/util/cea_utils.js b/test/test/util/cea_utils.js index 800f4a2ae3..8da6e8a28e 100644 --- a/test/test/util/cea_utils.js +++ b/test/test/util/cea_utils.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.CeaUtils'); - -goog.require('shaka.cea.CeaUtils'); -goog.require('shaka.text.Cue'); - - /** * Testing helpers to assist tests for Closed Caption decoders for CEA captions. */ diff --git a/test/test/util/dash_parser_util.js b/test/test/util/dash_parser_util.js index 7247aea971..32f098c05e 100644 --- a/test/test/util/dash_parser_util.js +++ b/test/test/util/dash_parser_util.js @@ -4,19 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.Dash'); - -goog.require('goog.asserts'); -goog.require('shaka.dash.DashParser'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.ManifestParser'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.PlayerConfiguration'); -goog.require('shaka.util.StringUtils'); -goog.requireType('shaka.media.SegmentReference'); -goog.requireType('shaka.util.Error'); - - /** @summary Utilities for working with the DASH parser. */ shaka.test.Dash = class { /** diff --git a/test/test/util/fake_ad.js b/test/test/util/fake_ad.js index 6f42dfa0b9..3d478d58be 100644 --- a/test/test/util/fake_ad.js +++ b/test/test/util/fake_ad.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.FakeAd'); - - /** * @implements {shaka.extern.IAd} */ diff --git a/test/test/util/fake_ad_manager.js b/test/test/util/fake_ad_manager.js index fcca89249e..9564ca8ebe 100644 --- a/test/test/util/fake_ad_manager.js +++ b/test/test/util/fake_ad_manager.js @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.FakeAdManager'); - -goog.require('shaka.ads.AdManager'); -goog.require('shaka.ads.AdsStats'); -goog.require('shaka.util.FakeEvent'); -goog.require('shaka.util.FakeEventTarget'); -goog.requireType('shaka.test.FakeAd'); - - /** * @implements {shaka.extern.IAdManager} * @final diff --git a/test/test/util/fake_demo_main.js b/test/test/util/fake_demo_main.js index 9fab0f6d33..4a55c48244 100644 --- a/test/test/util/fake_demo_main.js +++ b/test/test/util/fake_demo_main.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.FakeDemoMain'); - -goog.require('shaka.Player'); - - /** * @summary * This simulates the interface between ShakaDemoMain and the various tabs. diff --git a/test/test/util/fake_drm_engine.js b/test/test/util/fake_drm_engine.js index 1720f6b6c0..79140c5d43 100644 --- a/test/test/util/fake_drm_engine.js +++ b/test/test/util/fake_drm_engine.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.FakeDrmEngine'); - -goog.require('shaka.media.DrmEngine'); -goog.require('shaka.test.Util'); - - /** * A fake DrmEngine. * diff --git a/test/test/util/fake_media_source_engine.js b/test/test/util/fake_media_source_engine.js index 9fc9966398..12efe81ee2 100644 --- a/test/test/util/fake_media_source_engine.js +++ b/test/test/util/fake_media_source_engine.js @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.FakeMediaSourceEngine'); - -goog.require('shaka.media.MediaSourceEngine'); -goog.require('shaka.test.FakeTextDisplayer'); -goog.require('shaka.util.ManifestParserUtils'); - - /** * @summary * This simulates multiple SourceBuffers. However, it only diff --git a/test/test/util/fake_networking_engine.js b/test/test/util/fake_networking_engine.js index fc209ad4ba..4a0cb293fd 100644 --- a/test/test/util/fake_networking_engine.js +++ b/test/test/util/fake_networking_engine.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.FakeNetworkingEngine'); - -/** @fileoverview @suppress {missingRequire} */ - - /** * A fake networking engine that returns constant data. The request member * is a jasmine spy and can be used to check the actual calls that occurred. diff --git a/test/test/util/fake_text_displayer.js b/test/test/util/fake_text_displayer.js index 927b5aa936..784907ae93 100644 --- a/test/test/util/fake_text_displayer.js +++ b/test/test/util/fake_text_displayer.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.FakeTextDisplayer'); - -goog.require('shaka.test.Util'); - - /** * @implements {shaka.extern.TextDisplayer} * @final diff --git a/test/test/util/indexeddb_utils.js b/test/test/util/indexeddb_utils.js index b2d60c498e..31ab9de95d 100644 --- a/test/test/util/indexeddb_utils.js +++ b/test/test/util/indexeddb_utils.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.IndexedDBUtils'); - -goog.require('shaka.test.Util'); -goog.require('shaka.util.PublicPromise'); - - shaka.test.IndexedDBUtils = class { /** * Make a connection to indexeddb. This assumes that it will be a new diff --git a/test/test/util/jasmine_fetch.js b/test/test/util/jasmine_fetch.js index 9a2314ad9e..2b1df03533 100644 --- a/test/test/util/jasmine_fetch.js +++ b/test/test/util/jasmine_fetch.js @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - // TODO: this only contains the methods that we use; if this is published // it should contain the entire breadth of options in jasmine-ajax. diff --git a/test/test/util/loader.js b/test/test/util/loader.js index 985e5b4114..a023aadefe 100644 --- a/test/test/util/loader.js +++ b/test/test/util/loader.js @@ -4,24 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.Loader'); - -goog.require('shaka.log'); -goog.require('shaka.test.TestScheme'); -goog.require('shaka.util.PublicPromise'); -goog.requireType('shaka.Player'); -goog.requireType('shaka.media.InitSegmentReference'); -goog.requireType('shaka.media.PresentationTimeline'); -goog.requireType('shaka.media.SegmentIndex'); -goog.requireType('shaka.media.SegmentReference'); -goog.requireType('shaka.net.NetworkingEngine'); -goog.requireType('shaka.offline.Storage'); -goog.requireType('shaka.ui.Controls'); -goog.requireType('shaka.ui.Element'); -goog.requireType('shaka.ui.Overlay'); -goog.requireType('shaka.util.StringUtils'); - - /** * A stand-in type for the "shaka" namespace. Used when loading the compiled * library or when referencing it in ManifestGenerator or TestScheme. diff --git a/test/test/util/manifest_generator.js b/test/test/util/manifest_generator.js index f505786dcb..799837db64 100644 --- a/test/test/util/manifest_generator.js +++ b/test/test/util/manifest_generator.js @@ -4,17 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.ManifestGenerator'); - -goog.require('goog.asserts'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.Uint8ArrayUtils'); -goog.requireType('shaka.media.InitSegmentReference'); -goog.requireType('shaka.media.PresentationTimeline'); -goog.requireType('shaka.media.SegmentIndex'); - - /** * @summary * A helper class used to generate manifests. This is done through a series diff --git a/test/test/util/manifest_parser_util.js b/test/test/util/manifest_parser_util.js index d8f9da6870..a743ae75b5 100644 --- a/test/test/util/manifest_parser_util.js +++ b/test/test/util/manifest_parser_util.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.ManifestParser'); - -goog.require('shaka.media.InitSegmentReference'); -goog.require('shaka.media.SegmentReference'); - - shaka.test.ManifestParser = class { /** * Verifies the segment references of a stream. diff --git a/test/test/util/offline_utils.js b/test/test/util/offline_utils.js index 26fe5ecfdf..7ca655e848 100644 --- a/test/test/util/offline_utils.js +++ b/test/test/util/offline_utils.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.OfflineUtils'); - -goog.require('shaka.util.BufferUtils'); - - shaka.test.OfflineUtils = class { /** * @param {string} originalUri diff --git a/test/test/util/simple_fakes.js b/test/test/util/simple_fakes.js index d29abd1c57..93ac04b33b 100644 --- a/test/test/util/simple_fakes.js +++ b/test/test/util/simple_fakes.js @@ -4,28 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.FakeAbrManager'); -goog.provide('shaka.test.FakeClosedCaptionParser'); -goog.provide('shaka.test.FakeManifestParser'); -goog.provide('shaka.test.FakePlayhead'); -goog.provide('shaka.test.FakePlayheadObserver'); -goog.provide('shaka.test.FakePresentationTimeline'); -goog.provide('shaka.test.FakeSegmentIndex'); -goog.provide('shaka.test.FakeStreamingEngine'); -goog.provide('shaka.test.FakeTextTrack'); -goog.provide('shaka.test.FakeTransmuxer'); -goog.provide('shaka.test.FakeVideo'); - -goog.require('shaka.test.Util'); -goog.require('shaka.abr.SimpleAbrManager'); -goog.require('shaka.media.IClosedCaptionParser'); -goog.require('shaka.media.Playhead'); -goog.require('shaka.media.PresentationTimeline'); -goog.require('shaka.media.SegmentIndex'); -goog.require('shaka.media.StreamingEngine'); -goog.require('shaka.media.Transmuxer'); - - /** * @fileoverview Defines simple mocks for library types. * @suppress {checkTypes} Suppress errors about missmatches between the diff --git a/test/test/util/stream_generator.js b/test/test/util/stream_generator.js index f651164d38..471a57d99f 100644 --- a/test/test/util/stream_generator.js +++ b/test/test/util/stream_generator.js @@ -4,20 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.IStreamGenerator'); -goog.provide('shaka.test.Mp4LiveStreamGenerator'); -goog.provide('shaka.test.Mp4VodStreamGenerator'); -goog.provide('shaka.test.StreamGenerator'); -goog.provide('shaka.test.TSVodStreamGenerator'); - -goog.require('goog.asserts'); -goog.require('shaka.log'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.DataViewReader'); -goog.require('shaka.util.Uint8ArrayUtils'); - - /** * @summary * Defines an interface to generate streams. diff --git a/test/test/util/streaming_engine_util.js b/test/test/util/streaming_engine_util.js index 119743bf7a..10315696b9 100644 --- a/test/test/util/streaming_engine_util.js +++ b/test/test/util/streaming_engine_util.js @@ -4,21 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.StreamingEngineUtil'); - -goog.require('goog.asserts'); -goog.require('shaka.media.InitSegmentReference'); -goog.require('shaka.media.SegmentReference'); -goog.require('shaka.test.FakeNetworkingEngine'); -goog.require('shaka.test.FakePresentationTimeline'); -goog.require('shaka.test.FakeSegmentIndex'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.ManifestParserUtils'); -goog.requireType('shaka.media.PresentationTimeline'); - - shaka.test.StreamingEngineUtil = class { /** * Creates a FakeNetworkingEngine. diff --git a/test/test/util/test_scheme.js b/test/test/util/test_scheme.js index 6b228f5d81..4907b7defb 100644 --- a/test/test/util/test_scheme.js +++ b/test/test/util/test_scheme.js @@ -4,24 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.TestScheme'); - -goog.require('goog.asserts'); -goog.require('goog.Uri'); -goog.require('shaka.Player'); -goog.require('shaka.media.ManifestParser'); -goog.require('shaka.net.NetworkingEngine'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.Mp4VodStreamGenerator'); -goog.require('shaka.test.TSVodStreamGenerator'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.ManifestParserUtils'); -goog.requireType('shaka.net.NetworkingEngine.RequestType'); -goog.requireType('shaka.test.IStreamGenerator'); - - /** * @typedef {{ * initSegmentUri: string, diff --git a/test/test/util/ttml_utils.js b/test/test/util/ttml_utils.js index 4489e0d5db..bb7ed09482 100644 --- a/test/test/util/ttml_utils.js +++ b/test/test/util/ttml_utils.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.TtmlUtils'); - shaka.test.TtmlUtils = class { /** * @param {!Array} expectedCues diff --git a/test/test/util/ui_utils.js b/test/test/util/ui_utils.js index fdfd592c85..b9019ee580 100644 --- a/test/test/util/ui_utils.js +++ b/test/test/util/ui_utils.js @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - -goog.provide('shaka.test.UiUtils'); - -goog.require('shaka.Player'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.ui.Overlay'); -goog.require('shaka.util.EventManager'); - - shaka.test.UiUtils = class { /** * @param {!HTMLElement} videoContainer diff --git a/test/test/util/util.js b/test/test/util/util.js index 620b4c0350..80ed4327cc 100644 --- a/test/test/util/util.js +++ b/test/test/util/util.js @@ -4,17 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.StatusPromise'); -goog.provide('shaka.test.Util'); - -goog.require('goog.asserts'); -goog.require('shaka.media.InitSegmentReference'); -goog.require('shaka.media.SegmentReference'); -goog.require('shaka.util.StringUtils'); -goog.require('shaka.util.XmlUtils'); -goog.requireType('shaka.util.Error'); - - /** * @extends {Promise} */ diff --git a/test/test/util/waiter.js b/test/test/util/waiter.js index c80cf1e57a..b823de7ce7 100644 --- a/test/test/util/waiter.js +++ b/test/test/util/waiter.js @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.provide('shaka.test.Waiter'); - -goog.require('shaka.log'); -goog.require('shaka.media.TimeRangesUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.EventManager'); - - shaka.test.Waiter = class { /** @param {!shaka.util.EventManager} eventManager */ constructor(eventManager) { diff --git a/test/text/cue_integration.js b/test/text/cue_integration.js index 89b850b3ba..ce48e97a2c 100644 --- a/test/text/cue_integration.js +++ b/test/text/cue_integration.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.text.VttTextParser'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.StringUtils'); - describe('Cue', () => { // This integration test checks platform support for various cue scenarios // that have caused platform-specific issues. The unit tests for each parser diff --git a/test/text/lrc_text_parser_unit.js b/test/text/lrc_text_parser_unit.js index 8896a71937..3eacf22a43 100644 --- a/test/text/lrc_text_parser_unit.js +++ b/test/text/lrc_text_parser_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.text.LrcTextParser'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.StringUtils'); - describe('LrcTextParser', () => { it('supports no cues', () => { verifyHelper([], diff --git a/test/text/mp4_ttml_parser_unit.js b/test/text/mp4_ttml_parser_unit.js index 565ae179e7..3db52df745 100644 --- a/test/text/mp4_ttml_parser_unit.js +++ b/test/text/mp4_ttml_parser_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.TtmlUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.text.Mp4TtmlParser'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.Error'); - describe('Mp4TtmlParser', () => { const ttmlInitSegmentUri = '/base/test/test/assets/ttml-init.mp4'; const ttmlSegmentUri = '/base/test/test/assets/ttml-segment.mp4'; diff --git a/test/text/mp4_vtt_parser_unit.js b/test/text/mp4_vtt_parser_unit.js index 5b527b83e6..a6e945646e 100644 --- a/test/text/mp4_vtt_parser_unit.js +++ b/test/text/mp4_vtt_parser_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.text.Cue'); -goog.require('shaka.text.Mp4VttParser'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.Error'); - describe('Mp4VttParser', () => { const vttInitSegmentUri = '/base/test/test/assets/vtt-init.mp4'; const vttSegmentUri = '/base/test/test/assets/vtt-segment.mp4'; diff --git a/test/text/sbv_text_parser_unit.js b/test/text/sbv_text_parser_unit.js index 31896f5bb5..bc89ee0000 100644 --- a/test/text/sbv_text_parser_unit.js +++ b/test/text/sbv_text_parser_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.text.SbvTextParser'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.StringUtils'); - describe('SbvTextParser', () => { it('supports no cues', () => { verifyHelper([], diff --git a/test/text/simple_text_displayer_unit.js b/test/text/simple_text_displayer_unit.js index f966f29208..88c4dc86b2 100644 --- a/test/text/simple_text_displayer_unit.js +++ b/test/text/simple_text_displayer_unit.js @@ -4,13 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - -goog.require('shaka.test.FakeVideo'); -goog.require('shaka.text.Cue'); -goog.require('shaka.text.SimpleTextDisplayer'); -goog.require('shaka.util.Functional'); -goog.requireType('shaka.test.FakeTextTrack'); - describe('SimpleTextDisplayer', () => { const originalVTTCue = window.VTTCue; const Cue = shaka.text.Cue; diff --git a/test/text/srt_text_parser_unit.js b/test/text/srt_text_parser_unit.js index 39223cf211..fba00e8b5f 100644 --- a/test/text/srt_text_parser_unit.js +++ b/test/text/srt_text_parser_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.text.SrtTextParser'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.StringUtils'); - describe('SrtTextParser', () => { it('supports no cues', () => { verifyHelper([], diff --git a/test/text/ssa_text_parser_unit.js b/test/text/ssa_text_parser_unit.js index 2711014339..9073bfe2af 100644 --- a/test/text/ssa_text_parser_unit.js +++ b/test/text/ssa_text_parser_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.text.Cue'); -goog.require('shaka.text.SsaTextParser'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.StringUtils'); - describe('SsaTextParser', () => { const Cue = shaka.text.Cue; diff --git a/test/text/text_engine_unit.js b/test/text/text_engine_unit.js index 87059c5b8c..c057e6f565 100644 --- a/test/text/text_engine_unit.js +++ b/test/text/text_engine_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.FakeTextDisplayer'); -goog.require('shaka.text.Cue'); -goog.require('shaka.text.TextEngine'); -goog.require('shaka.util.MimeUtils'); - describe('TextEngine', () => { const TextEngine = shaka.text.TextEngine; diff --git a/test/text/text_track_integration.js b/test/text/text_track_integration.js index 4e173c3766..8d37eea8c8 100644 --- a/test/text/text_track_integration.js +++ b/test/text/text_track_integration.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.UiUtils'); - // This tests three assumptions we make about text tracks in Shaka Player: // 1. If a non-null value for cues is stored, it will always be the // non-null value for cues when cues returns a non-null value. diff --git a/test/text/ttml_text_parser_unit.js b/test/text/ttml_text_parser_unit.js index d1fda62b2b..32f4e3353a 100644 --- a/test/text/ttml_text_parser_unit.js +++ b/test/text/ttml_text_parser_unit.js @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.TtmlUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.text.Cue'); -goog.require('shaka.text.CueRegion'); -goog.require('shaka.text.TtmlTextParser'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.StringUtils'); - describe('TtmlTextParser', () => { const Cue = shaka.text.Cue; const CueRegion = shaka.text.CueRegion; diff --git a/test/text/ui_text_displayer_unit.js b/test/text/ui_text_displayer_unit.js index 4cdd020f4a..8d6e49131f 100644 --- a/test/text/ui_text_displayer_unit.js +++ b/test/text/ui_text_displayer_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.text.Cue'); -goog.require('shaka.text.UITextDisplayer'); - describe('UITextDisplayer', () => { /** @type {!HTMLElement} */ let videoContainer; diff --git a/test/text/vtt_text_parser_unit.js b/test/text/vtt_text_parser_unit.js index 3aac2854a0..1218a5c30f 100644 --- a/test/text/vtt_text_parser_unit.js +++ b/test/text/vtt_text_parser_unit.js @@ -4,15 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.log'); -goog.require('shaka.test.Util'); -goog.require('shaka.text.Cue'); -goog.require('shaka.text.CueRegion'); -goog.require('shaka.text.VttTextParser'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.StringUtils'); - describe('VttTextParser', () => { const Cue = shaka.text.Cue; const CueRegion = shaka.text.CueRegion; diff --git a/test/text/web_vtt_generator_unit.js b/test/text/web_vtt_generator_unit.js index 1e2a7f7f29..25b9d06c41 100644 --- a/test/text/web_vtt_generator_unit.js +++ b/test/text/web_vtt_generator_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.text.Cue'); -goog.require('shaka.text.WebVttGenerator'); - describe('WebVttGenerator', () => { it('supports no cues', () => { verifyHelper([], [], 'WEBVTT\n\n'); diff --git a/test/ui/ad_ui_unit.js b/test/ui/ad_ui_unit.js index ed6754c1f4..35cc66e4b4 100644 --- a/test/ui/ad_ui_unit.js +++ b/test/ui/ad_ui_unit.js @@ -4,17 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.Player'); -goog.require('shaka.ads.AdManager'); -goog.require('shaka.test.FakeAd'); -goog.require('shaka.test.FakeAdManager'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.ui.Locales'); -goog.require('shaka.util.EventManager'); -goog.requireType('shaka.ui.Localization'); - describe('Ad UI', () => { const UiUtils = shaka.test.UiUtils; /** @type {!HTMLLinkElement} */ diff --git a/test/ui/localization_unit.js b/test/ui/localization_unit.js index 02b9f19fa8..ef4755d047 100644 --- a/test/ui/localization_unit.js +++ b/test/ui/localization_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.ui.Localization'); -goog.requireType('shaka.util.FakeEvent'); - describe('Localization', () => { const Localization = shaka.ui.Localization; diff --git a/test/ui/text_displayer_layout_unit.js b/test/ui/text_displayer_layout_unit.js index 6277a65002..61f2f63586 100644 --- a/test/ui/text_displayer_layout_unit.js +++ b/test/ui/text_displayer_layout_unit.js @@ -4,17 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.Player'); -goog.require('shaka.test.FakeVideo'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.text.Cue'); -goog.require('shaka.text.SimpleTextDisplayer'); -goog.require('shaka.text.UITextDisplayer'); -goog.require('shaka.ui.Overlay'); -goog.require('shaka.util.EventManager'); - // TODO: Move this suite to the text/ folder where it belongs const supportsScreenshots = () => shaka.test.Util.supportsScreenshots(); filterDescribe('TextDisplayer layout', supportsScreenshots, () => { diff --git a/test/ui/ui_customization_unit.js b/test/ui/ui_customization_unit.js index eede27273d..e4cf525ae9 100644 --- a/test/ui/ui_customization_unit.js +++ b/test/ui/ui_customization_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.util.EventManager'); -goog.requireType('shaka.ui.Overlay'); - describe('UI Customization', () => { const UiUtils = shaka.test.UiUtils; /** @type {!HTMLLinkElement} */ diff --git a/test/ui/ui_integration.js b/test/ui/ui_integration.js index 5db6ade412..dfe9fe2095 100644 --- a/test/ui/ui_integration.js +++ b/test/ui/ui_integration.js @@ -4,22 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('mozilla.LanguageMapping'); -goog.require('shaka.test.Loader'); -goog.require('shaka.test.TestScheme'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.test.Waiter'); -goog.require('shaka.ui.Element'); -goog.require('shaka.util.Dom'); -goog.require('shaka.util.EventManager'); -goog.require('shaka.util.Iterables'); -goog.requireType('shaka.Player'); -goog.requireType('shaka.ui.Controls'); -goog.requireType('shaka.ui.Overlay'); - - describe('UI', () => { const Util = shaka.test.Util; const UiUtils = shaka.test.UiUtils; diff --git a/test/ui/ui_unit.js b/test/ui/ui_unit.js index 1bf150f06e..3417056ec0 100644 --- a/test/ui/ui_unit.js +++ b/test/ui/ui_unit.js @@ -4,20 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.media.ManifestParser'); -goog.require('shaka.test.FakeManifestParser'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.UiUtils'); -goog.require('shaka.test.Util'); -goog.require('shaka.ui.OverflowMenu'); -goog.require('shaka.ui.ResolutionSelection'); -goog.require('shaka.util.Platform'); -goog.require('shaka.util.Platform'); -goog.requireType('shaka.Player'); -goog.requireType('shaka.ui.Controls'); -goog.requireType('shaka.ui.Overlay'); - describe('UI', () => { const UiUtils = shaka.test.UiUtils; const Util = shaka.test.Util; diff --git a/test/util/abortable_operation_unit.js b/test/util/abortable_operation_unit.js index 3977685af1..d94887219c 100644 --- a/test/util/abortable_operation_unit.js +++ b/test/util/abortable_operation_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.util.AbortableOperation'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.PublicPromise'); - describe('AbortableOperation', () => { const Util = shaka.test.Util; diff --git a/test/util/array_utils_unit.js b/test/util/array_utils_unit.js index 415330b81a..6ded6d042a 100644 --- a/test/util/array_utils_unit.js +++ b/test/util/array_utils_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.util.ArrayUtils'); - describe('ArrayUtils', () => { const ArrayUtils = shaka.util.ArrayUtils; diff --git a/test/util/buffer_utils_unit.js b/test/util/buffer_utils_unit.js index 9f2b9dd498..a43f60d4b2 100644 --- a/test/util/buffer_utils_unit.js +++ b/test/util/buffer_utils_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.util.BufferUtils'); - describe('BufferUtils', () => { const BufferUtils = shaka.util.BufferUtils; diff --git a/test/util/cmcd_manager_unit.js b/test/util/cmcd_manager_unit.js index b193fad640..a338f7d877 100644 --- a/test/util/cmcd_manager_unit.js +++ b/test/util/cmcd_manager_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.util.CmcdManager'); -goog.require('shaka.util.ObjectUtils'); - describe('CmcdManager', () => { const CmcdManager = shaka.util.CmcdManager; const uuidRegex = diff --git a/test/util/data_view_reader_unit.js b/test/util/data_view_reader_unit.js index 9f5c0ce802..6bc7322a80 100644 --- a/test/util/data_view_reader_unit.js +++ b/test/util/data_view_reader_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.util.DataViewReader'); -goog.require('shaka.util.Error'); - describe('DataViewReader', () => { const Util = shaka.test.Util; diff --git a/test/util/ebml_parser_unit.js b/test/util/ebml_parser_unit.js index 7a436805d7..b4ae1d477c 100644 --- a/test/util/ebml_parser_unit.js +++ b/test/util/ebml_parser_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.util.EbmlParser'); -goog.require('shaka.util.Error'); - describe('EbmlParser', /** @suppress {accessControls} */ () => { const Util = shaka.test.Util; diff --git a/test/util/event_manager_unit.js b/test/util/event_manager_unit.js index e95ca38270..286c6e1af9 100644 --- a/test/util/event_manager_unit.js +++ b/test/util/event_manager_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.util.EventManager'); - describe('EventManager', () => { const Util = shaka.test.Util; diff --git a/test/util/fake_event_target_unit.js b/test/util/fake_event_target_unit.js index 037a32cee1..a8bb1b4752 100644 --- a/test/util/fake_event_target_unit.js +++ b/test/util/fake_event_target_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.log'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.FakeEvent'); -goog.require('shaka.util.FakeEventTarget'); - describe('FakeEventTarget', () => { const Util = shaka.test.Util; const originalLogError = shaka.log.error; diff --git a/test/util/iterables_unit.js b/test/util/iterables_unit.js index 5907f5a747..7a70eee21f 100644 --- a/test/util/iterables_unit.js +++ b/test/util/iterables_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.util.Iterables'); - describe('Iterables', () => { const Iterables = shaka.util.Iterables; diff --git a/test/util/language_utils_unit.js b/test/util/language_utils_unit.js index a78c8fd863..711caf5c63 100644 --- a/test/util/language_utils_unit.js +++ b/test/util/language_utils_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.util.LanguageUtils'); -goog.require('shaka.util.ManifestParserUtils'); - describe('LanguageUtils', () => { const LanguageUtils = shaka.util.LanguageUtils; diff --git a/test/util/manifest_parser_utils_unit.js b/test/util/manifest_parser_utils_unit.js index 7957cb7c6f..e12220bee7 100644 --- a/test/util/manifest_parser_utils_unit.js +++ b/test/util/manifest_parser_utils_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.util.ManifestParserUtils'); - describe('ManifestParserUtils', () => { const ManifestParserUtils = shaka.util.ManifestParserUtils; diff --git a/test/util/mp4_box_parsers_unit.js b/test/util/mp4_box_parsers_unit.js index 45da1b1e6d..71af16e503 100644 --- a/test/util/mp4_box_parsers_unit.js +++ b/test/util/mp4_box_parsers_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.Mp4BoxParsers'); -goog.require('shaka.util.Mp4Parser'); - describe('Mp4BoxParsers', () => { const videoInitSegmentUri = '/base/test/test/assets/sintel-video-init.mp4'; const videoSegmentUri = '/base/test/test/assets/sintel-video-segment.mp4'; diff --git a/test/util/mp4_parser_unit.js b/test/util/mp4_parser_unit.js index f6f448cc41..17a5300c02 100644 --- a/test/util/mp4_parser_unit.js +++ b/test/util/mp4_parser_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.Mp4Parser'); - describe('Mp4Parser', () => { const Util = shaka.test.Util; diff --git a/test/util/multi_map_unit.js b/test/util/multi_map_unit.js index 86657d3112..52b5cd21b6 100644 --- a/test/util/multi_map_unit.js +++ b/test/util/multi_map_unit.js @@ -4,9 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.util.MultiMap'); - describe('MultiMap', () => { /** @type {shaka.util.MultiMap} */ let map; diff --git a/test/util/object_utils_unit.js b/test/util/object_utils_unit.js index fc64ce333c..496ae34abd 100644 --- a/test/util/object_utils_unit.js +++ b/test/util/object_utils_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.util.ObjectUtils'); - describe('ObjectUtils', () => { const ObjectUtils = shaka.util.ObjectUtils; diff --git a/test/util/periods_unit.js b/test/util/periods_unit.js index 6240c6581a..87115a70e4 100644 --- a/test/util/periods_unit.js +++ b/test/util/periods_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.PeriodCombiner'); - describe('PeriodCombiner', () => { // These test cases don't really read well as "it" statements. Phrasing them // that way would make the names very long, so here we break with that diff --git a/test/util/pssh_unit.js b/test/util/pssh_unit.js index f87a98b841..730900574e 100644 --- a/test/util/pssh_unit.js +++ b/test/util/pssh_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.Pssh'); -goog.require('shaka.util.Uint8ArrayUtils'); - describe('Pssh', () => { const Uint8ArrayUtils = shaka.util.Uint8ArrayUtils; diff --git a/test/util/state_history_unit.js b/test/util/state_history_unit.js index 6c17e51ca7..317e1ac69f 100644 --- a/test/util/state_history_unit.js +++ b/test/util/state_history_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.util.StateHistory'); - describe('StateHistory', () => { const oldDateNow = Date.now; diff --git a/test/util/stream_utils_unit.js b/test/util/stream_utils_unit.js index 201260d03b..fb7189442c 100644 --- a/test/util/stream_utils_unit.js +++ b/test/util/stream_utils_unit.js @@ -4,11 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.FakeDrmEngine'); -goog.require('shaka.test.ManifestGenerator'); -goog.require('shaka.test.Util'); -goog.require('shaka.util.StreamUtils'); - describe('StreamUtils', () => { const StreamUtils = shaka.util.StreamUtils; diff --git a/test/util/string_utils_unit.js b/test/util/string_utils_unit.js index a5f57f850b..4a798fad17 100644 --- a/test/util/string_utils_unit.js +++ b/test/util/string_utils_unit.js @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.test.Util'); -goog.require('shaka.util.BufferUtils'); -goog.require('shaka.util.Error'); -goog.require('shaka.util.ManifestParserUtils'); -goog.require('shaka.util.StringUtils'); - describe('StringUtils', () => { const StringUtils = shaka.util.StringUtils; diff --git a/test/util/text_parser_unit.js b/test/util/text_parser_unit.js index 260d1e801f..5bd8775770 100644 --- a/test/util/text_parser_unit.js +++ b/test/util/text_parser_unit.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('shaka.util.TextParser'); - describe('TextParser', () => { const TextParser = shaka.util.TextParser; diff --git a/test/util/xml_utils_unit.js b/test/util/xml_utils_unit.js index a7e9c1a576..2cb75318cf 100644 --- a/test/util/xml_utils_unit.js +++ b/test/util/xml_utils_unit.js @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.require('goog.asserts'); -goog.require('shaka.util.XmlUtils'); - - describe('XmlUtils', () => { // A number that cannot be represented as a Javascript number. const HUGE_NUMBER_STRING = new Array(500).join('7');