Skip to content
Snippets Groups Projects
Commit 4dec273a authored by Jean Chalard's avatar Jean Chalard Committed by Gerrit Code Review
Browse files

Merge "Expose the netd mock in CSTest to allow verifying calls on it" into main

parents e339c6b7 ff7edd36
No related branches found
No related tags found
No related merge requests found
......@@ -127,6 +127,7 @@ open class CSTest {
val packageManager = makeMockPackageManager()
val connResources = makeMockConnResources(sysResources, packageManager)
val netd = mock<INetd>()
val bpfNetMaps = mock<BpfNetMaps>()
val clatCoordinator = mock<ClatCoordinator>()
val proxyTracker = ProxyTracker(context, mock<Handler>(), 16 /* EVENT_PROXY_HAS_CHANGED */)
......@@ -138,7 +139,7 @@ open class CSTest {
}
val deps = CSDeps()
val service = makeConnectivityService(context, deps).also { it.systemReadyInternal() }
val service = makeConnectivityService(context, netd, deps).also { it.systemReadyInternal() }
val cm = ConnectivityManager(context, service)
val csHandler = Handler(csHandlerThread.looper)
......
......@@ -145,12 +145,13 @@ internal fun initMockedResources(res: Resources) {
private val TEST_LINGER_DELAY_MS = 400
private val TEST_NASCENT_DELAY_MS = 300
internal fun makeConnectivityService(context: Context, deps: Dependencies) = ConnectivityService(
context,
mock<IDnsResolver>(),
mock<IpConnectivityLog>(),
mock<INetd>(),
deps).also {
it.mLingerDelayMs = TEST_LINGER_DELAY_MS
it.mNascentDelayMs = TEST_NASCENT_DELAY_MS
}
internal fun makeConnectivityService(context: Context, netd: INetd, deps: Dependencies) =
ConnectivityService(
context,
mock<IDnsResolver>(),
mock<IpConnectivityLog>(),
netd,
deps).also {
it.mLingerDelayMs = TEST_LINGER_DELAY_MS
it.mNascentDelayMs = TEST_NASCENT_DELAY_MS
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment