Merge "Fix NetworkStatsServiceTest after adding deleteKernelTagData" am: 3226bfb631
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1968682 Change-Id: I26bc260ae6727e4e7d1a6053851681e0cee48631
This commit is contained in:
@@ -198,7 +198,10 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
|
||||
@Mock
|
||||
private LocationPermissionChecker mLocationPermissionChecker;
|
||||
private @Mock IBpfMap<U32, U8> mUidCounterSetMap;
|
||||
private @Mock NetworkStatsService.TagStatsDeleter mTagStatsDeleter;
|
||||
private @Mock IBpfMap<CookieTagMapKey, CookieTagMapValue> mCookieTagMap;
|
||||
private @Mock IBpfMap<StatsMapKey, StatsMapValue> mStatsMapA;
|
||||
private @Mock IBpfMap<StatsMapKey, StatsMapValue> mStatsMapB;
|
||||
private @Mock IBpfMap<UidStatsMapKey, StatsMapValue> mAppUidStatsMap;
|
||||
|
||||
private NetworkStatsService mService;
|
||||
private INetworkStatsSession mSession;
|
||||
@@ -361,8 +364,23 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public NetworkStatsService.TagStatsDeleter getTagStatsDeleter() {
|
||||
return mTagStatsDeleter;
|
||||
public IBpfMap<CookieTagMapKey, CookieTagMapValue> getCookieTagMap() {
|
||||
return mCookieTagMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBpfMap<StatsMapKey, StatsMapValue> getStatsMapA() {
|
||||
return mStatsMapA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBpfMap<StatsMapKey, StatsMapValue> getStatsMapB() {
|
||||
return mStatsMapB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBpfMap<UidStatsMapKey, StatsMapValue> getAppUidStatsMap() {
|
||||
return mAppUidStatsMap;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -702,10 +720,8 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
|
||||
final Intent intent = new Intent(ACTION_UID_REMOVED);
|
||||
intent.putExtra(EXTRA_UID, UID_BLUE);
|
||||
mServiceContext.sendBroadcast(intent);
|
||||
verify(mTagStatsDeleter).deleteTagData(UID_BLUE);
|
||||
intent.putExtra(EXTRA_UID, UID_RED);
|
||||
mServiceContext.sendBroadcast(intent);
|
||||
verify(mTagStatsDeleter).deleteTagData(UID_RED);
|
||||
|
||||
// existing uid and total should remain unchanged; but removed UID
|
||||
// should be gone completely.
|
||||
|
||||
Reference in New Issue
Block a user