Add voice broadcast playback seekbar (#9529)
This commit is contained in:
parent
04bc8fb71c
commit
66d0b318bc
10 changed files with 339 additions and 70 deletions
|
@ -65,6 +65,18 @@ describe("VoiceBroadcastChunkEvents", () => {
|
|||
expect(chunkEvents.getLength()).toBe(3259);
|
||||
});
|
||||
|
||||
it("getLengthTo(first event) should return 0", () => {
|
||||
expect(chunkEvents.getLengthTo(eventSeq1Time1)).toBe(0);
|
||||
});
|
||||
|
||||
it("getLengthTo(some event) should return the time excl. that event", () => {
|
||||
expect(chunkEvents.getLengthTo(eventSeq3Time2)).toBe(7 + 3141);
|
||||
});
|
||||
|
||||
it("getLengthTo(last event) should return the time excl. that event", () => {
|
||||
expect(chunkEvents.getLengthTo(eventSeq4Time1)).toBe(7 + 3141 + 42);
|
||||
});
|
||||
|
||||
it("should return the expected next chunk", () => {
|
||||
expect(chunkEvents.getNext(eventSeq2Time4Dup)).toBe(eventSeq3Time2);
|
||||
});
|
||||
|
@ -72,6 +84,18 @@ describe("VoiceBroadcastChunkEvents", () => {
|
|||
it("should return undefined for next last chunk", () => {
|
||||
expect(chunkEvents.getNext(eventSeq4Time1)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("findByTime(0) should return the first chunk", () => {
|
||||
expect(chunkEvents.findByTime(0)).toBe(eventSeq1Time1);
|
||||
});
|
||||
|
||||
it("findByTime(some time) should return the chunk with this time", () => {
|
||||
expect(chunkEvents.findByTime(7 + 3141 + 21)).toBe(eventSeq3Time2);
|
||||
});
|
||||
|
||||
it("findByTime(entire duration) should return the last chunk", () => {
|
||||
expect(chunkEvents.findByTime(7 + 3141 + 42 + 69)).toBe(eventSeq4Time1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when adding events where at least one does not have a sequence", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue