Skip to content

Commit

Permalink
update publish tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie committed Jun 10, 2024
1 parent 6628182 commit c3ab019
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Tests/LiveKitTests/BufferCapturerTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ class BufferCapturerTest: XCTestCase {
let room1 = rooms[0]
let room2 = rooms[1]

let targetDimensions: Dimensions = .h1080_169
let targetDimensions: Dimensions = .h720_169

let captureOptions = BufferCaptureOptions(dimensions: targetDimensions)

let publishOptions = VideoPublishOptions(
simulcast: false,
preferredCodec: .vp8,
preferredBackupCodec: .none,
degradationPreference: .maintainResolution
)

let bufferTrack = LocalVideoTrack.createBufferTrack(
options: BufferCaptureOptions(dimensions: targetDimensions)
options: captureOptions
)

let bufferCapturer = bufferTrack.capturer as! BufferCapturer
Expand All @@ -37,7 +46,7 @@ class BufferCapturerTest: XCTestCase {
bufferCapturer.capture(buffer)
}

try await room1.localParticipant.publish(videoTrack: bufferTrack)
try await room1.localParticipant.publish(videoTrack: bufferTrack, options: publishOptions)

guard let publisherIdentity = room1.localParticipant.identity else {
XCTFail("Publisher's identity is nil")
Expand Down Expand Up @@ -82,7 +91,7 @@ class BufferCapturerTest: XCTestCase {

print("Waiting for target dimensions: \(targetDimensions)")
let expectTargetDimensions = videoTrackWatcher.expect(dimensions: targetDimensions)
await self.fulfillment(of: [expectTargetDimensions], timeout: 30)
await self.fulfillment(of: [expectTargetDimensions], timeout: 60)
print("Did render target dimensions: \(targetDimensions)")

// Wait for video to complete...
Expand Down

0 comments on commit c3ab019

Please sign in to comment.