ethernet: test adding listener after removing server mode iface
Tests that registering a EthernetStateListener functions as expected after requesting a tethering interface and subsequently removing that interface. Test: atest testCallbacks_afterRemovingServerModeInterface Bug: 290971780 Change-Id: I7b6e1a3b3ac23f4fbdd2d20f63f83d59c4d4999d
This commit is contained in:
parent
88a88f1304
commit
f848c6c689
1 changed files with 14 additions and 0 deletions
|
|
@ -667,6 +667,20 @@ class EthernetManagerTest {
|
|||
listener.expectCallback(iface, STATE_LINK_UP, ROLE_CLIENT)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testCallbacks_afterRemovingServerModeInterface() {
|
||||
// do not run this test if an interface that can be used for tethering already exists.
|
||||
assumeNoInterfaceForTetheringAvailable()
|
||||
|
||||
val iface = createInterface()
|
||||
requestTetheredInterface().expectOnAvailable()
|
||||
removeInterface(iface)
|
||||
|
||||
val listener = EthernetStateListener()
|
||||
addInterfaceStateListener(listener)
|
||||
listener.assertNoCallback()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testGetInterfaceList() {
|
||||
// Create two test interfaces and check the return list contains the interface names.
|
||||
|
|
|
|||
Loading…
Reference in a new issue