summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2018-07-27 14:02:58 -0700
committerRoshan Pius <rpius@google.com>2018-07-27 14:09:32 -0700
commitedc5e98a08c6a0001624d149b656e51076bd34c8 (patch)
tree9be8b63b2d08b553c73582d9ce11703ef5667303 /tests
parent4446fd4dc77a44ee3ede75c2b109209110ab5a15 (diff)
WifiServiceImplTest: Reenable disabled tests
These tests were disabled when we downgraded mockito previously (b/72052158). Now that we're back to a new new version of mockito, these tests can be enabled again. Bug: 72571446 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I7c4462fee32a4020915f80dbed140fb9d4d9c68c
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
index addaf354b..070d0667e 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
@@ -103,7 +103,6 @@ import com.android.server.wifi.util.WifiPermissionsUtil;
import com.android.server.wifi.util.WifiPermissionsWrapper;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.ArgumentMatcher;
@@ -905,7 +904,6 @@ public class WifiServiceImplTest {
/**
* Ensure we do not allow unpermitted callers to get the wifi ap state.
*/
- @Ignore
@Test
public void testGetWifiApEnabledPermissionDenied() {
// we should not be able to get the state
@@ -1053,7 +1051,6 @@ public class WifiServiceImplTest {
/**
* Ensure that we handle scan request failure when posting the runnable to handler fails.
*/
- @Ignore
@Test
public void testStartScanFailureInRunWithScissors() {
setupClientModeImplHandlerForRunWithScissors();
@@ -1159,7 +1156,6 @@ public class WifiServiceImplTest {
/**
* Ensure that we handle scan results failure when posting the runnable to handler fails.
*/
- @Ignore
@Test
public void testGetScanResultsFailureInRunWithScissors() {
setupClientModeImplHandlerForRunWithScissors();
@@ -1550,7 +1546,6 @@ public class WifiServiceImplTest {
/**
* Verify that wifi service registers for callers BinderDeath event
*/
- @Ignore
@Test
public void registersForBinderDeathOnRegisterSoftApCallback() throws Exception {
final int callbackIdentifier = 1;
@@ -2271,7 +2266,6 @@ public class WifiServiceImplTest {
* Verify that a call to {@link WifiServiceImpl#restoreSupplicantBackupData(byte[], byte[])} is
* only allowed from callers with the signature only NETWORK_SETTINGS permission.
*/
- @Ignore
@Test(expected = SecurityException.class)
public void testRestoreSupplicantBackupDataNotApprovedCaller() {
doThrow(new SecurityException()).when(mContext)
@@ -2299,12 +2293,14 @@ public class WifiServiceImplTest {
* Verify that a call to {@link WifiServiceImpl#enableVerboseLogging(int)} is allowed from
* callers with the signature only NETWORK_SETTINGS permission.
*/
- @Ignore("TODO: Investigate failure")
@Test
public void testEnableVerboseLoggingWithNetworkSettingsPermission() {
doNothing().when(mContext)
.enforceCallingOrSelfPermission(eq(android.Manifest.permission.NETWORK_SETTINGS),
eq("WifiService"));
+ // Vebose logging is enabled first in the constructor for WifiServiceImpl, so reset
+ // before invocation.
+ reset(mClientModeImpl);
mWifiServiceImpl.enableVerboseLogging(1);
verify(mClientModeImpl).enableVerboseLogging(anyInt());
}
@@ -2318,6 +2314,9 @@ public class WifiServiceImplTest {
doThrow(new SecurityException()).when(mContext)
.enforceCallingOrSelfPermission(eq(android.Manifest.permission.NETWORK_SETTINGS),
eq("WifiService"));
+ // Vebose logging is enabled first in the constructor for WifiServiceImpl, so reset
+ // before invocation.
+ reset(mClientModeImpl);
mWifiServiceImpl.enableVerboseLogging(1);
verify(mClientModeImpl, never()).enableVerboseLogging(anyInt());
}