Merge "Remove expectLinkPropertiesThat"

This commit is contained in:
Jean Chalard
2023-02-11 02:09:38 +00:00
committed by Gerrit Code Review
2 changed files with 13 additions and 26 deletions

View File

@@ -414,13 +414,6 @@ open class TestableNetworkCallback private constructor(
crossinline predicate: (T) -> Boolean = { true }
) = history.poll(timeoutMs, from) { it is T && predicate(it) } as T?
inline fun expectLinkPropertiesThat(
net: Network,
tmt: Long = defaultTimeoutMs,
valid: (LinkProperties) -> Boolean
): LinkPropertiesChanged =
expect(net, tmt, "LinkProperties don't match expectations") { valid(it.lp) }
// Expects onAvailable and the callbacks that follow it. These are:
// - onSuspended, iff the network was suspended when the callbacks fire.
// - onCapabilitiesChanged.
@@ -551,13 +544,6 @@ open class TestableNetworkCallback private constructor(
expectAvailableThenValidatedCallbacks(n.network, defaultTimeoutMs)
}
@JvmOverloads
fun expectLinkPropertiesThat(
n: HasNetwork,
tmt: Long = defaultTimeoutMs,
valid: (LinkProperties) -> Boolean
) = expectLinkPropertiesThat(n.network, tmt, valid)
@JvmOverloads
fun expectCaps(
n: HasNetwork,