Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/unit/mocks/MediaPlayerModelMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ class MediaPlayerModelMock {
return { min: -0.5, max: 0.5 };
}

getCatchupModeEnabled() {
return false;
}

getCatchupMaxDrift() {
return 10;
}

getBufferTimeDefault() {
return this.bufferTimeDefault > -1 ? this.bufferTimeDefault : this.fastSwitchEnabled ? DEFAULT_MIN_BUFFER_TIME_FAST_SWITCH : DEFAULT_MIN_BUFFER_TIME;
}
Expand Down
16 changes: 16 additions & 0 deletions test/unit/mocks/PlaybackControllerMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ class PlaybackControllerMock {
return 15;
}

seekToCurrentLive() {
// Mock implementation
}

getBufferLevel() {
return 5;
}

getPlaybackStalled() {
return false;
}

getStreamEndTime() {
return 100;
}

}


Expand Down
12 changes: 12 additions & 0 deletions test/unit/mocks/StreamControllerMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ class StreamControllerMock {
return true;
}

getIsStreamSwitchInProgress() {
return false;
}

getHasMediaOrInitialisationError() {
return false;
}

getStreamForTime() {
return null;
}

}

export default StreamControllerMock;
19 changes: 19 additions & 0 deletions test/unit/mocks/ThroughputControllerMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ class ThroughputControllerMock {
return this.averageThroughput;
}

getArithmeticMean(values) {
if (!values || values.length === 0) {
return 0;
}

let sum = 0;
values.forEach((entry) => {
if (entry && typeof entry.value === 'number') {
sum += entry.value;
}
});

if (sum === 0) {
return 0;
}

return sum / values.length;
}

setConfig() {

}
Expand Down
Loading