1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-13 01:30:17 +02:00

refactor: remove internal Map, Set, and WeakMap shams, assume window.performance and requestAnimationFrame support (#7775)

This commit is contained in:
Pat O'Neill
2022-06-02 12:05:57 -04:00
parent 28029d93f4
commit cc84ff4f80
11 changed files with 55 additions and 342 deletions

View File

@ -943,7 +943,6 @@ QUnit.test('When Android Chrome reports Infinity duration with currentTime 0, re
QUnit.test('supports getting available media playback quality metrics', function(assert) {
const origPerformance = window.performance;
const origDate = window.Date;
const oldEl = tech.el_;
const videoPlaybackQuality = {
creationTime: 1,
@ -960,7 +959,6 @@ QUnit.test('supports getting available media playback quality metrics', function
videoPlaybackQuality,
'uses native implementation when supported'
);
tech.el_ = {
webkitDroppedFrameCount: 1,
webkitDecodedFrameCount: 2
@ -974,42 +972,12 @@ QUnit.test('supports getting available media playback quality metrics', function
'uses webkit prefixed metrics and performance.now when supported'
);
tech.el_ = {
webkitDroppedFrameCount: 1,
webkitDecodedFrameCount: 2
};
window.Date = {
now: () => 10
};
window.performance = {
timing: {
navigationStart: 3
}
};
assert.deepEqual(
tech.getVideoPlaybackQuality(),
{ droppedVideoFrames: 1, totalVideoFrames: 2, creationTime: 7 },
'uses webkit prefixed metrics and Date.now() - navigationStart when ' +
'supported'
);
tech.el_ = {};
window.performance = void 0;
assert.deepEqual(tech.getVideoPlaybackQuality(), {}, 'empty object when not supported');
window.performance = {
now: () => 5
};
assert.deepEqual(
tech.getVideoPlaybackQuality(),
{ creationTime: 5 },
'only creation time when it\'s the only piece available'
);
window.performance = {
timing: {
navigationStart: 3
}
now: () => 7
};
assert.deepEqual(
tech.getVideoPlaybackQuality(),
@ -1030,7 +998,6 @@ QUnit.test('supports getting available media playback quality metrics', function
tech.el_ = oldEl;
window.performance = origPerformance;
window.Date = origDate;
});
QUnit.test('featuresVideoFrameCallback is false for audio elements', function(assert) {