Cleanup test method names.

Renamed some test methods to reflect the proper permission.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 1764042
Change-Id: Ia7db8826ad18c3b8f119aa063cb2c7b3793a9d17
Merged-In: I5551ddcb411432c6aeb14c03d9a284aa68f1bd1b
This commit is contained in:
Jeremy Joslin
2017-01-10 08:53:02 -08:00
parent 6a9ad14172
commit 23f1fcd5ef

View File

@@ -322,7 +322,7 @@ public class NetworkScoreServiceTest {
}
@Test
public void testClearScores_notActiveScorer_noBroadcastNetworkPermission() {
public void testClearScores_notActiveScorer_noRequestNetworkScoresPermission() {
when(mNetworkScorerAppManager.isCallerActiveScorer(anyInt())).thenReturn(false);
when(mContext.checkCallingOrSelfPermission(permission.REQUEST_NETWORK_SCORES))
.thenReturn(PackageManager.PERMISSION_DENIED);
@@ -335,7 +335,7 @@ public class NetworkScoreServiceTest {
}
@Test
public void testClearScores_activeScorer_noBroadcastNetworkPermission() {
public void testClearScores_activeScorer_noRequestNetworkScoresPermission() {
when(mNetworkScorerAppManager.isCallerActiveScorer(anyInt())).thenReturn(true);
when(mContext.checkCallingOrSelfPermission(permission.REQUEST_NETWORK_SCORES))
.thenReturn(PackageManager.PERMISSION_DENIED);
@@ -355,7 +355,7 @@ public class NetworkScoreServiceTest {
}
@Test
public void testClearScores_notActiveScorer_hasBroadcastNetworkPermission()
public void testClearScores_notActiveScorer_hasRequestNetworkScoresPermission()
throws RemoteException {
when(mNetworkScorerAppManager.isCallerActiveScorer(anyInt())).thenReturn(false);
when(mContext.checkCallingOrSelfPermission(permission.REQUEST_NETWORK_SCORES))
@@ -382,7 +382,7 @@ public class NetworkScoreServiceTest {
}
@Test
public void testDisableScoring_notActiveScorer_noBroadcastNetworkPermission() {
public void testDisableScoring_notActiveScorer_noRequestNetworkScoresPermission() {
when(mNetworkScorerAppManager.isCallerActiveScorer(anyInt())).thenReturn(false);
when(mContext.checkCallingOrSelfPermission(permission.REQUEST_NETWORK_SCORES))
.thenReturn(PackageManager.PERMISSION_DENIED);
@@ -396,7 +396,7 @@ public class NetworkScoreServiceTest {
}
@Test
public void testRegisterNetworkScoreCache_noBroadcastNetworkPermission() {
public void testRegisterNetworkScoreCache_noRequestNetworkScoresPermission() {
doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
eq(permission.REQUEST_NETWORK_SCORES), anyString());
@@ -410,7 +410,7 @@ public class NetworkScoreServiceTest {
}
@Test
public void testUnregisterNetworkScoreCache_noBroadcastNetworkPermission() {
public void testUnregisterNetworkScoreCache_noRequestNetworkScoresPermission() {
doThrow(new SecurityException()).when(mContext).enforceCallingOrSelfPermission(
eq(permission.REQUEST_NETWORK_SCORES), anyString());