Skip to content

Commit

Permalink
[Fix]Cron checks failing on iOS 15 (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis authored Jan 16, 2025
1 parent 6e2eab4 commit 726e9cd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
18 changes: 17 additions & 1 deletion StreamVideoTests/Mock/MockRTCRtpCodecCapability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
@testable import StreamVideo
import StreamWebRTC

final class MockRTCRtpCodecCapability: RTCRtpCodecCapabilityProtocol, Mockable {
final class MockRTCRtpCodecCapability: NSObject, RTCRtpCodecCapabilityProtocol, Mockable {
enum MockFunctionKey: Hashable, CaseIterable { case none }
enum MockPropertyKey: String, Hashable { case name, fmtp, clockRate, preferredPayloadType }
typealias FunctionKey = MockFunctionKey
typealias FunctionInputKey = EmptyPayloadable
var stubbedProperty: [String: Any] = [:]
Expand All @@ -20,6 +21,21 @@ final class MockRTCRtpCodecCapability: RTCRtpCodecCapabilityProtocol, Mockable {
stubbedFunction[function] = value
}

func propertyKey<T>(for keyPath: KeyPath<MockRTCRtpCodecCapability, T>) -> String {
switch keyPath {
case \.name:
return MockPropertyKey.name.rawValue
case \.fmtp:
return MockPropertyKey.fmtp.rawValue
case \.clockRate:
return MockPropertyKey.clockRate.rawValue
case \.preferredPayloadType:
return MockPropertyKey.preferredPayloadType.rawValue
default:
fatalError()
}
}

var name: String { self[dynamicMember: \.name] }
var fmtp: String { self[dynamicMember: \.fmtp] }
var clockRate: NSNumber? { self[dynamicMember: \.clockRate] }
Expand Down
14 changes: 14 additions & 0 deletions StreamVideoTests/Mock/MockRTCRtpEncodingParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import StreamWebRTC

final class MockRTCRtpEncodingParameters: RTCRtpEncodingParametersProtocol, Mockable {
enum MockFunctionKey: Hashable, CaseIterable { case none }
enum MockPropertyKey: String, Hashable { case rid, maxBitrateBps, maxFramerate }
typealias FunctionKey = MockFunctionKey
typealias FunctionInputKey = EmptyPayloadable
var stubbedProperty: [String: Any] = [:]
Expand All @@ -20,6 +21,19 @@ final class MockRTCRtpEncodingParameters: RTCRtpEncodingParametersProtocol, Mock
stubbedFunction[function] = value
}

func propertyKey<T>(for keyPath: KeyPath<MockRTCRtpEncodingParameters, T>) -> String {
switch keyPath {
case \.rid:
return MockPropertyKey.rid.rawValue
case \.maxBitrateBps:
return MockPropertyKey.maxBitrateBps.rawValue
case \.maxFramerate:
return MockPropertyKey.maxFramerate.rawValue
default:
fatalError()
}
}

var rid: String? { self[dynamicMember: \.rid] }
var maxBitrateBps: NSNumber? { self[dynamicMember: \.maxBitrateBps] }
var maxFramerate: NSNumber? { self[dynamicMember: \.maxFramerate] }
Expand Down

0 comments on commit 726e9cd

Please sign in to comment.