Skip to content

Commit

Permalink
fix(test): fix tests on extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Jul 25, 2024
1 parent ebe750a commit dabc987
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ final class AVPlayerExtensions: XCTestCase {
_ = observer.readyExpectation

let avPlayer = AVPlayer(playerItem: nil)
avPlayer.addObserver(observer, forKeyPath: "status", options: .new, context: nil)
avPlayer.replaceCurrentItem(withHls: VideoOptions(videoId: VideoId.validVideoId, videoType: .vod))
avPlayer.currentItem?.addObserver(observer, forKeyPath: "status", options: .new, context: nil)

avPlayer.play()

waitForExpectations(timeout: 10, handler: nil)
avPlayer.currentItem?.removeObserver(observer, forKeyPath: "status")
avPlayer.removeObserver(observer, forKeyPath: "status")
}

func testValidMP4VideoIdPlay() throws {
let observer = AVPlayerReadyObserverImpl(testCase: self)
_ = observer.readyExpectation

let avPlayer = AVPlayer(playerItem: nil)
avPlayer.addObserver(observer, forKeyPath: "status", options: .new, context: nil)
avPlayer.replaceCurrentItem(withMp4: VideoOptions(videoId: VideoId.validVideoId, videoType: .vod))
avPlayer.currentItem?.addObserver(observer, forKeyPath: "status", options: .new, context: nil)

avPlayer.play()

waitForExpectations(timeout: 10, handler: nil)
avPlayer.currentItem?.removeObserver(observer, forKeyPath: "status")
avPlayer.removeObserver(observer, forKeyPath: "status")
}
}

Expand Down

0 comments on commit dabc987

Please sign in to comment.