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 | 99 ++++++++++++++----- 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, 135 insertions(+), 1025 deletions(-) create mode 100644 test/test/namespace.js diff --git a/demo/config.js b/demo/config.js index a220857b3..ae8fc448e 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 84454b415..025542520 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 9888c2680..80982da34 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 52a4330fb..d232c0b54 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 a8425bdc0..d2c58a81a 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 cb336e5a4..4055d362b 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 d1512e2de..de94a6752 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 2199a2b32..37163cdba 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 e038e5ca1..2602fc54d 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 0688d3ef8..54c7e77c5 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 5cc0918d2..4105b0bd4 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 71b7465e2..550a08cc5 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 7082684cb..e8f6c9891 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 482dc41a0..0223c0193 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 39e61f237..2dc26f011 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 0c04ecca8..67b0ccc6a 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 aa7c8d45d..3f93c65bc 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 8e004ef26..2514c45fe 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 3b8373a84..ca1acceb8 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 21aebaded..0f20add3f 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 6f2731d88..ca054fe47 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 38f31092c..1b95d6a07 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 9e7045299..b0ff89ea1 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 fc00cf1be..0a99b28fa 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 bd1afa480..1b0828de4 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 30d09953b..1968d1d0b 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 6c95902f5..b1962ef2b 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 97e80a406..d50150d5a 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 9f1160745..46b6e3b3b 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 9196fa43d..c63739951 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 d6464608f..47e5e7a7e 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 426ec7959..ebd0be76e 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 21f7b37c7..a0ae8f6eb 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 705ab55f7..9bfd1657b 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 78a7dbb9a..920f9d5a4 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 2de91cf0e..5077388e0 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 67dd1ba28..3f9bb1c2a 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 4d0727a1b..fb4bd579d 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 eeb1ebd06..3dbe0fdb9 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 baf770ec0..c67cf465b 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 25b015a4f..b7c602856 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 549381dc4..0e9b149c4 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 ecbceaf34..03d2bf94f 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 1d8ab5a2d..3b9e0be66 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 6334dc275..6d49f38a4 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 ceb7c4e17..9ab76db49 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 b0edfd3ce..4f858fddd 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 25c456f16..13157ad63 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 a50a20003..bbe1b5573 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 df866c8fb..84768a144 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 55e7dac16..a2035438e 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 2e970f9e8..6fefc1b19 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 4c095e449..d229ec83c 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 0c1522eb4..6050f7af4 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 13c3e7eb1..06fe61fe0 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 04c264683..20fc7a503 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 d6db85a51..3fe96ad03 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 621670ce3..1cc0513f4 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 dfc1e7604..f210b9b49 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 62b3e0405..a25c58cf6 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 a8379e17e..52646de48 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 79620e90d..cc692c83f 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 ec69899a7..95c180f5e 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 ec4240150..85f348b86 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 a31c8e30d..8f97b4faf 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 76b51a853..ee5b39ecd 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 afd957324..887aaa827 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 fa9bba893..aa2910167 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 036b0eb54..987aef038 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 ad41e7ade..607779b36 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 9599d1864..4e3e8a00d 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 805b47e7f..24e394489 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 a226ac09a..cce94f0a5 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 1210848aa..999bd6f42 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 a98a11e9d..cb303cee6 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 000000000..6b5e84195 --- /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 d4e296bfe..02b2772b4 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 800f4a2ae..8da6e8a28 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 7247aea97..32f098c05 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 6f42dfa0b..3d478d58b 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 fcca89249..9564ca8eb 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 9fab0f6d3..4a55c4824 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 1720f6b6c..79140c5d4 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 9fc996639..12efe81ee 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 fc209ad4b..4a0cb293f 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 927b5aa93..784907ae9 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 b2d60c498..31ab9de95 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 9a2314ad9..2b1df0353 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 985e5b411..a023aadef 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 f505786dc..799837db6 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 d8f9da687..a743ae75b 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 26fe5ecfd..7ca655e84 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 d29abd1c5..93ac04b33 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 f651164d3..471a57d99 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 119743bf7..10315696b 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 6b228f5d8..4907b7def 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 4489e0d5d..bb7ed0948 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 fdfd592c8..b9019ee58 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 620b4c035..80ed4327c 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 c80cf1e57..b823de7ce 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 89b850b3b..ce48e97a2 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 8896a7193..3eacf22a4 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 565ae179e..3db52df74 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 5b527b83e..a6e945646 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 31896f5bb..bc89ee000 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 f966f2920..88c4dc86b 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 39223cf21..fba00e8b5 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 271101433..9073bfe2a 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 87059c5b8..c057e6f56 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 4e173c376..8d37eea8c 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 d1fda62b2..32f4e3353 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 4cdd020f4..8d6e49131 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 3aac2854a..1218a5c30 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 1e2a7f7f2..25b9d06c4 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 ed6754c1f..35cc66e4b 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 02b9f19fa..ef4755d04 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 6277a6500..61f2f6358 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 eede27273..e4cf525ae 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 5db6ade41..dfe9fe209 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 1bf150f06..3417056ec 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 3977685af..d94887219 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 415330b81..6ded6d042 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 9f2b9dd49..a43f60d4b 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 b193fad64..a338f7d87 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 9f5c0ce80..6bc7322a8 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 7a436805d..b4ae1d477 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 e95ca3827..286c6e1af 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 037a32cee..a8bb1b475 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 5907f5a74..7a70eee21 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 a78c8fd86..711caf5c6 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 7957cb7c6..e12220bee 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 45da1b1e6..71af16e50 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 f6f448cc4..17a5300c0 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 86657d311..52b5cd21b 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 fc64ce333..496ae34ab 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 6240c6581..87115a70e 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 f87a98b84..730900574 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 6c17e51ca..317e1ac69 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 201260d03..fb7189442 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 a5f57f850..4a798fad1 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 260d1e801..5bd877577 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 a7e9c1a57..2cb75318c 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');