dropped-frame tracke
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user