Add tests for the network blocked status change
onBlockedStatusChanged is intruduced for network blocked status.
The changes in this patch are:
- Test onBlockedStatusChanged which tells apps whether the
network is blocked.
- Fixed the tests which is affected by the order changed in
onAvailable.
Test: as follows
- runtest frameworks-net
- runtest -x NetworkPolicyManagerServiceTest.java
Bug: 74575553
Change-Id: I383c037ed895ef69c478dc3cff69fb1e27c42845
This commit is contained in:
@@ -219,7 +219,7 @@ public class ConnectivityManagerTest {
|
||||
// callback triggers
|
||||
captor.getValue().send(makeMessage(request, ConnectivityManager.CALLBACK_AVAILABLE));
|
||||
verify(callback, timeout(500).times(1)).onAvailable(any(Network.class),
|
||||
any(NetworkCapabilities.class), any(LinkProperties.class));
|
||||
any(NetworkCapabilities.class), any(LinkProperties.class), anyBoolean());
|
||||
|
||||
// unregister callback
|
||||
manager.unregisterNetworkCallback(callback);
|
||||
@@ -247,7 +247,7 @@ public class ConnectivityManagerTest {
|
||||
// callback triggers
|
||||
captor.getValue().send(makeMessage(req1, ConnectivityManager.CALLBACK_AVAILABLE));
|
||||
verify(callback, timeout(100).times(1)).onAvailable(any(Network.class),
|
||||
any(NetworkCapabilities.class), any(LinkProperties.class));
|
||||
any(NetworkCapabilities.class), any(LinkProperties.class), anyBoolean());
|
||||
|
||||
// unregister callback
|
||||
manager.unregisterNetworkCallback(callback);
|
||||
|
||||
Reference in New Issue
Block a user