-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix]Capture quality adaptive policy criteria (#563)
- Loading branch information
1 parent
9542d49
commit 5ebe8fb
Showing
9 changed files
with
870 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// Copyright © 2024 Stream.io Inc. All rights reserved. | ||
// | ||
|
||
import Combine | ||
@testable import StreamVideo | ||
|
||
final class MockThermalStateObserver: ThermalStateObserving, Mockable { | ||
|
||
// MARK: - Mockable | ||
|
||
typealias FunctionKey = MockFunctionKey | ||
typealias FunctionInputKey = EmptyPayloadable | ||
var stubbedProperty: [String: Any] = [:] | ||
var stubbedFunction: [FunctionKey: Any] = [:] | ||
@Atomic var stubbedFunctionInput: [FunctionKey: [FunctionInputKey]] = [:] | ||
func stub<T>(for keyPath: KeyPath<MockThermalStateObserver, T>, with value: T) { | ||
stubbedProperty[propertyKey(for: keyPath)] = value | ||
} | ||
|
||
func stub<T>(for function: FunctionKey, with value: T) {} | ||
|
||
enum MockFunctionKey: Hashable, CaseIterable {} | ||
|
||
// MARK: - Properties | ||
|
||
var state: ProcessInfo.ThermalState { | ||
get { self[dynamicMember: \.state] } | ||
set { _ = newValue } | ||
} | ||
|
||
var statePublisher: AnyPublisher<ProcessInfo.ThermalState, Never> { | ||
get { self[dynamicMember: \.statePublisher] } | ||
set { _ = newValue } | ||
} | ||
|
||
var scale: CGFloat { | ||
get { self[dynamicMember: \.scale] } | ||
set { _ = newValue } | ||
} | ||
|
||
init() { | ||
InjectedValues[\.thermalStateObserver] = self | ||
stub(for: \.state, with: .nominal) | ||
stub(for: \.scale, with: 1) | ||
} | ||
} |
Oops, something went wrong.