Add unit tests covering version parsing, device identity, browser engine and version-specific behavior for the six device classes, using real user agent strings from the vendor specifications. While adding the TiVoOS test it became apparent that shaka.device.TiVoOS was only listed in build/types/devices, so the device was never required from the uncompiled entry points and therefore never registered in uncompiled/debug builds (nor available to the tests). Add the missing goog.require to shaka-player.uncompiled.js and transmuxer_worker.uncompiled.js. Co-authored-by: Claude Opus 4.8 <[email protected]>
29 lines
926 B
JavaScript
29 lines
926 B
JavaScript
/*! @license
|
|
* Shaka Player
|
|
* Copyright 2016 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
describe('Vizio', () => {
|
|
/* eslint-disable @stylistic/max-len */
|
|
// cspell:disable
|
|
const vizio = 'Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 CrKey/1.0.999999 VIZIO SmartCast(Conjure/MTKF-5.1.516.1 FW/0.6.11.1-2 Model/V50C6-J09)';
|
|
// cspell:enable
|
|
/* eslint-enable @stylistic/max-len */
|
|
|
|
const Util = shaka.test.Util;
|
|
const originalUserAgent = navigator.userAgent;
|
|
|
|
afterEach(() => {
|
|
Util.setUserAgent(originalUserAgent);
|
|
});
|
|
|
|
it('reports the right device name and type', () => {
|
|
Util.setUserAgent(vizio);
|
|
const device = new shaka.device.Vizio();
|
|
expect(device.getDeviceName()).toBe('Vizio');
|
|
expect(device.getDeviceType()).toBe(shaka.device.IDevice.DeviceType.TV);
|
|
expect(device.getVersion()).toBe(null);
|
|
});
|
|
});
|