Stabilizza diretta iOS e aggiunge test simulatore pre-release.
Corregge lifecycle RTMP/preview tra partite, reset tabellone, orientamento con debounce, condivisione su iPad e script test_ios_simulator per CI locale. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import AVFoundation
|
||||
import XCTest
|
||||
@testable import MatchLiveTv
|
||||
|
||||
final class BroadcastOrientationPolicyTests: XCTestCase {
|
||||
func testAppliesFirstLandscapeOrientation() {
|
||||
XCTAssertTrue(
|
||||
BroadcastOrientationPolicy.shouldApplyMixerOrientation(
|
||||
new: .landscapeRight,
|
||||
previous: nil,
|
||||
landscapeLocked: true
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
func testSkipsDuplicateLandscapeOrientation() {
|
||||
XCTAssertFalse(
|
||||
BroadcastOrientationPolicy.shouldApplyMixerOrientation(
|
||||
new: .landscapeRight,
|
||||
previous: .landscapeRight,
|
||||
landscapeLocked: true
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
func testAppliesLandscapeFlip() {
|
||||
XCTAssertTrue(
|
||||
BroadcastOrientationPolicy.shouldApplyMixerOrientation(
|
||||
new: .landscapeLeft,
|
||||
previous: .landscapeRight,
|
||||
landscapeLocked: true
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
func testIgnoresPortraitWhenLandscapeLocked() {
|
||||
XCTAssertFalse(
|
||||
BroadcastOrientationPolicy.isApplicableForBroadcast(.portrait, landscapeLocked: true)
|
||||
)
|
||||
XCTAssertFalse(
|
||||
BroadcastOrientationPolicy.shouldApplyMixerOrientation(
|
||||
new: .portrait,
|
||||
previous: .landscapeRight,
|
||||
landscapeLocked: true
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
func testAllowsPortraitWhenNotLandscapeLocked() {
|
||||
XCTAssertTrue(
|
||||
BroadcastOrientationPolicy.isApplicableForBroadcast(.portrait, landscapeLocked: false)
|
||||
)
|
||||
}
|
||||
|
||||
func testDebounceAndSuppressWindowsArePositive() {
|
||||
XCTAssertGreaterThan(BroadcastOrientationPolicy.debounceNanoseconds, 0)
|
||||
XCTAssertGreaterThan(BroadcastOrientationPolicy.suppressDisconnectSeconds, 0)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user