dropped-frame tracke

This commit is contained in:
Dmitry Sergeev
2026-09-01 23:45:10 +03:00
parent 179768ca4a
commit a473c84b0e
11 changed files with 204 additions and 16 deletions
+9 -1
View File
@@ -21,8 +21,10 @@ func TestVideoBridgeDeliversFrameAndCompletionResult(t *testing.T) {
}
consumeResult := make(chan error, 1)
wantSource := FeedConfig{Domain: "/video", UUID: "video", Active: true}
go func() {
consumeResult <- bridge.ConsumeVideo(context.Background(), wantFrame)
ctx := withGeneration(context.Background(), 17)
consumeResult <- bridge.ConsumeVideo(withVideoSource(ctx, wantSource), wantFrame)
}()
ctx, cancel := context.WithTimeout(context.Background(), videoBridgeTestTimeout)
@@ -34,6 +36,12 @@ func TestVideoBridgeDeliversFrameAndCompletionResult(t *testing.T) {
if pending.Frame.Index != wantFrame.Index {
t.Fatalf("Next() frame index = %d, want %d", pending.Frame.Index, wantFrame.Index)
}
if pending.Generation != 17 {
t.Fatalf("Next() generation = %d, want 17", pending.Generation)
}
if pending.Source != wantSource {
t.Fatalf("Next() source = %#v, want %#v", pending.Source, wantSource)
}
if &pending.Frame.Payload[0] != &wantFrame.Payload[0] {
t.Fatal("Next() copied the borrowed payload")
}